From 7060b0320d1479bb9476e0cbd4acc584e059e1ff Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 29 May 2019 15:14:09 +0300 Subject: Fixed c++11 narrowing error in table.cc --- sql/table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/table.cc b/sql/table.cc index bd651673388..4805017972c 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -8813,7 +8813,7 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id) store(FLD_BEGIN_TS, thd->transaction_time()); thd->set_time(); - timeval end_time= {thd->query_start(), long(thd->query_start_sec_part())}; + timeval end_time= {thd->query_start(), int(thd->query_start_sec_part())}; store(FLD_TRX_ID, start_id); store(FLD_COMMIT_ID, end_id); store(FLD_COMMIT_TS, end_time); -- cgit v1.2.1 From 4adf52a04872d6cf8e9a230989335c311764099f Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Wed, 22 May 2019 12:53:35 +0200 Subject: Add missing script header --- .../mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh | 2 ++ storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh | 2 ++ storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh | 2 ++ .../rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh | 2 ++ .../rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh | 2 ++ .../mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh | 2 ++ .../mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh | 2 ++ 7 files changed, 14 insertions(+) diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh index 6174e5d1864..db470f527ca 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_slocket_socket.sh @@ -1,2 +1,4 @@ +#!/bin/bash + src_data_dir="${MYSQLTEST_VARDIR}/mysqld.1/data/" python -c "import socket as s; sock = s.socket(s.AF_UNIX); sock.bind('${src_data_dir}/slocket')" diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh index a4d60dc864c..2004caca160 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/create_table.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e COPY_LOG=$1 diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh index f3836ab75e5..80f1a5e2567 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e # Insert 100 batches of 100 records each to a table with following schema: diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh index a4e4afab9d4..a8e6fc445bb 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_and_run.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e # Initially loads a chunk of data. diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh index ed0b3cb5c1c..036d68662d4 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/load_data_slocket.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e # Insert 10 batches of 10 records each to a table with following schema: diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh index 0c2c71aad68..9114629ba31 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/remove_slocket_socket.sh @@ -1,2 +1,4 @@ +#!/bin/bash + src_data_dir="${MYSQLTEST_VARDIR}/mysqld.1/data/" rm "${src_data_dir}/slocket" diff --git a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh index 18e1feeda96..3c95068a488 100755 --- a/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh +++ b/storage/rocksdb/mysql-test/rocksdb_hotbackup/include/setup_replication_gtid.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e binlog_line=($(grep -o "Last binlog file position [0-9]*, file name .*\.[0-9]*" ${MYSQLTEST_VARDIR}/log/mysqld.2.err | tail -1)) -- cgit v1.2.1 From 80a142f14622e4c578ebc3bb47d307ddb860f3f9 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 30 May 2019 17:19:13 +0400 Subject: Lintian complains about script-not-executable Removed #! sequence from non-executable script. --- storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk | 2 -- 1 file changed, 2 deletions(-) diff --git a/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk b/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk index 4617b6d9fc3..a921f47243e 100644 --- a/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk +++ b/storage/rocksdb/mysql-test/rocksdb/slow_query_log.awk @@ -1,5 +1,3 @@ -#!/bin/awk - /Query_time:/ { results["Rows_examined:"] = "uninit"; results["RocksDB_key_skipped:"] = "uninit"; -- cgit v1.2.1 From 9d142a895c4ac9e34f839222df70b967dfb840e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 30 May 2019 20:59:34 +0300 Subject: Define page_id_t in buf0types.h --- storage/innobase/include/buf0buf.h | 71 ------------------------------------ storage/innobase/include/buf0types.h | 71 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 58314bed71a..086bfb12710 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -215,77 +215,6 @@ struct buf_pools_list_size_t { }; #endif /* !UNIV_INNOCHECKSUM */ -/** Page identifier. */ -class page_id_t { -public: - - /** Constructor from (space, page_no). - @param[in] space tablespace id - @param[in] page_no page number */ - page_id_t(ulint space, ulint page_no) - : m_space(uint32_t(space)), m_page_no(uint32(page_no)) - { - ut_ad(space <= 0xFFFFFFFFU); - ut_ad(page_no <= 0xFFFFFFFFU); - } - - bool operator==(const page_id_t& rhs) const - { - return m_space == rhs.m_space && m_page_no == rhs.m_page_no; - } - bool operator!=(const page_id_t& rhs) const { return !(*this == rhs); } - - bool operator<(const page_id_t& rhs) const - { - if (m_space == rhs.m_space) { - return m_page_no < rhs.m_page_no; - } - - return m_space < rhs.m_space; - } - - /** Retrieve the tablespace id. - @return tablespace id */ - uint32_t space() const { return m_space; } - - /** Retrieve the page number. - @return page number */ - uint32_t page_no() const { return m_page_no; } - - /** Retrieve the fold value. - @return fold value */ - ulint fold() const { return (m_space << 20) + m_space + m_page_no; } - - /** Reset the page number only. - @param[in] page_no page number */ - inline void set_page_no(ulint page_no) - { - m_page_no = uint32_t(page_no); - - ut_ad(page_no <= 0xFFFFFFFFU); - } - -private: - - /** Tablespace id. */ - uint32_t m_space; - - /** Page number. */ - uint32_t m_page_no; - - /** Declare the overloaded global operator<< as a friend of this - class. Refer to the global declaration for further details. Print - the given page_id_t object. - @param[in,out] out the output stream - @param[in] page_id the page_id_t object to be printed - @return the output stream */ - friend - std::ostream& - operator<<( - std::ostream& out, - const page_id_t page_id); -}; - /** Print the given page_id_t object. @param[in,out] out the output stream @param[in] page_id the page_id_t object to be printed diff --git a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h index 2523c0054d3..63299681823 100644 --- a/storage/innobase/include/buf0types.h +++ b/storage/innobase/include/buf0types.h @@ -125,6 +125,77 @@ this must be equal to UNIV_PAGE_SIZE */ #define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES) /* @} */ +/** Page identifier. */ +class page_id_t { +public: + + /** Constructor from (space, page_no). + @param[in] space tablespace id + @param[in] page_no page number */ + page_id_t(ulint space, ulint page_no) + : m_space(uint32_t(space)), m_page_no(uint32(page_no)) + { + ut_ad(space <= 0xFFFFFFFFU); + ut_ad(page_no <= 0xFFFFFFFFU); + } + + bool operator==(const page_id_t& rhs) const + { + return m_space == rhs.m_space && m_page_no == rhs.m_page_no; + } + bool operator!=(const page_id_t& rhs) const { return !(*this == rhs); } + + bool operator<(const page_id_t& rhs) const + { + if (m_space == rhs.m_space) { + return m_page_no < rhs.m_page_no; + } + + return m_space < rhs.m_space; + } + + /** Retrieve the tablespace id. + @return tablespace id */ + uint32_t space() const { return m_space; } + + /** Retrieve the page number. + @return page number */ + uint32_t page_no() const { return m_page_no; } + + /** Retrieve the fold value. + @return fold value */ + ulint fold() const { return (m_space << 20) + m_space + m_page_no; } + + /** Reset the page number only. + @param[in] page_no page number */ + void set_page_no(ulint page_no) + { + m_page_no = uint32_t(page_no); + + ut_ad(page_no <= 0xFFFFFFFFU); + } + +private: + + /** Tablespace id. */ + uint32_t m_space; + + /** Page number. */ + uint32_t m_page_no; + + /** Declare the overloaded global operator<< as a friend of this + class. Refer to the global declaration for further details. Print + the given page_id_t object. + @param[in,out] out the output stream + @param[in] page_id the page_id_t object to be printed + @return the output stream */ + friend + std::ostream& + operator<<( + std::ostream& out, + const page_id_t page_id); +}; + #ifndef UNIV_INNOCHECKSUM #include "ut0mutex.h" -- cgit v1.2.1 From c9b49a4be723c18a8fad2bf4fd549079d45a33a5 Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Fri, 24 May 2019 13:09:13 +0300 Subject: MDEV-18207: ASAN heap-use-after-free in _ma_get_status upon concurrent operations with sequence The issue is that two MARIA_HA instances shares the same MARIA_STATUS_INFO object during UNION execution, so the second MARIA_HA instance state pointer MARIA_HA::state points to the MARIA_HA::state_save of the first MARIA instance. This happens in thr_multi_lock(...) { ... for (first_lock=data, pos= data+1 ; pos < end ; pos++) { ... if (pos[0]->lock == pos[-1]->lock && pos[0]->lock->copy_status) (pos[0]->lock->copy_status)((*pos)->status_param, (*first_lock)->status_param); ... } ... } Usually the state is restored from ha_maria::external_lock(...): \#0 _ma_update_status (param=0x6290000e6270) at ./storage/maria/ma_state.c:309 \#1 0x00005555577ccb15 in _ma_update_status_with_lock (info=0x6290000e6270) at ./storage/maria/ma_state.c:361 \#2 0x00005555577c7dcc in maria_lock_database (info=0x6290000e6270, lock_type=2) at ./storage/maria/ma_locking.c:66 \#3 0x0000555557802ccd in ha_maria::external_lock (this=0x61d0001b1308, thd=0x62a000048270, lock_type=2) at ./storage/maria/ha_maria.cc:2727 But _ma_update_status() does not take into account the case when MARIA_HA::status points to the MARIA_HA::state_save of the other MARIA_HA instance. The fix is to restore MARIA_HA::state in ha_maria::external_lock() after maria_lock_database() call for transactional tables. --- storage/maria/ha_maria.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 5a371a07fc3..f64ea4b1edb 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2798,9 +2798,12 @@ int ha_maria::external_lock(THD *thd, int lock_type) } } } /* if transactional table */ - DBUG_RETURN(maria_lock_database(file, !table->s->tmp_table ? + int result = maria_lock_database(file, !table->s->tmp_table ? lock_type : ((lock_type == F_UNLCK) ? - F_UNLCK : F_EXTRA_LCK))); + F_UNLCK : F_EXTRA_LCK)); + if (!file->s->base.born_transactional) + file->state= &file->s->state.state; // Restore state if clone + DBUG_RETURN(result); } int ha_maria::start_stmt(THD *thd, thr_lock_type lock_type) -- cgit v1.2.1 From e730ea1e3ebe2a5f3b6d93d5c05c3c387fab8c57 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 3 Jun 2019 09:55:40 +0200 Subject: Only link mysys_ssl when required. Do not use TARGET_LINK_LIBRARIES(mysys mysys_ssl), this means that mysys_ssl is linked to practically everything. --- client/CMakeLists.txt | 4 ++-- mysys/CMakeLists.txt | 4 ++-- plugin/auth_ed25519/CMakeLists.txt | 2 +- unittest/mysys/CMakeLists.txt | 4 ++-- unittest/sql/CMakeLists.txt | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 96346808a62..37087b7c6c6 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -72,10 +72,10 @@ MYSQL_ADD_EXECUTABLE(mysql_plugin mysql_plugin.c) TARGET_LINK_LIBRARIES(mysql_plugin ${CLIENT_LIB}) MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc) -TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB}) +TARGET_LINK_LIBRARIES(mysqlbinlog ${CLIENT_LIB} mysys_ssl) MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc ../sql/password.c) -TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB}) +TARGET_LINK_LIBRARIES(mysqladmin ${CLIENT_LIB} mysys_ssl) MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c) SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS") diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 5afc3a079e7..22d758d45a5 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -73,8 +73,8 @@ IF(HAVE_MLOCK) ENDIF() ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) -TARGET_LINK_LIBRARIES(mysys dbug strings mysys_ssl ${ZLIB_LIBRARY} - ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_VPMSUM_LIBRARY}) +TARGET_LINK_LIBRARIES(mysys dbug strings + ${ZLIB_LIBRARY} ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO} ${CRC32_VPMSUM_LIBRARY}) DTRACE_INSTRUMENT(mysys) IF(HAVE_BFD_H) diff --git a/plugin/auth_ed25519/CMakeLists.txt b/plugin/auth_ed25519/CMakeLists.txt index 73d8eeb208b..8ed50e8fec9 100644 --- a/plugin/auth_ed25519/CMakeLists.txt +++ b/plugin/auth_ed25519/CMakeLists.txt @@ -28,5 +28,5 @@ MYSQL_ADD_PLUGIN(client_ed25519 client_ed25519.c MODULE_ONLY CLIENT LINK_LIBRARIES mysys_ssl ref10 COMPONENT ClientPlugins) IF(WITH_UNIT_TESTS) - MY_ADD_TESTS(ed25519 LINK_LIBRARIES mysys ref10) + MY_ADD_TESTS(ed25519 LINK_LIBRARIES ref10 mysys_ssl) ENDIF() diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt index f06d63d05fb..1d97340784d 100644 --- a/unittest/mysys/CMakeLists.txt +++ b/unittest/mysys/CMakeLists.txt @@ -14,10 +14,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA MY_ADD_TESTS(bitmap base64 my_atomic my_rdtsc lf my_malloc my_getopt dynstring - aes byte_order + byte_order LINK_LIBRARIES mysys) MY_ADD_TESTS(my_vsnprintf LINK_LIBRARIES strings mysys) - +MY_ADD_TESTS(aes LINK_LIBRARIES mysys mysys_ssl) ADD_DEFINITIONS(${SSL_DEFINES}) MY_ADD_TESTS(ma_dyncol LINK_LIBRARIES mysys) diff --git a/unittest/sql/CMakeLists.txt b/unittest/sql/CMakeLists.txt index f63dc0b2a21..a4ba1019e49 100644 --- a/unittest/sql/CMakeLists.txt +++ b/unittest/sql/CMakeLists.txt @@ -31,6 +31,6 @@ TARGET_LINK_LIBRARIES(explain_filename-t sql mytap) MY_ADD_TEST(explain_filename) ADD_EXECUTABLE(mf_iocache-t mf_iocache-t.cc ../../sql/mf_iocache_encr.cc) -TARGET_LINK_LIBRARIES(mf_iocache-t mysys mytap) +TARGET_LINK_LIBRARIES(mf_iocache-t mysys mytap mysys_ssl) ADD_DEPENDENCIES(mf_iocache-t GenError) MY_ADD_TEST(mf_iocache) -- cgit v1.2.1 From 724aefa56d5837e8ecaacd87477f4ebe00601b0f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 3 Jun 2019 13:52:33 +0200 Subject: Fix linking error, for GNU linker. --- plugin/auth_ed25519/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/auth_ed25519/CMakeLists.txt b/plugin/auth_ed25519/CMakeLists.txt index 8ed50e8fec9..ff6651c528d 100644 --- a/plugin/auth_ed25519/CMakeLists.txt +++ b/plugin/auth_ed25519/CMakeLists.txt @@ -25,7 +25,7 @@ MYSQL_ADD_PLUGIN(auth_ed25519 server_ed25519.c ${REF10_SOURCES} MODULE_ONLY) # client plugin and unit test ed25519-t can use the library MYSQL_ADD_PLUGIN(client_ed25519 client_ed25519.c MODULE_ONLY - CLIENT LINK_LIBRARIES mysys_ssl ref10 COMPONENT ClientPlugins) + CLIENT LINK_LIBRARIES ref10 mysys_ssl COMPONENT ClientPlugins) IF(WITH_UNIT_TESTS) MY_ADD_TESTS(ed25519 LINK_LIBRARIES ref10 mysys_ssl) -- cgit v1.2.1 From 2d89a70facaf9c9f71bad1c805c44b625b0f607d Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sun, 2 Jun 2019 11:35:12 +0300 Subject: Fix plugin linking on Windows --- sql/handler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/handler.h b/sql/handler.h index a777b7c595a..fcf9e7b0a6e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -777,7 +777,7 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, size_t type_len, const char *file, size_t file_len, const char *status, size_t status_len); enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX }; -extern st_plugin_int *hton2plugin[MAX_HA]; +extern MYSQL_PLUGIN_IMPORT st_plugin_int *hton2plugin[MAX_HA]; /* Transaction log maintains type definitions */ enum log_status -- cgit v1.2.1 From 76f14be10f5e6cebf44a93e48673930fdeb50442 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 2 Jun 2019 11:47:36 +0300 Subject: Ensure that tests and programs can restore variables - --default-character-set can now be disabled in mysqldump - --skip-resolve can be be disabled in mysqld - mysql_client_test now resets global variables it changes - mtr couldn't handle [mysqldump] in config files (wrong regexp used) --- client/mysqldump.c | 4 ++++ mysql-test/lib/My/ConfigFactory.pm | 6 +++--- sql/mysqld.cc | 6 ++++-- tests/mysql_client_test.c | 30 ++++++++++++++++++++++++------ 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 2195786e7ea..b9ff8caed8c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -967,6 +967,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), exit(1); } break; + case (int) OPT_DEFAULT_CHARSET: + if (default_charset == disabled_my_option) + default_charset= (char *)mysql_universal_client_charset; + break; } return 0; } diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index cae2c8c33e5..6d4c7f43390 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -311,7 +311,7 @@ sub post_check_client_groups { $first_mysqld->name()); # Then generate [client.] for each [mysqld.] - foreach my $mysqld ( $config->like('mysqld.') ) { + foreach my $mysqld ( $config->like('mysqld\.') ) { $self->post_check_client_group($config, 'client'.$mysqld->after('mysqld'), $mysqld->name()) @@ -333,7 +333,7 @@ sub post_check_embedded_group { my $mysqld= $config->group('mysqld') or croak "Can't run with embedded, config has no default mysqld section"; - my $first_mysqld= $config->first_like('mysqld.') or + my $first_mysqld= $config->first_like('mysqld\.') or croak "Can't run with embedded, config has no mysqld"; my %no_copy = map { $_ => 1 } @@ -457,7 +457,7 @@ sub new_config { } $self->run_section_rules($config, - 'mysqld.', + 'mysqld\.', @mysqld_rules); # [mysqlbinlog] need additional settings diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 263a9b4645a..60dce5a7ff3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9254,8 +9254,10 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) opt_specialflag|= SPECIAL_NO_HOST_CACHE; break; case (int) OPT_SKIP_RESOLVE: - opt_skip_name_resolve= 1; - opt_specialflag|=SPECIAL_NO_RESOLVE; + if ((opt_skip_name_resolve= (argument != disabled_my_option))) + opt_specialflag|= SPECIAL_NO_RESOLVE; + else + opt_specialflag&= ~SPECIAL_NO_RESOLVE; break; case (int) OPT_WANT_CORE: test_flags |= TEST_CORE_ON_SIGNAL; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 04717f1946b..c544e20f2fe 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2341,6 +2341,12 @@ static void test_ps_query_cache() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); + rc= mysql_query(mysql, + "set @save_query_cache_type=" + "@@global.query_cache_type," + "@save_query_cache_size=" + "@@global.query_cache_size"); + myquery(rc); rc= mysql_query(lmysql, "set global query_cache_type=ON"); myquery(rc); rc= mysql_query(lmysql, "set local query_cache_type=ON"); @@ -2497,9 +2503,9 @@ static void test_ps_query_cache() if (lmysql != mysql) mysql_close(lmysql); - rc= mysql_query(mysql, "set global query_cache_size=default"); + rc= mysql_query(mysql, "set global query_cache_size=@save_query_cache_size"); myquery(rc); - rc= mysql_query(mysql, "set global query_cache_type=default"); + rc= mysql_query(mysql, "set global query_cache_type=@save_query_cache_type"); myquery(rc); } @@ -13364,6 +13370,12 @@ static void test_open_cursor_prepared_statement_query_cache() return; } + rc= mysql_query(mysql, + "set @save_query_cache_type=" + "@@global.query_cache_type," + "@save_query_cache_size=" + "@@global.query_cache_size"); + myquery(rc); rc= mysql_query(mysql, "set global query_cache_type=ON"); myquery(rc); rc= mysql_query(mysql, "set local query_cache_type=ON"); @@ -13390,9 +13402,9 @@ static void test_open_cursor_prepared_statement_query_cache() check_execute(stmt, rc); mysql_stmt_close(stmt); - rc= mysql_query(mysql, "set global query_cache_type=default"); + rc= mysql_query(mysql, "set global query_cache_type=@save_query_cache_type"); myquery(rc); - rc= mysql_query(mysql, "set global query_cache_size=default"); + rc= mysql_query(mysql, "set global query_cache_size=@save_query_cache_size"); myquery(rc); } @@ -18177,6 +18189,12 @@ static void test_bug36326() myquery(rc); rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)"); myquery(rc); + rc= mysql_query(mysql, + "set @save_query_cache_type=" + "@@global.query_cache_type," + "@save_query_cache_size=" + "@@global.query_cache_size"); + myquery(rc); rc= mysql_query(mysql, "SET GLOBAL query_cache_type = 1"); myquery(rc); rc= mysql_query(mysql, "SET LOCAL query_cache_type = 1"); @@ -18204,8 +18222,8 @@ static void test_bug36326() DIE_UNLESS(rc == 1); rc= mysql_query(mysql, "DROP TABLE t1"); myquery(rc); - rc= mysql_query(mysql, "SET GLOBAL query_cache_size = default"); - rc= mysql_query(mysql, "SET GLOBAL query_cache_type = default"); + rc= mysql_query(mysql, "SET GLOBAL query_cache_size = @save_query_cache_size"); + rc= mysql_query(mysql, "SET GLOBAL query_cache_type = @save_query_cache_type"); myquery(rc); DBUG_VOID_RETURN; -- cgit v1.2.1 From 05f8120d0ebaccba6c8dbad1124592315bd1f355 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 2 Jun 2019 13:53:16 +0300 Subject: Fixed compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrong compiler warning from GCC: ‘snprintf’ output 2 or more bytes (assuming 4001) into a destination of size 4000 --- extra/mariabackup/xtrabackup.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 3d5e8a690a4..4163fd1d210 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -5235,7 +5235,11 @@ next_file_item_1: goto next_datadir_item; } - snprintf(dbpath, sizeof(dbpath), "%s/%s", path, dbinfo.name); + snprintf(dbpath, sizeof(dbpath), "%.*s/%.*s", + OS_FILE_MAX_PATH/2-1, + path, + OS_FILE_MAX_PATH/2-1, + dbinfo.name); os_normalize_path(dbpath); -- cgit v1.2.1 From 1bfa7ceb72c779171791bf424909074518028124 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 2 Jun 2019 13:53:48 +0300 Subject: Supress some valgrind warnings --- mysql-test/valgrind.supp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index ab3d1ba1efe..a8ca80e203a 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1751,3 +1751,23 @@ ... } +# +# OpenSSL 1.0.1l problems +# + +{ + OpenSSL 1.0.1l wrong jump + Memcheck:Cond + fun:bcmp + obj:/usr/lib64/libcrypto.so* + fun:FIPS_selftest +} + +{ + OpenSSL 1.0.1l wrong jump 2 + Memcheck:Cond + obj:/usr/lib64/libcrypto.so* + fun:FIPS_mode_set + obj:/usr/lib64/libcrypto.so* +} + -- cgit v1.2.1 From 40becbc3c7a6555d0a4bb186b4336a2899d5995c Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 2 Jun 2019 16:30:33 +0300 Subject: Fixed bug in online alter table when not compiled with performance schema os_file_write_func() and os_file_read_no_error_handling_func() returned different result values depending on if UNIV_PFS_IO was defined or not. Other things: - Added some comments about return values for some functions --- storage/innobase/include/os0file.h | 4 ++-- storage/innobase/include/os0file.ic | 12 ++++++------ storage/innobase/row/row0merge.cc | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 5be476ff109..324ff99f67b 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1197,12 +1197,12 @@ to original un-instrumented file I/O APIs */ # define os_file_read_no_error_handling(type, file, buf, offset, n, o) \ os_file_read_no_error_handling_func(type, file, buf, offset, n, o) # define os_file_read_no_error_handling_int_fd(type, file, buf, offset, n) \ - os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) + (os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) == 0) # define os_file_write(type, name, file, buf, offset, n) \ os_file_write_func(type, name, file, buf, offset, n) # define os_file_write_int_fd(type, name, file, buf, offset, n) \ - os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) + (os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) == 0) # define os_file_flush(file) os_file_flush_func(file) diff --git a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic index 89eceb77e5f..7a490bf775a 100644 --- a/storage/innobase/include/os0file.ic +++ b/storage/innobase/include/os0file.ic @@ -348,7 +348,7 @@ a synchronous read operation. @param[in] n number of bytes to read @param[in] src_file caller file name @param[in] src_line caller line number -@return whether the request was successful */ +@return 0 on error, 1 on success */ UNIV_INLINE bool pfs_os_file_read_no_error_handling_int_fd_func( @@ -371,14 +371,14 @@ pfs_os_file_read_no_error_handling_int_fd_func( __FILE__, __LINE__); } - bool success = DB_SUCCESS == os_file_read_no_error_handling_func( + bool success = os_file_read_no_error_handling_func( type, OS_FILE_FROM_FD(file), buf, offset, n, NULL); if (locker != NULL) { PSI_FILE_CALL(end_file_wait)(locker, n); } - return(success); + return(success == DB_SUCCESS); // Reverse result } /** NOTE! Please use the corresponding macro os_file_write(), not directly @@ -435,7 +435,7 @@ os_file_write_int_fd() which requests a synchronous write operation. @param[in] n number of bytes @param[in] src_file file name where func invoked @param[in] src_line line where the func invoked -@return whether the request was successful */ +@return 0 on error, 1 on success */ UNIV_INLINE bool pfs_os_file_write_int_fd_func( @@ -459,14 +459,14 @@ pfs_os_file_write_int_fd_func( __FILE__, __LINE__); } - bool success = DB_SUCCESS == os_file_write_func( + bool success = os_file_write_func( type, name, OS_FILE_FROM_FD(file), buf, offset, n); if (locker != NULL) { PSI_FILE_CALL(end_file_wait)(locker, n); } - return(success); + return(success == DB_SUCCESS); // Reverse result } /** NOTE! Please use the corresponding macro os_file_flush(), not directly diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index c7f628339e0..e0c819bea4b 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1115,7 +1115,7 @@ row_merge_read( /********************************************************************//** Write a merge block to the file system. -@return whether the request was completed successfully */ +@return 0 on error, 1 if write succeded */ UNIV_INTERN bool row_merge_write( -- cgit v1.2.1 From aa83b9cf4f23d7f61b1f6abf92e8280e8c1757cb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 18 May 2019 11:38:43 +0200 Subject: update a test result, followup fae6539ef72 --- mysql-test/suite/plugins/r/feedback_plugin_send.result | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result index 35db81fa6c1..70dfbcb62dc 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_send.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result @@ -2,9 +2,9 @@ select plugin_status from information_schema.plugins where plugin_name='feedback plugin_status ACTIVE SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used'; -SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used'; -variable_value = @feedback_used + 1 -0 +SELECT variable_value = @feedback_used + 1 as 'MUST BE 1' FROM information_schema.feedback where variable_name = 'FEEDBACK used'; +MUST BE 1 +1 select * from information_schema.feedback where variable_name like 'feed%' and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used' and variable_name not like '%debug%'; -- cgit v1.2.1 From c5beac68472ed2020c12d078031b8c35ed5d7cb5 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 4 Jun 2019 10:07:39 +0200 Subject: MDEV-19684 enable intel assembly (AESNI etc) and fastmath when compiling WolfSSL Using different recommended speedup options for WolfSSL. - Enable x64 assembly code on Intel. - in my_crypt.cc, align EVP_CIPHER_CTX buffer, since some members need alignment of 16 (for AESNI instructions), when assembler is enabled. - Adjust MY_AES_CTX_SIZE - Enable fastmath in wolfssl (large integer math). --- extra/wolfssl/CMakeLists.txt | 63 ++++++++++++++++++++++++++++++++++++++-- include/mysql/service_my_crypt.h | 2 +- mysys_ssl/my_crypt.cc | 25 ++++++++++++---- 3 files changed, 82 insertions(+), 8 deletions(-) diff --git a/extra/wolfssl/CMakeLists.txt b/extra/wolfssl/CMakeLists.txt index 6de9ea5d5d3..cf6715280e3 100644 --- a/extra/wolfssl/CMakeLists.txt +++ b/extra/wolfssl/CMakeLists.txt @@ -1,3 +1,26 @@ +IF(MSVC) + PROJECT(wolfssl C ASM_MASM) +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + PROJECT(wolfssl C ASM) +ELSE() + PROJECT(wolfssl C) +ENDIF() + +IF(MSVC AND (CMAKE_SIZEOF_VOID_P MATCHES 8)) + SET(WOLFSSL_INTELASM ON) +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + IF(CMAKE_C_COMPILER_ID MATCHES GNU AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) + MESSAGE_ONCE(NO_INTEL_ASSEMBLY "Disable Intel assembly for WolfSSL - compiler is too old") + ELSE() + MY_CHECK_C_COMPILER_FLAG(-maes) + MY_CHECK_C_COMPILER_FLAG(-msse4) + MY_CHECK_C_COMPILER_FLAG(-mpclmul) + ENDIF() + IF(have_C__maes AND have_C__msse4 AND have_C__mpclmul) + SET(WOLFSSL_INTELASM ON) + ENDIF() +ENDIF() + SET(WOLFSSL_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl/src) ADD_DEFINITIONS(${SSL_DEFINES}) ADD_DEFINITIONS( @@ -32,7 +55,7 @@ ADD_DEFINITIONS(-DWOLFSSL_LIB) INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl) IF(MSVC) # size_t to long truncation warning - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4267") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4267 -wd4334") IF(CMAKE_C_COMPILER_ID MATCHES Clang) # Workaround a bug with clang-cl, see https://github.com/wolfSSL/wolfssl/pull/2090 ADD_DEFINITIONS(-DMP_16BIT) @@ -66,7 +89,6 @@ ${WOLFCRYPT_SRCDIR}/dsa.c ${WOLFCRYPT_SRCDIR}/ecc.c ${WOLFCRYPT_SRCDIR}/error.c ${WOLFCRYPT_SRCDIR}/hmac.c -${WOLFCRYPT_SRCDIR}/integer.c ${WOLFCRYPT_SRCDIR}/logging.c ${WOLFCRYPT_SRCDIR}/md4.c ${WOLFCRYPT_SRCDIR}/md5.c @@ -85,5 +107,42 @@ ${WOLFCRYPT_SRCDIR}/hash.c ${WOLFCRYPT_SRCDIR}/wolfmath.c ) +# Use fastmath large number math library. +IF(NOT (MSVC AND CMAKE_C_COMPILER_ID MATCHES Clang) + AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) + SET(WOLFSSL_FASTMATH 1) +ENDIF() + +IF(WOLFSSL_FASTMATH) + ADD_DEFINITIONS(-DUSE_FAST_MATH) + # FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test + # WolfSSL will use more stack space with it + ADD_DEFINITIONS(-DFP_MAX_BITS=16384) + SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/tfm.c) +ELSE() + SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/integer.c) +ENDIF() + +IF(WOLFSSL_INTELASM) + ADD_DEFINITIONS(-DWOLFSSL_AESNI) + SET(SSL_DEFINES "${SSL_DEFINES} -DWOLFSSL_AESNI" PARENT_SCOPE) + LIST(APPEND WOLFCRYPT_SOURCES ${WOLFCRYPT_SRCDIR}/cpuid.c) + IF(MSVC) + LIST(APPEND WOLFCRYPT_SOURCES ${WOLFCRYPT_SRCDIR}/aes_asm.asm) + IF(CMAKE_C_COMPILER_ID MATCHES Clang) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") + ELSE() + ADD_DEFINITIONS(-DHAVE_INTEL_RDSEED -DWOLFSSL_X86_64_BUILD) + ENDIF() + ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + ADD_DEFINITIONS(-DHAVE_INTEL_RDSEED -DUSE_INTEL_SPEEDUP) + LIST(APPEND WOLFCRYPT_SOURCES + ${WOLFCRYPT_SRCDIR}/aes_asm.S + ${WOLFCRYPT_SRCDIR}/sha512_asm.S + ${WOLFCRYPT_SRCDIR}/sha256_asm.S) + ADD_DEFINITIONS(-maes -msse4 -mpclmul) + ENDIF() +ENDIF() + ADD_CONVENIENCE_LIBRARY(wolfcrypt ${WOLFCRYPT_SOURCES}) diff --git a/include/mysql/service_my_crypt.h b/include/mysql/service_my_crypt.h index 2de698fe41c..039125066ca 100644 --- a/include/mysql/service_my_crypt.h +++ b/include/mysql/service_my_crypt.h @@ -45,7 +45,7 @@ extern "C" { /* The max key length of all supported algorithms */ #define MY_AES_MAX_KEY_LENGTH 32 -#define MY_AES_CTX_SIZE 560 +#define MY_AES_CTX_SIZE 600 enum my_aes_mode { MY_AES_ECB, MY_AES_CBC diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc index a668c222b79..fda909e6530 100644 --- a/mysys_ssl/my_crypt.cc +++ b/mysys_ssl/my_crypt.cc @@ -25,16 +25,28 @@ #include #include +#include + +#ifdef HAVE_WOLFSSL +#define CTX_ALIGN 16 +#else +#define CTX_ALIGN 0 +#endif class MyCTX { public: - char ctx_buf[EVP_CIPHER_CTX_SIZE]; - EVP_CIPHER_CTX *ctx; - + char ctx_buf[EVP_CIPHER_CTX_SIZE + CTX_ALIGN]; + EVP_CIPHER_CTX* ctx; MyCTX() { - ctx= (EVP_CIPHER_CTX *)ctx_buf; +#if CTX_ALIGN > 0 + uintptr_t p= ((uintptr_t)ctx_buf + (CTX_ALIGN - 1)) & ~(CTX_ALIGN - 1); + ctx = reinterpret_cast(p); +#else + ctx = (EVP_CIPHER_CTX*)ctx_buf; +#endif + EVP_CIPHER_CTX_init(ctx); } virtual ~MyCTX() @@ -149,8 +161,11 @@ public: uchar mask[MY_AES_BLOCK_SIZE]; uint mlen; - my_aes_crypt(MY_AES_ECB, ENCRYPTION_FLAG_ENCRYPT | ENCRYPTION_FLAG_NOPAD, + int rc= my_aes_crypt(MY_AES_ECB, ENCRYPTION_FLAG_ENCRYPT | ENCRYPTION_FLAG_NOPAD, oiv, sizeof(mask), mask, &mlen, key, klen, 0, 0); + DBUG_ASSERT(rc == MY_AES_OK); + if (rc) + return rc; DBUG_ASSERT(mlen == sizeof(mask)); for (uint i=0; i < buf_len; i++) -- cgit v1.2.1 From 7906bee67bf3b9f9124da12dd1492d7b766bd53e Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Tue, 4 Jun 2019 12:41:52 +0530 Subject: MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF , window functions and views Adding destructor for Group_bound_tracker to free Cached_item_str. The Cached_item for window functions are allocated on THD:mem_root but the Cached_item_str has value of type string which is allocated on the heap, so we need to call free() for it --- mysql-test/r/win.result | 27 +++++++++++++++++++++++++++ mysql-test/t/win.test | 16 ++++++++++++++++ sql/item_windowfunc.h | 12 ++++-------- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index 5da8a7f8a3c..13d452f3ef2 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -3607,5 +3607,32 @@ b row_number() over (partition by sum(a)+1) 2000 1 drop table t1; # +# MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF, +# window functions and views +# +create table t1 (id int, n1 int); +insert into t1 values (1,1),(2,1),(3,2),(4,4); +explain +select max(n1) over (partition by 'abc') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary +select max(n1) over (partition by 'abc') from t1; +max(n1) over (partition by 'abc') +4 +4 +4 +4 +explain +select rank() over (partition by 'abc' order by 'xyz') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary +select rank() over (partition by 'abc' order by 'xyz') from t1; +rank() over (partition by 'abc' order by 'xyz') +1 +1 +1 +1 +drop table t1; +# # End of 10.2 tests # diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test index 15c48c31250..a4d42ce2b91 100644 --- a/mysql-test/t/win.test +++ b/mysql-test/t/win.test @@ -2325,6 +2325,22 @@ select b, row_number() over (partition by sum(a)+1) from t1 group by b; drop table t1; +--echo # +--echo # MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF, +--echo # window functions and views +--echo # + +create table t1 (id int, n1 int); +insert into t1 values (1,1),(2,1),(3,2),(4,4); +explain +select max(n1) over (partition by 'abc') from t1; +select max(n1) over (partition by 'abc') from t1; + +explain +select rank() over (partition by 'abc' order by 'xyz') from t1; +select rank() over (partition by 'abc' order by 'xyz') from t1; +drop table t1; + --echo # --echo # End of 10.2 tests --echo # diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h index 21270733051..b9df1b7482b 100644 --- a/sql/item_windowfunc.h +++ b/sql/item_windowfunc.h @@ -28,11 +28,6 @@ public: first_check= true; } - void cleanup() - { - group_fields.empty(); - } - /* Check if the current row is in a different group than the previous row this function was called for. @@ -70,6 +65,10 @@ public: } return 0; } + ~Group_bound_tracker() + { + group_fields.delete_elements(); + } private: List group_fields; @@ -199,7 +198,6 @@ public: { if (peer_tracker) { - peer_tracker->cleanup(); delete peer_tracker; peer_tracker= NULL; } @@ -269,7 +267,6 @@ class Item_sum_dense_rank: public Item_sum_int { if (peer_tracker) { - peer_tracker->cleanup(); delete peer_tracker; peer_tracker= NULL; } @@ -537,7 +534,6 @@ class Item_sum_percent_rank: public Item_sum_window_with_row_count { if (peer_tracker) { - peer_tracker->cleanup(); delete peer_tracker; peer_tracker= NULL; } -- cgit v1.2.1 From f7579518e2c32936442a1e20e391f60660c94b3c Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 27 May 2019 10:40:04 +0300 Subject: MDEV-19600: The optimizer should be able to produce rows=1 estimate for unique index with NULLable columns Modify best_access_path() to produce rows=1 estimate for null-rejecting lookups on unique NULL keys. --- mysql-test/main/invisible_field.result | 4 +- mysql-test/main/join.result | 30 +++++++++ mysql-test/main/join.test | 30 +++++++++ mysql-test/main/order_by.result | 2 +- mysql-test/main/subselect_sj.result | 74 ++++++++++++++++++++--- mysql-test/main/subselect_sj.test | 52 +++++++++++++++- mysql-test/main/subselect_sj_jcl6.result | 58 +++++++++++++++++- mysql-test/main/subselect_sj_nonmerged.result | 12 ++-- mysql-test/main/table_elim.result | 2 +- mysql-test/suite/gcol/r/gcol_select_myisam.result | 2 +- sql/sql_select.cc | 47 +++++++++----- 11 files changed, 276 insertions(+), 37 deletions(-) diff --git a/mysql-test/main/invisible_field.result b/mysql-test/main/invisible_field.result index 876a80814e5..43a8b9d726b 100644 --- a/mysql-test/main/invisible_field.result +++ b/mysql-test/main/invisible_field.result @@ -404,8 +404,8 @@ b int(11) YES NULL c int(11) YES NULL explain select * from t1,t2 where t1.b = t2.c and t1.c = t2.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 10 -1 SIMPLE t1 ALL b,c NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 ref b,c b 5 test.t2.c 1 Using where select * from t1,t2 where t1.b = t2.c and t1.c = t2.b; a a b c 1 1 1 1 diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result index cc8e174c8e6..8ca82002855 100644 --- a/mysql-test/main/join.result +++ b/mysql-test/main/join.result @@ -1599,3 +1599,33 @@ SELECT STRAIGHT_JOIN * FROM t1, t2 AS t2_1, t2 AS t2_2 WHERE t2_2.c = t2_1.c AND t2_2.b = t2_1.b AND ( a IS NULL OR t2_1.c = a ); a b c b c DROP TABLE t1,t2; +# +# MDEV-19600: The optimizer should be able to produce rows=1 estimate for unique index with NULLable columns +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 ( +pk int not null primary key auto_increment, +a int, +b int, +unique key(a) +); +insert into t1 (a,b) select null, 12345 from t0 A, t0 B, t0 C; +insert into t1 (a,b) select a,a from t0; +# Simulate InnoDB's persistent statistics (It always uses nulls_equal) +set @tmp1= @@myisam_stats_method; +set myisam_stats_method=nulls_equal; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +set myisam_stats_method=@tmp1; +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 pk A 1010 NULL NULL BTREE +t1 0 a 1 a A 10 NULL NULL YES BTREE +# t1 must use ref(t1.a=t0.a) and rows must be 1 (and not 45): +explain select * from t0,t1 where t0.a=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 ref a a 5 test.t0.a 1 +drop table t0,t1; diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test index 3d2a02e2346..b90a9cc39eb 100644 --- a/mysql-test/main/join.test +++ b/mysql-test/main/join.test @@ -1254,3 +1254,33 @@ SELECT STRAIGHT_JOIN * FROM t1, t2 AS t2_1, t2 AS t2_2 WHERE t2_2.c = t2_1.c AND t2_2.b = t2_1.b AND ( a IS NULL OR t2_1.c = a ); DROP TABLE t1,t2; + +--echo # +--echo # MDEV-19600: The optimizer should be able to produce rows=1 estimate for unique index with NULLable columns +--echo # + +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1 ( + pk int not null primary key auto_increment, + a int, + b int, + unique key(a) +); + +# 10K of null values +insert into t1 (a,b) select null, 12345 from t0 A, t0 B, t0 C; +insert into t1 (a,b) select a,a from t0; + +--echo # Simulate InnoDB's persistent statistics (It always uses nulls_equal) +set @tmp1= @@myisam_stats_method; +set myisam_stats_method=nulls_equal; +analyze table t1; +set myisam_stats_method=@tmp1; +show keys from t1; + +--echo # t1 must use ref(t1.a=t0.a) and rows must be 1 (and not 45): +explain select * from t0,t1 where t0.a=t1.a; + +drop table t0,t1; diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index 8d1e471f618..8692e727c60 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -1515,7 +1515,7 @@ WHERE t2.b=14 AND t2.a=t1.a AND 5.1 eq_ref distinct_key distinct_key 4 test.t4.a 1 +1 PRIMARY ALL distinct_key NULL NULL NULL 5 +1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t4 ref a a 10 .max(t2.a),test.t0.a 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) insert into t4 select 100 + (B.a *100 + A.a), 100 + (B.a*100 + A.a), 'filler' from t4 A, t0 B; @@ -77,9 +77,9 @@ explain select * from t4 where t4.a in (select max(t2.a) from t1, t2 group by t2.b) and t4.b in (select max(t2.a) from t1, t2 group by t2.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL distinct_key NULL NULL NULL 5 -1 PRIMARY t4 ref a a 5 .max(t2.a) 12 Using index condition -1 PRIMARY eq_ref distinct_key distinct_key 4 test.t4.b 1 +1 PRIMARY ALL distinct_key NULL NULL NULL 5 +1 PRIMARY ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join) +1 PRIMARY t4 ref a a 10 .max(t2.a),.max(t2.a) 1 3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary 3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary diff --git a/mysql-test/main/table_elim.result b/mysql-test/main/table_elim.result index cf9a4a38779..7780e165451 100644 --- a/mysql-test/main/table_elim.result +++ b/mysql-test/main/table_elim.result @@ -279,7 +279,7 @@ insert into t2 values explain select t1.* from t1 left join t2 on t2.a=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 10 NULL 2 Using index -1 SIMPLE t2 ref a a 3 test.t1.a 2 Using where +1 SIMPLE t2 ref a a 3 test.t1.a 1 Using where drop table t1, t2; # # check UPDATE/DELETE that look like they could be eliminated diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result index d0fe7fbd0d4..280618ed76e 100644 --- a/mysql-test/suite/gcol/r/gcol_select_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result @@ -1102,7 +1102,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 AS t2 STRAIGHT_JOIN t1 FORCE INDEX(b) WHERE t1.b=t2.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL b NULL NULL NULL 2 Using where -1 SIMPLE t1 ref b b 5 test.t2.b 2 +1 SIMPLE t1 ref b b 5 test.t2.b 1 EXPLAIN SELECT b FROM t1 FORCE INDEX(b); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL b 5 NULL 2 Using index diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0fbc4bac7d8..13a5cd88c93 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5507,18 +5507,16 @@ add_key_field(JOIN *join, (*key_fields)->level= and_level; (*key_fields)->optimize= optimize; /* - If the condition has form "tbl.keypart = othertbl.field" and - othertbl.field can be NULL, there will be no matches if othertbl.field - has NULL value. - We use null_rejecting in add_not_null_conds() to add - 'othertbl.field IS NOT NULL' to tab->select_cond. + If the condition we are analyzing is NULL-rejecting and at least + one side of the equalities is NULLable, mark the KEY_FIELD object as + null-rejecting. This property is used by: + - add_not_null_conds() to add "column IS NOT NULL" conditions + - best_access_path() to produce better estimates for NULL-able unique keys. */ { - Item *real= (*value)->real_item(); - if (((cond->functype() == Item_func::EQ_FUNC) || - (cond->functype() == Item_func::MULT_EQUAL_FUNC)) && - (real->type() == Item::FIELD_ITEM) && - ((Item_field*)real)->field->maybe_null()) + if ((cond->functype() == Item_func::EQ_FUNC || + cond->functype() == Item_func::MULT_EQUAL_FUNC) && + ((*value)->maybe_null || field->real_maybe_null())) (*key_fields)->null_rejecting= true; else (*key_fields)->null_rejecting= false; @@ -6834,6 +6832,7 @@ best_access_path(JOIN *join, ulong key_flags; uint key_parts; key_part_map found_part= 0; + key_part_map notnull_part=0; // key parts which won't have NULL in lookup tuple. table_map found_ref= 0; uint key= keyuse->key; bool ft_key= (keyuse->keypart == FT_KEYPART); @@ -6892,6 +6891,9 @@ best_access_path(JOIN *join, if (!(keyuse->used_tables & ~join->const_table_map)) const_part|= keyuse->keypart_map; + if (!keyuse->val->maybe_null || keyuse->null_rejecting) + notnull_part|=keyuse->keypart_map; + double tmp2= prev_record_reads(join->positions, idx, (found_ref | keyuse->used_tables)); if (tmp2 < best_prev_record_reads) @@ -6942,12 +6944,19 @@ best_access_path(JOIN *join, loose_scan_opt.check_ref_access_part1(s, key, start_key, found_part); /* Check if we found full key */ - if (found_part == PREV_BITS(uint, key_parts) && - !ref_or_null_part) + const key_part_map all_key_parts= PREV_BITS(uint, key_parts); + if (found_part == all_key_parts && !ref_or_null_part) { /* use eq key */ max_key_part= (uint) ~0; - if ((key_flags & (HA_NOSAME | HA_NULL_PART_KEY)) == HA_NOSAME || - MY_TEST(key_flags & HA_EXT_NOSAME)) + /* + If the index is a unique index (1), and + - all its columns are not null (2), or + - equalities we are using reject NULLs (3) + then the estimate is rows=1. + */ + if ((key_flags & (HA_NOSAME | HA_EXT_NOSAME)) && // (1) + (!(key_flags & HA_NULL_PART_KEY) || // (2) + all_key_parts == notnull_part)) // (3) { tmp = prev_record_reads(join->positions, idx, found_ref); records=1.0; @@ -9991,8 +10000,16 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, uint maybe_null= MY_TEST(keyinfo->key_part[i].null_bit); j->ref.items[i]=keyuse->val; // Save for cond removal j->ref.cond_guards[i]= keyuse->cond_guard; - if (keyuse->null_rejecting) + + /* + Set ref.null_rejecting to true only if we are going to inject a + "keyuse->val IS NOT NULL" predicate. + */ + Item *real= (keyuse->val)->real_item(); + if (keyuse->null_rejecting && (real->type() == Item::FIELD_ITEM) && + ((Item_field*)real)->field->maybe_null()) j->ref.null_rejecting|= (key_part_map)1 << i; + keyuse_uses_no_tables= keyuse_uses_no_tables && !keyuse->used_tables; /* We don't want to compute heavy expressions in EXPLAIN, an example would -- cgit v1.2.1 From b4287ec3865d90920f0cc440c36f4873dcf51703 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 5 Jun 2019 16:36:51 +0530 Subject: MDEV-19541 InnoDB crashes when trying to recover a corrupted page - Use corrupt page id instead of whole block after releasing it from LRU list. --- storage/innobase/buf/buf0buf.cc | 4 +++- storage/innobase/include/log0recv.h | 4 ++-- storage/innobase/log/log0recv.cc | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 756caac1f54..18decb492f3 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -6051,10 +6051,12 @@ database_corrupted: if (err == DB_PAGE_CORRUPTED || err == DB_DECRYPTION_FAILED) { + const page_id_t corrupt_page_id = bpage->id; + buf_corrupt_page_release(bpage, space); if (recv_recovery_is_on()) { - recv_recover_corrupt_page(bpage); + recv_recover_corrupt_page(corrupt_page_id); } fil_space_release_for_io(space); diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index 9bb54960058..03f6a6ff878 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -51,8 +51,8 @@ recv_find_max_checkpoint(ulint* max_field) /** Reduces recv_sys->n_addrs for the corrupted page. This function should called when srv_force_recovery > 0. -@param[in] bpage buffer pool page */ -void recv_recover_corrupt_page(buf_page_t* bpage); +@param[in] page_id page id of the corrupted page */ +void recv_recover_corrupt_page(page_id_t page_id); /** Apply any buffered redo log to a page that was just read from a data file. @param[in,out] bpage buffer pool page */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index c0521f1dba4..dbce6f90fc2 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -2214,8 +2214,8 @@ skip_log: /** Reduces recv_sys->n_addrs for the corrupted page. This function should called when srv_force_recovery > 0. -@param[in] bpage buffer pool page */ -void recv_recover_corrupt_page(buf_page_t* bpage) +@param[in] page_id page id of the corrupted page */ +void recv_recover_corrupt_page(page_id_t page_id) { ut_ad(srv_force_recovery); mutex_enter(&recv_sys->mutex); @@ -2226,7 +2226,7 @@ void recv_recover_corrupt_page(buf_page_t* bpage) } recv_addr_t* recv_addr = recv_get_fil_addr_struct( - bpage->id.space(), bpage->id.page_no()); + page_id.space(), page_id.page_no()); ut_ad(recv_addr->state != RECV_WILL_NOT_READ); -- cgit v1.2.1 From d7c8423a3d44a5eb9bb22efd957eab3f32497b0f Mon Sep 17 00:00:00 2001 From: Zicheng Huang Date: Wed, 27 Feb 2019 08:31:35 +0000 Subject: fix MDEV-18750: failed to flashback large-size binlog file fix MDEV-18750: failed to flashback large-size binlog file fix mysqlbinlog flashback failure caused by reading io_cache without MY_FULL_IO flag fix MDEV-18750: mysqlbinlog flashback failure on large binlog --- .../suite/binlog/r/flashback-largebinlog.result | 71 +++++++++++++ .../suite/binlog/t/flashback-largebinlog.test | 110 +++++++++++++++++++++ mysys/mf_iocache.c | 8 +- 3 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/binlog/r/flashback-largebinlog.result create mode 100644 mysql-test/suite/binlog/t/flashback-largebinlog.test diff --git a/mysql-test/suite/binlog/r/flashback-largebinlog.result b/mysql-test/suite/binlog/r/flashback-largebinlog.result new file mode 100644 index 00000000000..526204f259f --- /dev/null +++ b/mysql-test/suite/binlog/r/flashback-largebinlog.result @@ -0,0 +1,71 @@ +# +# Preparatory cleanup. +# +drop database if exists mysqltest; +create database mysqltest; +use mysqltest; +DROP TABLE IF EXISTS t1; +# +# We need a fixed timestamp to avoid varying results. +# +SET timestamp=1000000000; +# +# We need big packets. +# +# Capture initial value to reset at the end of the test +# Now adjust max_allowed_packet +SET @@global.max_allowed_packet= 10*1024*1024*1024; +Warnings: +Warning 1292 Truncated incorrect max_allowed_packet value: '10737418240' +max_allowed_packet is a global variable. +In order for the preceding change in max_allowed_packets' value +to be seen and used, we must start a new connection. +The change does not take effect with the current one. +For simplicity, we just disconnect / reconnect connection default here. +disconnect default; +connect default, localhost,root,,; +# +# Delete all existing binary logs. +# +RESET MASTER; +# +# Create a test table. +# +use mysqltest; +CREATE TABLE t1 ( +c1 LONGTEXT +) DEFAULT CHARSET latin1; +# +# Show how many rows are affected by each statement. +# +# +# Insert some big rows. +# +insert 1024MB data twice +INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864)); +affected rows: 1 +INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864)); +affected rows: 1 +# +# Flush all log buffers to the log file. +# +FLUSH LOGS; +affected rows: 0 +# +# Call mysqlbinlog to display the log file contents. +# NOTE: The output of mysqlbinlog is redirected to +# $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out +# If you want to examine it, disable remove_file +# at the bottom of the test script. +# +# +# Cleanup. +# +# reset variable value to pass testcase checks +SET @@global.max_allowed_packet = 16777216; +affected rows: 0 +DROP TABLE t1; +affected rows: 0 +drop database if exists mysqltest; +affected rows: 0 +remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_big_1.out diff --git a/mysql-test/suite/binlog/t/flashback-largebinlog.test b/mysql-test/suite/binlog/t/flashback-largebinlog.test new file mode 100644 index 00000000000..6ff58b706d3 --- /dev/null +++ b/mysql-test/suite/binlog/t/flashback-largebinlog.test @@ -0,0 +1,110 @@ +# mysqlbinlog_big.test +# +# Show that mysqlbinlog can handle big rows. +# + +# +# The *huge* output of mysqlbinlog will be redirected to +# $MYSQLTEST_VARDIR/$mysqlbinlog_output +# +--let $mysqlbinlog_output= tmp/mysqlbinlog_big_1.out + +--source include/have_binlog_format_row.inc + +--source include/have_log_bin.inc + +# This is a big test. +--source include/big_test.inc + +--echo # +--echo # Preparatory cleanup. +--echo # +--disable_warnings +drop database if exists mysqltest; +create database mysqltest; +use mysqltest; +DROP TABLE IF EXISTS t1; +--enable_warnings + +--echo # +--echo # We need a fixed timestamp to avoid varying results. +--echo # +SET timestamp=1000000000; + +--echo # +--echo # We need big packets. +--echo # +--echo # Capture initial value to reset at the end of the test +# use let $ = query_get_value as FLUSH statements +# in the test will set @ values to NULL +let $orig_max_allowed_packet = +query_get_value(SELECT @@global.max_allowed_packet, @@global.max_allowed_packet, 1); + +--echo # Now adjust max_allowed_packet +SET @@global.max_allowed_packet= 10*1024*1024*1024; + +--echo max_allowed_packet is a global variable. +--echo In order for the preceding change in max_allowed_packets' value +--echo to be seen and used, we must start a new connection. +--echo The change does not take effect with the current one. +--echo For simplicity, we just disconnect / reconnect connection default here. +disconnect default; +connect (default, localhost,root,,); + +--echo # +--echo # Delete all existing binary logs. +--echo # +RESET MASTER; + +--echo # +--echo # Create a test table. +--echo # +use mysqltest; +eval CREATE TABLE t1 ( + c1 LONGTEXT + ) DEFAULT CHARSET latin1; + +--echo # +--echo # Show how many rows are affected by each statement. +--echo # +--enable_info + +--echo # +--echo # Insert some big rows. +--echo # + +--echo insert 1024MB data twice +INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 67108864)); +INSERT INTO t1 VALUES (REPEAT('MegaByteBlckMany', 67108864)); + +--echo # +--echo # Flush all log buffers to the log file. +--echo # +FLUSH LOGS; + +--echo # +--echo # Call mysqlbinlog to display the log file contents. +--echo # NOTE: The output of mysqlbinlog is redirected to +--echo # \$MYSQLTEST_VARDIR/$mysqlbinlog_output +--echo # If you want to examine it, disable remove_file +--echo # at the bottom of the test script. +--echo # +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_result $MYSQLTEST_VARDIR +--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ +--exec $MYSQL_BINLOG -B -v -v $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/$mysqlbinlog_output + +--echo # +--echo # Cleanup. +--echo # +--echo # reset variable value to pass testcase checks +eval SET @@global.max_allowed_packet = $orig_max_allowed_packet; +DROP TABLE t1; +drop database if exists mysqltest; + +--echo remove_file \$MYSQLTEST_VARDIR/$mysqlbinlog_output +# +# NOTE: If you want to see the *huge* mysqlbinlog output, disable next line: +# +--remove_file $MYSQLTEST_VARDIR/$mysqlbinlog_output + diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 92bca16c24f..d7689e204b6 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -120,6 +120,10 @@ init_functions(IO_CACHE* info) DBUG_ASSERT(0); break; } + if (type == READ_CACHE || type == WRITE_CACHE || type == SEQ_READ_APPEND) + info->myflags|= MY_FULL_IO; + else + info->myflags&= ~MY_FULL_IO; } @@ -296,10 +300,6 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, } info->inited=info->aio_result.pending=0; #endif - if (type == READ_CACHE || type == WRITE_CACHE || type == SEQ_READ_APPEND) - info->myflags|= MY_FULL_IO; - else - info->myflags&= ~MY_FULL_IO; DBUG_RETURN(0); } /* init_io_cache */ -- cgit v1.2.1 From 965db355e63e3123423d6f8cdedbe2c653bf1480 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 5 Jun 2019 13:06:27 +0200 Subject: update C/C --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index 68e6c5bd670..ab4d09dd8de 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit 68e6c5bd670ee0e6fee8fd82f160611c4529ac5a +Subproject commit ab4d09dd8de0bb2c56ca0c60cb386f02d1736190 -- cgit v1.2.1 From bb5d04c9b809b6e5542a0739124fc214807d1615 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Thu, 6 Jun 2019 12:49:34 +0530 Subject: MDEV-19695 Import tablespace doesn't work with ROW_FORMAT=COMPRESSED encrypted tablespace Problem: ======= fil_iterate() writes imported tablespace page0 as it is to discarded tablespace. Space id wasn't even changed. While opening the tablespace, tablespace fails with space id mismatch error. Fix: ==== fil_iterate() copies the page0 with discarded space id to imported tablespace. --- .../r/compressed_import_tablespace.result | 37 +++++++++++++++++ .../encryption/t/compressed_import_tablespace.opt | 3 ++ .../encryption/t/compressed_import_tablespace.test | 46 ++++++++++++++++++++++ storage/innobase/row/row0import.cc | 14 +++++-- 4 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/encryption/r/compressed_import_tablespace.result create mode 100644 mysql-test/suite/encryption/t/compressed_import_tablespace.opt create mode 100644 mysql-test/suite/encryption/t/compressed_import_tablespace.test diff --git a/mysql-test/suite/encryption/r/compressed_import_tablespace.result b/mysql-test/suite/encryption/r/compressed_import_tablespace.result new file mode 100644 index 00000000000..aafe4447884 --- /dev/null +++ b/mysql-test/suite/encryption/r/compressed_import_tablespace.result @@ -0,0 +1,37 @@ +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +INSERT INTO t1 VALUES(1, repeat('Nesamani', 10)); +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES +# Wait max 10 min for key encryption threads to encrypt all spaces +t1.frm +t1.ibd +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +t1.cfg +t1.frm +t1.ibd +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +ALTER TABLE t1 DISCARD TABLESPACE; +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `ENCRYPTED`=YES +DROP TABLE t1; diff --git a/mysql-test/suite/encryption/t/compressed_import_tablespace.opt b/mysql-test/suite/encryption/t/compressed_import_tablespace.opt new file mode 100644 index 00000000000..a9893ed4b29 --- /dev/null +++ b/mysql-test/suite/encryption/t/compressed_import_tablespace.opt @@ -0,0 +1,3 @@ +--innodb-encrypt-tables=ON +--innodb-encryption-threads=4 +--innodb-tablespaces-encryption diff --git a/mysql-test/suite/encryption/t/compressed_import_tablespace.test b/mysql-test/suite/encryption/t/compressed_import_tablespace.test new file mode 100644 index 00000000000..b9e4913584b --- /dev/null +++ b/mysql-test/suite/encryption/t/compressed_import_tablespace.test @@ -0,0 +1,46 @@ +-- source include/have_innodb.inc +-- source include/have_example_key_management_plugin.inc +-- source include/not_valgrind.inc +-- source include/not_embedded.inc + +let MYSQLD_DATADIR = `SELECT @@datadir`; +--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +INSERT INTO t1 VALUES(1, repeat('Nesamani', 10)); + +SELECT COUNT(*) FROM t1; +SHOW CREATE TABLE t1; + +--echo # Wait max 10 min for key encryption threads to encrypt all spaces +--let $wait_timeout= 600 +--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0 +--source include/wait_condition.inc + +--source include/shutdown_mysqld.inc + +--source include/start_mysqld.inc +let MYSQLD_DATADIR =`SELECT @@datadir`; + +--list_files $MYSQLD_DATADIR/test +FLUSH TABLES t1 FOR EXPORT; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_backup_tablespaces("test", "t1"); +EOF +--list_files $MYSQLD_DATADIR/test +UNLOCK TABLES; +DROP TABLE t1; + +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=YES; +ALTER TABLE t1 DISCARD TABLESPACE; +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_discard_tablespaces("test", "t1"); +ib_restore_tablespaces("test", "t1"); +EOF + +ALTER TABLE t1 IMPORT TABLESPACE; + +SELECT COUNT(*) FROM t1; +SHOW CREATE TABLE t1; +DROP TABLE t1; diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 036b657e36c..abadeafba9c 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -3421,8 +3421,12 @@ page_corrupted: FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + src)) { not_encrypted: - if (!page_compressed - && !block->page.zip.data) { + if (block->page.id.page_no() == 0 + && block->page.zip.data) { + block->page.zip.data = src; + frame_changed = true; + } else if (!page_compressed + && !block->page.zip.data) { block->frame = src; frame_changed = true; } else { @@ -3513,7 +3517,11 @@ not_encrypted: } if (frame_changed) { - block->frame = dst; + if (block->page.zip.data) { + block->page.zip.data = dst; + } else { + block->frame = dst; + } } src = io_buffer + (i * size); -- cgit v1.2.1 From 6999da9b19c3c325a37016d2c3f35323dc1599a6 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 6 Jun 2019 14:41:45 +0400 Subject: Record BACKUP and SCHEMA namespaces order --- mysql-test/main/backup_lock_debug.result | 25 +++++++++++++++++++++ mysql-test/main/backup_lock_debug.test | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/mysql-test/main/backup_lock_debug.result b/mysql-test/main/backup_lock_debug.result index 8832d9cd3e7..7c7b05901a9 100644 --- a/mysql-test/main/backup_lock_debug.result +++ b/mysql-test/main/backup_lock_debug.result @@ -26,3 +26,28 @@ disconnect con1; connection default; DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; +# +# Demonstrates a deadlock if BACKUP namespace is reorder after SCHEMA. +# Culprit is ALTER TABLE taking SCHEMA lock on target database after +# BACKUP lock was acquired. +# +CREATE DATABASE test2; +CREATE TABLE t1(a INT) ENGINE=InnoDB; +SET DEBUG_SYNC='alter_opened_table SIGNAL ready WAIT_FOR go'; +ALTER TABLE t1 RENAME TO test2.t1; +connect con1,localhost,root,,; +SET DEBUG_SYNC='now WAIT_FOR ready'; +BACKUP STAGE START; +SET DEBUG_SYNC='mdl_acquire_lock_wait SIGNAL ready1'; +BACKUP STAGE BLOCK_DDL; +connect con2,localhost,root,,; +SET DEBUG_SYNC='now WAIT_FOR ready1'; +SET DEBUG_SYNC='mdl_acquire_lock_wait SIGNAL go'; +DROP DATABASE test2; +connection default; +connection con1; +disconnect con1; +connection con2; +disconnect con2; +connection default; +SET DEBUG_SYNC='reset'; diff --git a/mysql-test/main/backup_lock_debug.test b/mysql-test/main/backup_lock_debug.test index 8cf492b3404..80e7cf9e181 100644 --- a/mysql-test/main/backup_lock_debug.test +++ b/mysql-test/main/backup_lock_debug.test @@ -3,6 +3,7 @@ ######################################################################## --source include/have_debug_sync.inc +--source include/have_innodb.inc --echo # --echo # Make sure pending LOCK TABLES doesn't block BACKUP STAGE @@ -38,3 +39,40 @@ disconnect con1; connection default; DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; + + +--echo # +--echo # Demonstrates a deadlock if BACKUP namespace is reorder after SCHEMA. +--echo # Culprit is ALTER TABLE taking SCHEMA lock on target database after +--echo # BACKUP lock was acquired. +--echo # +CREATE DATABASE test2; +CREATE TABLE t1(a INT) ENGINE=InnoDB; + +SET DEBUG_SYNC='alter_opened_table SIGNAL ready WAIT_FOR go'; +send ALTER TABLE t1 RENAME TO test2.t1; + +connect (con1,localhost,root,,); +SET DEBUG_SYNC='now WAIT_FOR ready'; +BACKUP STAGE START; +SET DEBUG_SYNC='mdl_acquire_lock_wait SIGNAL ready1'; +send BACKUP STAGE BLOCK_DDL; + +connect (con2,localhost,root,,); +SET DEBUG_SYNC='now WAIT_FOR ready1'; +SET DEBUG_SYNC='mdl_acquire_lock_wait SIGNAL go'; +send DROP DATABASE test2; + +connection default; +reap; + +connection con1; +reap; +disconnect con1; + +connection con2; +reap; +disconnect con2; + +connection default; +SET DEBUG_SYNC='reset'; -- cgit v1.2.1 From d6d5c168cf106535d719c4715986dac4767254ea Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 6 Jun 2019 15:23:12 +0300 Subject: Fixed that test suite doesn't remove duplicate options - multiple usage of plugin-load-add and optimizer-switch are now included in generated config files --- mysql-test/lib/My/Config.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index 12647edf0a4..e148fa1dcb7 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -21,6 +21,17 @@ use strict; use warnings; use Carp; +# Define all MariaDB options that the user should be able to specify +# many times in the config file. Note that options must be written +# using '-' instead of '_' here! + +my %multipart_options= + ( + "plugin-load-add" => 1, + "optimizer-switch" => 1, +); + + sub new { my ($class, $option_name, $option_value)= @_; my $self= bless { name => $option_name, @@ -327,7 +338,6 @@ sub new { # Skip comment next; } - else { croak "Unexpected line '$line' found in '$path'"; } @@ -355,6 +365,11 @@ sub insert { if ( defined $option ) { #print "option: $option, value: $value\n"; + my $tmp_option= $option; + $tmp_option =~ s/_/-/g; + + # If the option is an option that one can specify many times, always add + $if_not_exist= 1 if (@multipart_options{$tmp_option}); # Add the option to the group $group->insert($option, $value, $if_not_exist); -- cgit v1.2.1 From b83aff56f10caaa24a11d2fa9d17fd7930d5de25 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 6 Jun 2019 15:25:15 +0300 Subject: Support skip-plugin-load - --disable-plugin-load or --skip-plugin-load will now reset plugin load list. Needed for future changes to mtr tests --- sql/mysqld.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 60dce5a7ff3..bafc92696c4 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9316,6 +9316,8 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) break; case OPT_PLUGIN_LOAD: free_list(opt_plugin_load_list_ptr); + if (argument == disabled_my_option) + break; // Resets plugin list /* fall through */ case OPT_PLUGIN_LOAD_ADD: opt_plugin_load_list_ptr->push_back(new i_string(argument)); -- cgit v1.2.1 From dfe7968c6ed55b32916b7b84a54abdc66debef4c Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 6 Jun 2019 16:38:03 +0300 Subject: Fixed typo in Config.pgm --- mysql-test/lib/My/Config.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index e148fa1dcb7..ecc0830c3df 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -369,7 +369,7 @@ sub insert { $tmp_option =~ s/_/-/g; # If the option is an option that one can specify many times, always add - $if_not_exist= 1 if (@multipart_options{$tmp_option}); + $if_not_exist= 1 if ($multipart_options{$tmp_option}); # Add the option to the group $group->insert($option, $value, $if_not_exist); -- cgit v1.2.1 From 9b22354a594570e23cc675d90836743ce7a3ba1c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 7 Jun 2019 00:07:14 +0200 Subject: Fix mysql-test-run.pl to work after d6d5c168cf1 option values now have to be edited in-place, instead of replacing an option with another one that has the same name but a new value. --- mysql-test/lib/My/ConfigFactory.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index 6d4c7f43390..72d7600e8df 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -372,7 +372,7 @@ sub resolve_at_variable { } $res .= $after; - $config->insert($group->name(), $option->name(), $res) + $option->{value}= $res; } -- cgit v1.2.1 From 490dcfd5d74ce45cbdd6105e4295116f6a944e2b Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 5 Jun 2019 20:57:09 +0200 Subject: MDEV-19698: Cleanup READ_RECORD::record https://github.com/MariaDB/server/pull/777#issuecomment-496469366 --- sql/item_subselect.cc | 2 -- sql/records.cc | 18 ++++++++---------- sql/records.h | 5 +++-- sql/sql_select.cc | 8 +++----- sql/sql_window.cc | 2 +- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 538b2c218de..4603a85aa87 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -3877,7 +3877,6 @@ int subselect_single_select_engine::exec() tab->save_read_record= tab->read_record.read_record_func; tab->read_record.read_record_func= rr_sequential; tab->read_first_record= read_first_record_seq; - tab->read_record.record= tab->table->record[0]; tab->read_record.thd= join->thd; tab->read_record.ref_length= tab->table->file->ref_length; tab->read_record.unlock_row= rr_unlock_row; @@ -3895,7 +3894,6 @@ int subselect_single_select_engine::exec() for (JOIN_TAB **ptab= changed_tabs; ptab != last_changed_tab; ptab++) { JOIN_TAB *tab= *ptab; - tab->read_record.record= 0; tab->read_record.ref_length= 0; tab->read_first_record= tab->save_read_first_record; tab->read_record.read_record_func= tab->save_read_record; diff --git a/sql/records.cc b/sql/records.cc index c2db29c4912..5dd4318b105 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -77,7 +77,6 @@ bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, bzero((char*) info,sizeof(*info)); info->thd= thd; info->table= table; - info->record= table->record[0]; info->print_error= print_error; info->unlock_row= rr_unlock_row; @@ -210,7 +209,6 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table, else { empty_record(table); - info->record= table->record[0]; info->ref_length= (uint)table->file->ref_length; } info->select=select; @@ -393,7 +391,7 @@ static int rr_index_first(READ_RECORD *info) return tmp; } - tmp= info->table->file->ha_index_first(info->record); + tmp= info->table->file->ha_index_first(info->record()); info->read_record_func= rr_index; if (tmp) tmp= rr_handle_error(info, tmp); @@ -416,7 +414,7 @@ static int rr_index_first(READ_RECORD *info) static int rr_index_last(READ_RECORD *info) { - int tmp= info->table->file->ha_index_last(info->record); + int tmp= info->table->file->ha_index_last(info->record()); info->read_record_func= rr_index_desc; if (tmp) tmp= rr_handle_error(info, tmp); @@ -442,7 +440,7 @@ static int rr_index_last(READ_RECORD *info) static int rr_index(READ_RECORD *info) { - int tmp= info->table->file->ha_index_next(info->record); + int tmp= info->table->file->ha_index_next(info->record()); if (tmp) tmp= rr_handle_error(info, tmp); return tmp; @@ -467,7 +465,7 @@ static int rr_index(READ_RECORD *info) static int rr_index_desc(READ_RECORD *info) { - int tmp= info->table->file->ha_index_prev(info->record); + int tmp= info->table->file->ha_index_prev(info->record()); if (tmp) tmp= rr_handle_error(info, tmp); return tmp; @@ -477,7 +475,7 @@ static int rr_index_desc(READ_RECORD *info) int rr_sequential(READ_RECORD *info) { int tmp; - while ((tmp= info->table->file->ha_rnd_next(info->record))) + while ((tmp= info->table->file->ha_rnd_next(info->record()))) { tmp= rr_handle_error(info, tmp); break; @@ -493,7 +491,7 @@ static int rr_from_tempfile(READ_RECORD *info) { if (my_b_read(info->io_cache,info->ref_pos,info->ref_length)) return -1; /* End of file */ - if (!(tmp= info->table->file->ha_rnd_pos(info->record,info->ref_pos))) + if (!(tmp= info->table->file->ha_rnd_pos(info->record(), info->ref_pos))) break; /* The following is extremely unlikely to happen */ if (tmp == HA_ERR_KEY_NOT_FOUND) @@ -543,7 +541,7 @@ int rr_from_pointers(READ_RECORD *info) cache_pos= info->cache_pos; info->cache_pos+= info->ref_length; - if (!(tmp= info->table->file->ha_rnd_pos(info->record,cache_pos))) + if (!(tmp= info->table->file->ha_rnd_pos(info->record(), cache_pos))) break; /* The following is extremely unlikely to happen */ @@ -638,7 +636,7 @@ static int rr_from_cache(READ_RECORD *info) else { error=0; - memcpy(info->record,info->cache_pos, + memcpy(info->record(), info->cache_pos, (size_t) info->table->s->reclength); } info->cache_pos+=info->reclength; diff --git a/sql/records.h b/sql/records.h index e97f6b273cc..faf0d13c9a9 100644 --- a/sql/records.h +++ b/sql/records.h @@ -19,9 +19,10 @@ #pragma interface /* gcc class implementation */ #endif +#include "table.h" + struct st_join_table; class handler; -struct TABLE; class THD; class SQL_SELECT; class Copy_field; @@ -58,7 +59,6 @@ struct READ_RECORD SQL_SELECT *select; uint ref_length, reclength, rec_cache_size, error_offset; uchar *ref_pos; /* pointer to form->refpos */ - uchar *record; uchar *rec_buf; /* to read field values after filesort */ uchar *cache,*cache_pos,*cache_end,*read_positions; struct st_sort_addon_field *addon_field; /* Pointer to the fields info */ @@ -67,6 +67,7 @@ struct READ_RECORD void (*unpack)(struct st_sort_addon_field *, uchar *, uchar *); int read_record() { return read_record_func(this); } + uchar *record() const { return table->record[0]; } /* SJ-Materialization runtime may need to read fields from the materialized diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 13a5cd88c93..8919da0a460 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -20439,7 +20439,6 @@ join_read_first(JOIN_TAB *tab) tab->table->status=0; tab->read_record.read_record_func= join_read_next; tab->read_record.table=table; - tab->read_record.record=table->record[0]; if (!table->file->inited) error= table->file->ha_index_init(tab->index, tab->sorted); if (likely(!error)) @@ -20459,7 +20458,7 @@ static int join_read_next(READ_RECORD *info) { int error; - if (unlikely((error= info->table->file->ha_index_next(info->record)))) + if (unlikely((error= info->table->file->ha_index_next(info->record())))) return report_error(info->table, error); return 0; @@ -20479,7 +20478,6 @@ join_read_last(JOIN_TAB *tab) tab->table->status=0; tab->read_record.read_record_func= join_read_prev; tab->read_record.table=table; - tab->read_record.record=table->record[0]; if (!table->file->inited) error= table->file->ha_index_init(tab->index, 1); if (likely(!error)) @@ -20496,7 +20494,7 @@ static int join_read_prev(READ_RECORD *info) { int error; - if (unlikely((error= info->table->file->ha_index_prev(info->record)))) + if (unlikely((error= info->table->file->ha_index_prev(info->record())))) return report_error(info->table, error); return 0; } @@ -20526,7 +20524,7 @@ static int join_ft_read_next(READ_RECORD *info) { int error; - if (unlikely((error= info->table->file->ha_ft_read(info->table->record[0])))) + if (unlikely((error= info->table->file->ha_ft_read(info->record())))) return report_error(info->table, error); return 0; } diff --git a/sql/sql_window.cc b/sql/sql_window.cc index 487242933d4..a6c9dd3fea7 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -898,7 +898,7 @@ public: { Rowid_seq_cursor::init(info); table= info->table; - record= info->record; + record= info->record(); } virtual int fetch() -- cgit v1.2.1 From 4e0c6139b2e46aa2e590116535c68f15f74cd7dd Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Fri, 7 Jun 2019 12:54:16 +0200 Subject: Minor Galera MTR test fixes (#1326) --- mysql-test/suite/galera/r/galera_sync_wait_show.result | 2 ++ mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test | 2 +- mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result | 3 +-- mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-test/suite/galera/r/galera_sync_wait_show.result index 793da3246ff..4ec83a7f33f 100644 --- a/mysql-test/suite/galera/r/galera_sync_wait_show.result +++ b/mysql-test/suite/galera/r/galera_sync_wait_show.result @@ -49,6 +49,8 @@ tr1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE DROP TABLE t1; connection node_1; CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1; +Warnings: +Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it. connection node_2; SHOW CREATE EVENT event1; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test index d04603891db..1db5ee3bdc7 100644 --- a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test +++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test @@ -25,7 +25,7 @@ CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoD set session wsrep_sync_wait=15; --let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` SET GLOBAL wsrep_slave_threads = 4; ---let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); +--let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%'); --source include/wait_condition.inc --connection node_1 diff --git a/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result b/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result index 2e94461f377..df454772346 100644 --- a/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result +++ b/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result @@ -23,8 +23,7 @@ connection node_2; Shutting down server ... connection node_1; connection node_2; -Starting server ... -# restart: --wsrep_sst_auth=sst:sst --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=127.0.0.1:16001 +# restart: with restart_parameters connection node_1; connection node_2; SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; diff --git a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test index e5cf5e43b44..5a3f48e02a3 100644 --- a/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test +++ b/mysql-test/suite/galera_sr/t/galera_sr_mysqldump_sst.test @@ -43,7 +43,7 @@ UPDATE t1 SET f2 = REPEAT('y', 255); --source include/wait_condition.inc --connection node_2 ---echo Starting server ... +--let $restart_noprint = 1 --let $restart_parameters = --wsrep_sst_auth=sst:sst --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=127.0.0.1:$NODE_MYPORT_2 --source include/start_mysqld.inc -- cgit v1.2.1 From 06291c3f36c6b768e6ce1db986a0f103abe71b57 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 6 Jun 2019 17:06:41 +0200 Subject: small cleanup comments, rename a function to reflect its usage better --- sql/sql_statistics.cc | 106 ++++++++++++++++---------------------------------- 1 file changed, 33 insertions(+), 73 deletions(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 5c8d85c2cc1..b1337a89da9 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -102,29 +102,6 @@ inline void init_table_list_for_stat_tables(TABLE_LIST *tables, bool for_write) } } - -/** - @details - The function builds a TABLE_LIST containing only one element 'tbl' for - the statistical table called 'stat_tab_name'. - The lock type of the element is set to TL_READ if for_write = FALSE, - otherwise it is set to TL_WRITE. -*/ - -static inline -void init_table_list_for_single_stat_table(TABLE_LIST *tbl, - const LEX_CSTRING *stat_tab_name, - bool for_write) -{ - memset((char *) tbl, 0, sizeof(TABLE_LIST)); - - tbl->db= MYSQL_SCHEMA_NAME; - tbl->table_name= *stat_tab_name; - tbl->alias= *stat_tab_name; - tbl->lock_type= for_write ? TL_WRITE : TL_READ; -} - - static Table_check_intact_log_error stat_table_intact; static const @@ -286,15 +263,16 @@ inline int open_stat_tables(THD *thd, TABLE_LIST *tables, /** @brief Open a statistical table and lock it + + @details + This is used by DDLs. When a column or index is dropped or renamed, + stat tables need to be adjusted accordingly. */ -static -inline int open_single_stat_table(THD *thd, TABLE_LIST *table, - const LEX_CSTRING *stat_tab_name, - Open_tables_backup *backup, - bool for_write) +static inline int open_stat_table_for_ddl(THD *thd, TABLE_LIST *table, + const LEX_CSTRING *stat_tab_name, + Open_tables_backup *backup) { - init_table_list_for_single_stat_table(table, stat_tab_name, for_write); - init_mdl_requests(table); + table->init_one_table(&MYSQL_SCHEMA_NAME, stat_tab_name, NULL, TL_WRITE); return open_system_tables_for_read(thd, table, backup); } @@ -3478,21 +3456,16 @@ int delete_statistics_for_table(THD *thd, const LEX_CSTRING *db, @brief Delete statistics on a column of the specified table - @param - thd The thread handle - @param - tab The table the column belongs to - @param - col The field of the column whose statistics is to be deleted + @param thd The thread handle + @param tab The table the column belongs to + @param col The field of the column whose statistics is to be deleted @details The function delete statistics on the column 'col' belonging to the table 'tab' from the statistical table column_stats. - @retval - 0 If all deletions are successful or we couldn't open statistics table - @retval - 1 Otherwise + @retval 0 If all deletions are successful or we couldn't open statistics table + @retval 1 Otherwise @note The function is called when dropping a table column or when changing @@ -3509,8 +3482,8 @@ int delete_statistics_for_column(THD *thd, TABLE *tab, Field *col) int rc= 0; DBUG_ENTER("delete_statistics_for_column"); - if (open_single_stat_table(thd, &tables, &stat_table_name[1], - &open_tables_backup, TRUE)) + if (open_stat_table_for_ddl(thd, &tables, &stat_table_name[1], + &open_tables_backup)) DBUG_RETURN(0); save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); @@ -3537,24 +3510,18 @@ int delete_statistics_for_column(THD *thd, TABLE *tab, Field *col) @brief Delete statistics on an index of the specified table - @param - thd The thread handle - @param - tab The table the index belongs to - @param - key_info The descriptor of the index whose statistics is to be deleted - @param - ext_prefixes_only Delete statistics only on the index prefixes extended by - the components of the primary key + @param thd The thread handle + @param tab The table the index belongs to + @param key_info The descriptor of the index whose statistics is to be deleted + @param ext_prefixes_only Delete statistics only on the index prefixes + extended by the components of the primary key @details The function delete statistics on the index specified by 'key_info' defined on the table 'tab' from the statistical table index_stats. - @retval - 0 If all deletions are successful or we couldn't open statistics table - @retval - 1 Otherwise + @retval 0 If all deletions are successful or we couldn't open statistics table + @retval 1 Otherwise @note The function is called when dropping an index, or dropping/changing the @@ -3572,8 +3539,8 @@ int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info, int rc= 0; DBUG_ENTER("delete_statistics_for_index"); - if (open_single_stat_table(thd, &tables, &stat_table_name[2], - &open_tables_backup, TRUE)) + if (open_stat_table_for_ddl(thd, &tables, &stat_table_name[2], + &open_tables_backup)) DBUG_RETURN(0); save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); @@ -3635,7 +3602,7 @@ int delete_statistics_for_index(THD *thd, TABLE *tab, KEY *key_info, index_stats. @retval - 0 If all updates of the table name are successful + 0 If all updates of the table name are successful @retval 1 Otherwise @@ -3716,26 +3683,19 @@ int rename_table_in_stat_tables(THD *thd, const LEX_CSTRING *db, /** - @brief Rename a column in the statistical table column_stats - @param - thd The thread handle - @param - tab The table the column belongs to - @param - col The column to be renamed - @param - new_name The new column name + @param thd The thread handle + @param tab The table the column belongs to + @param col The column to be renamed + @param new_name The new column name @details The function replaces the name of the column 'col' belonging to the table 'tab' for 'new_name' in the statistical table column_stats. - @retval - 0 If all updates of the table name are successful - @retval - 1 Otherwise + @retval 0 If all updates of the table name are successful + @retval 1 Otherwise @note The function is called when executing any statement that renames a column, @@ -3756,8 +3716,8 @@ int rename_column_in_stat_tables(THD *thd, TABLE *tab, Field *col, if (tab->s->tmp_table != NO_TMP_TABLE) DBUG_RETURN(0); - if (open_single_stat_table(thd, &tables, &stat_table_name[1], - &open_tables_backup, TRUE)) + if (open_stat_table_for_ddl(thd, &tables, &stat_table_name[1], + &open_tables_backup)) DBUG_RETURN(rc); save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); -- cgit v1.2.1 From 973b281e599e6126c58c8398211dfe306644e517 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 6 Jun 2019 17:10:57 +0200 Subject: MDEV-18788 Live upgrade from MySQL 5.6/5.7 to MariaDB 10.4 fails with "Event Scheduler: An error occurred when initializing system tables" if columns or indexes are modified/renamed/dropped in an ALTER TABLE, stat tables must be updated accordingly (e.g. all statistics for a column should be dropped). But if a stat table doesn't exist, it's not a reason to fail the whole ALTER TABLE operation - such an error should be ignored. --- mysql-test/main/stat_tables_missing.result | 11 +++++++++++ mysql-test/main/stat_tables_missing.test | 10 ++++++++++ sql/sql_statistics.cc | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 mysql-test/main/stat_tables_missing.result create mode 100644 mysql-test/main/stat_tables_missing.test diff --git a/mysql-test/main/stat_tables_missing.result b/mysql-test/main/stat_tables_missing.result new file mode 100644 index 00000000000..a7cd35b1d1f --- /dev/null +++ b/mysql-test/main/stat_tables_missing.result @@ -0,0 +1,11 @@ +create table t1 (a int); +alter table mysql.column_stats rename to mysql.column_stats1; +flush tables; +alter table t1 change a b varchar(100); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` varchar(100) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +alter table mysql.column_stats1 rename to mysql.column_stats; +drop table t1; diff --git a/mysql-test/main/stat_tables_missing.test b/mysql-test/main/stat_tables_missing.test new file mode 100644 index 00000000000..63ee9d5dde3 --- /dev/null +++ b/mysql-test/main/stat_tables_missing.test @@ -0,0 +1,10 @@ +# +# MDEV-18788 Live upgrade from MySQL 5.6/5.7 to MariaDB 10.4 fails with "Event Scheduler: An error occurred when initializing system tables" +# +create table t1 (a int); +alter table mysql.column_stats rename to mysql.column_stats1; +flush tables; +alter table t1 change a b varchar(100); +show create table t1; +alter table mysql.column_stats1 rename to mysql.column_stats; +drop table t1; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index b1337a89da9..8c170b7df52 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -273,7 +273,11 @@ static inline int open_stat_table_for_ddl(THD *thd, TABLE_LIST *table, Open_tables_backup *backup) { table->init_one_table(&MYSQL_SCHEMA_NAME, stat_tab_name, NULL, TL_WRITE); - return open_system_tables_for_read(thd, table, backup); + No_such_table_error_handler nst_handler; + thd->push_internal_handler(&nst_handler); + int res= open_system_tables_for_read(thd, table, backup); + thd->pop_internal_handler(); + return res; } -- cgit v1.2.1 From 5d06edfb2616ab0b4b067580c281afbbef8fdc74 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Sat, 8 Jun 2019 02:28:29 +0300 Subject: MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON Make it visible --- mysql-test/r/subselect_no_semijoin.result | 55 +++++++++++++++++++++++++++++++ mysql-test/t/subselect_no_semijoin.test | 23 +++++++++++++ sql/sql_explain.cc | 5 +++ sql/sql_explain.h | 1 + sql/sql_select.cc | 1 + 5 files changed, 85 insertions(+) diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index a0625246e2b..55d408c54fc 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -7291,5 +7291,60 @@ pk i c pk i c 1 10 foo 1 10 foo DROP TABLE t; # End of 10.2 tests +# +# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON +# +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); +SET @tmp19714=@@optimizer_switch; +SET optimizer_switch='subquery_cache=off'; +explain format=json +SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100 + }, + "subqueries": [ + { + "query_block": { + "select_id": 2, + "pseudo_bits_condition": "1 = t1.a or (1,(subquery#3))", + "table": { + "table_name": "t2", + "access_type": "system", + "rows": 1, + "filtered": 100 + }, + "subqueries": [ + { + "query_block": { + "select_id": 3, + "table": { + "table_name": "t3", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "1 = t3.c" + } + } + } + ] + } + } + ] + } +} +SET optimizer_switch=@tmp19714; +drop table t1,t2,t3; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/t/subselect_no_semijoin.test b/mysql-test/t/subselect_no_semijoin.test index 46791667173..eda95b93503 100644 --- a/mysql-test/t/subselect_no_semijoin.test +++ b/mysql-test/t/subselect_no_semijoin.test @@ -8,5 +8,28 @@ set @join_cache_level_for_subselect_test=@@join_cache_level; --source t/subselect.test +--echo # +--echo # MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON +--echo # +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); + +# t2 must be MyISAM or Aria and contain 1 row +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); + +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); + +SET @tmp19714=@@optimizer_switch; +SET optimizer_switch='subquery_cache=off'; + +explain format=json +SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; + +SET optimizer_switch=@tmp19714; + +drop table t1,t2,t3; + set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 1ab10fb3c37..3ebd44dc0bb 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -857,6 +857,11 @@ void Explain_select::print_explain_json(Explain_query *query, writer->add_member("outer_ref_condition"); write_item(writer, outer_ref_cond); } + if (pseudo_bits_cond) + { + writer->add_member("pseudo_bits_condition"); + write_item(writer, pseudo_bits_cond); + } /* we do not print HAVING which always evaluates to TRUE */ if (having || (having_value == Item::COND_FALSE)) diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 3ca816477fc..08af84b3562 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -232,6 +232,7 @@ public: /* Expensive constant condition */ Item *exec_const_cond; Item *outer_ref_cond; + Item *pseudo_bits_cond; /* HAVING condition */ Item *having; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 182e913c16c..0ee3735c464 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -25025,6 +25025,7 @@ int JOIN::save_explain_data_intern(Explain_query *output, xpl_sel->exec_const_cond= exec_const_cond; xpl_sel->outer_ref_cond= outer_ref_cond; + xpl_sel->pseudo_bits_cond= pseudo_bits_cond; if (tmp_having) xpl_sel->having= tmp_having; else -- cgit v1.2.1 From 5e9090ef161e9e083e7059439246e5e2ef1718e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 1 Jun 2019 23:56:55 +0300 Subject: Deb: Purge unused debconf translations --- debian/po/ar.po | 57 ------------ debian/po/ca.po | 163 ---------------------------------- debian/po/cs.po | 151 -------------------------------- debian/po/da.po | 185 --------------------------------------- debian/po/de.po | 33 ------- debian/po/es.po | 167 ----------------------------------- debian/po/eu.po | 41 --------- debian/po/fr.po | 54 ------------ debian/po/gl.po | 59 ------------- debian/po/it.po | 31 ------- debian/po/ja.po | 32 ------- debian/po/nb.po | 96 -------------------- debian/po/nl.po | 99 --------------------- debian/po/pt.po | 114 ------------------------ debian/po/pt_BR.po | 251 ----------------------------------------------------- debian/po/ro.po | 117 ------------------------- debian/po/ru.po | 30 ------- debian/po/sv.po | 37 -------- debian/po/tr.po | 162 ---------------------------------- 19 files changed, 1879 deletions(-) diff --git a/debian/po/ar.po b/debian/po/ar.po index c351e81bfbf..3cc38aa9c1a 100644 --- a/debian/po/ar.po +++ b/debian/po/ar.po @@ -190,60 +190,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "هل فعلاً تريد التثبيط؟" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "هناك ملف مسمى /var/lib/mysql/debian-*.flag موجود على هذا النظام." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "هذا الملف دلالة على أن نسخة أحدث من حزمة mariadb-server تم تثبيتها مسبقاً." - -#~ msgid "" -#~ "There is no guarantee that the version you're currently installing will " -#~ "be able to use the current databases." -#~ msgstr "" -#~ "ليست هناك أية ضمانة أن النسخة التي تقوم بتثبيتها ستكون قادرة على استخدام " -#~ "قواعد البيانات الحالية." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "تشغيل خادم MariaDB عند الإقلاع؟" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "يمكن تشغيل خادم MariaDB آلياً وقت الإقلاع أو يدوياً باستخدام الأمر '/etc/" -#~ "init.d/mysql start'." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "كي تستخدم MariaDB، يجب إضافة المُدخلات التالية الخاصة بالمستخدمين " -#~ "والمجموعات إلى النظام:" - -#~ 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 --git a/debian/po/ca.po b/debian/po/ca.po index 0d4220a0258..925c749600c 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -158,166 +158,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#, fuzzy -#~| msgid "Should MySQL start on boot?" -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Voleu que el MariaDB s'inici� a l'arrencada ?" - -#, fuzzy -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "El MariaDB es pot executar a l'arrencada o nom�s si executeu manualment '/" -#~ "etc/init.d/mysql start'. Seleccioneu 's�' si voleu que s'inicialitzi " -#~ "autom�ticament." - -#, fuzzy -#~ 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 "" -#~ "Per utilitzar la base de dades de MySQL heu d'afegir un usuari i grup " -#~ "equivalent al seg�ent i assegurar-vos que el directori /var/lib/mysql " -#~ "tingui els permisos correctes." - -#~ 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 "" -#~ "Feu una ullada al document: http://www.mysql.com/doc/en/Upgrade.html" - -#, 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 "" -#~ "El MySQL nom�s s'instal�la en cas de tenir un nom d'ordinador central que " -#~ "no sigui num�ric i que es pugui resoldre a trav�s del fitxer /etc/hosts. " -#~ "Ex. si l'ordre \"hostname\" retorna \"myhostname\", llavors hi ha d'haver " -#~ "una lnia com la segent \"10.0.0.1 myhostname\"." - -#, 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 "" -#~ "Es crea un nou usuari de mysql \"debian-sys-maint\". S'utilitza per les " -#~ "seq��ncies d'inicialitzaci� i aturada del cron, no el suprimiu." - -#, 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 "" -#~ "Recordeu posar una contrasenya al superusuari del MySQL. Si utilitzeu un " -#~ "fitxer /root/.my.cnf, escriviu sempre all� les l�nies \"user\" i " -#~ "\"password\".; mai nom�s la contrasenya. Per a m�s informaci� feu una " -#~ "ullada a /usr/share/doc/mysql-server/README.Debian." - -#, fuzzy -#~ msgid "" -#~ "Should I remove all databases below /var/lib/mysql as you are purging the " -#~ "mysql-server package?" -#~ msgstr "" -#~ "Voleu suprimir totes les bases de dades en purgar el paquet 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 "" -#~ "La xarxa est� inhabilitada per defecte per a raons de seguretat. La podeu " -#~ "habilitar descomentant l'opci� de skip-networking del fitxer /etc/mysql/" -#~ "my.cnf." - -#~ msgid "security and update notice" -#~ msgstr "Av�s de seguretat i actualitzaci�" - -#~ msgid "Please run mysql_fix_privilege_tables !" -#~ msgstr "Executeu 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 "" -#~ "S'asseguren els permisos de seguretat de /var/lib/mysql canviant a mysql " -#~ "tots els GIDs diferents a root i mysql." - -#~ msgid "" -#~ "Instructions how to enable SSL support are in /usr/share/doc/mysql-server/" -#~ msgstr "" -#~ "Per habilitar el suport de SSL podeu seguir les instruccions de /usr/" -#~ "share/doc/mysql-server/" - -#~ msgid "mysql_fix_privileges_tables will be executed" -#~ msgstr "s'executa mysql_fix_privileges_tables" - -#~ 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 "" -#~ "Les �ltimes versions de MySQL tenen un sistema de privilegis m�s " -#~ "elaborat. Per utilitzar-lo cal afegir nous camps a les taules de la base " -#~ "de dades \"mysql\". Aquesta tasca la realitza la seq��ncia " -#~ "mysql_fix_privilege_tables durant l'actualitzaci� independentment de si " -#~ "el servidor s'est� executant o no!" - -#~ 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 "" -#~ "Aquesta seq��ncia no assigna privilegis d'usuari diferents als que ja " -#~ "tenia, en cas que us trob�ssiu en aquesta situaci�, poseu-vos en contacte " -#~ "amb mi." - -#~ 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 "" -#~ "Voleu suprimir tots els continguts de /var/lib/mysql quan es purgui el " -#~ "paquet mysql-server amb l'ordre \"dpkg --purge mysql-server\". (ex. " -#~ "suprimir-ho tot incl�s la configuraci�) ? (per defecte no)" - -#~ msgid "Make MySQL reachable via network?" -#~ msgstr "Voleu fer accessible el MySQL via xarxa ?" - -#~ 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 "" -#~ "Voleu que el MySQL escolti a un port TCP accessible des de la xarxa ? " -#~ "Aquesta opci� no �s imprescindible en ordinadors a�llats i podria " -#~ "provocar un problema de seguretat." - -#~ msgid "Enable chroot mode?" -#~ msgstr "Permetre el mode 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 "" -#~ "El MySQL es pot executar en una entorn tancat al directori /var/lib/" -#~ "mysql_jail perqu� els usuaris no puguin modificar cap fitxer fora del " -#~ "directori.Aquesta opci� tamb� augmenta la seguretat envers els crackers, " -#~ "jaque no poden modificar els fitxers del sistema." diff --git a/debian/po/cs.po b/debian/po/cs.po index 9b021acbc78..ecb70c5f2b5 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -192,154 +192,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Opravdu pokračovat v degradaci?" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "V systému existuje soubor /var/lib/mysql/debian-*.flag." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "To znamená, že již byl nainstalován balík mariadb-server s vyšší verzí." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Spustit MariaDB server při startu systému?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB se může spouštět automaticky při startu systému, nebo ručně " -#~ "příkazem '/etc/init.d/mysql start'." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "Abyste mohli MariaDB 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.1 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.1 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 --git a/debian/po/da.po b/debian/po/da.po index e2f1800c012..23c481768f7 100644 --- a/debian/po/da.po +++ b/debian/po/da.po @@ -192,188 +192,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "nsker du virkelig at fortstte nedgraderingen?" - -#~ 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." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Sdan en fil tyder p at der tidligere har vret installeret en hjere " -#~ "version af mariadb-server-pakken." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Start MariaDB-serveren under systemopstart?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB-serveren kan enten startes op automatisk under systemopstarten, " -#~ "eller manuelt med kommandoen '/etc/init.d/mysql start'." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "Nedenstende linjer for brugere og grupper skal tilfjes dette system for " -#~ "at benytte MariaDB:" - -#~ msgid "Cannot upgrade if ISAM tables are present!" -#~ msgstr "Kan ikke opgradere hvis der er ISAM-tabeller!" - -#~ 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.1 will now abort. In case your old " -#~ "mysql-server-4.1 gets removed nevertheless just reinstall it to convert " -#~ "those tables." -#~ msgstr "" -#~ "Nyere versioner af MySQL kan ikke lngere benytte det gamle ISAM-" -#~ "tabelformat, og det er derfor ndvendigt at konvertere dine tabeller til " -#~ "f.eks. MyISAM forud for opgraderingen med \"mysql_convert_table_format\" " -#~ "eller \"ALTER TABLE x ENGINE=MyISAM\". Installationen af mysql-server-5.1 " -#~ "afbrydes nu. Skulle din gamle mysql-server-4.1 alligevel bliver " -#~ "afinstalleret, s geninstallr den blot og konverter tabellerne." - -#~ msgid "" -#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" -#~ msgstr "" -#~ "Understt MySQL-forbindelser fra maskiner, der krer Debian \"Sarge\" " -#~ "eller ldre?" - -#~ 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 "" -#~ "Gamle udgaver af MySQL-klienter p Debian gemte ikke adgangskoderne " -#~ "sikkert. Dette er blevet forbedret siden da, men klienter (f.eks. PHP) " -#~ "fra maskiner, der krer Debian 3.1 Sarge vil ikke kunne forbinde til " -#~ "nyere konti eller konti, hvis adgangskode er blevet ndret." - -#~ 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 at kunne bruge mysql skal du installere en bruger og en gruppe, der " -#~ "svarer til nedenstende, og sikre dig at /var/lib/mysql har de rigtige " -#~ "adgangsrettigheder (uid/gid kan afvige)." - -#~ 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 "Fjern de databaser, der benyttes af samtlige MySQL-versioner?" - -#~ msgid "" -#~ "If you do not provide a password no changes will be made to the account." -#~ msgstr "Hvis du ikke angiver en adgangskode, vil kontoen ikke blive ndret." - -#~ msgid "" -#~ "When installation finishes, you should verify that the account is " -#~ "properly protected with a password (see README.Debian for more " -#~ "information)." -#~ msgstr "" -#~ "Nr installationen afsluttes, br du tjekke at kontoen er ordentligt " -#~ "beskyttet med en adgangskode (se README.Debian for yderligere " -#~ "oplysninger)." - -#~ msgid "Update Hints" -#~ msgstr "Opdateringstips" - -#~ 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 "" -#~ "Du skal kre \"mysql_upgrade\" efter opgraderingen, da tabellerne eller " -#~ "kan blive delagt! Dette script forbedrer ogs rettighedstabellerne, men " -#~ "burde ikke give nogen bruger flere rettigheder, end han havde tidligere," - -#~ msgid "Please also read http://www.mysql.com/doc/en/Upgrade.html" -#~ msgstr "Ls ogs http://www.mysql.com/doc/en/Upgrade.html" - -#~ msgid "Install Hints" -#~ msgstr "Installationstips" - -#~ 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 "" -#~ "Ved opgraderinger fra MySQL 3.23, der fulgte med Debian Woody, kan de " -#~ "symbolske /var/lib/mysql or /var/log/mysql blive fjernet ved et uheld, og " -#~ "m genskabes manuelt." - -#~ 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 vil kun blive installeret, hvis du har et ikke-numerisk vrtsnavn, " -#~ "som kan sls op i filen /ets/hosts. Hvis f.eks. kommandoen \"hostname\" " -#~ "svarer med \"mitvaertsnavn\", skal du have en linje a'la \"10.0.0.1 " -#~ "mitvaertsnavn\" i /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 "" -#~ "Det vil blive oprettet en ny mysql-bruger, \"debian-sys-maint\". Denne " -#~ "mysql-konto bruges i start/stop-cron-scripterne. Slet den ikke." - -#~ 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 "" -#~ "Husk at stte en ADGANGSKODE for MySQLs root-bruger! Hvis du bruger en /" -#~ "etc/.my.cnf, s skriv altid \"user\"- og \"password\"-linjer ind her, " -#~ "ikke kun adgangskoden!" - -#~ 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 "" -#~ "Skal jeg fjerne hele mappetret /var/lib/mysql, som benyttes af alle " -#~ "MySQL-versioner, ikke kun den version, du er ved at slette?" - -#~ 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 "" -#~ "En sjlden gang imellem, f.eks. ved nye hovedversioner, sker det at " -#~ "rettighedssystemet forbedres. For at gre brug af dette, skal " -#~ "mysql_fix_privilege_tables kres manuelt. Scriptet vil ikke give nogen " -#~ "bruger flere rettigheder, end vedkommende havde tidligere," diff --git a/debian/po/de.po b/debian/po/de.po index 19e03ad88bd..b61c4c12dec 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -193,36 +193,3 @@ 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." - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Möchten Sie wirklich eine ältere Version einspielen?" - -#~ 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" - -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Diese Datei ist ein Hinweis darauf, dass früher ein MariaDB-Server-Paket " -#~ "mit einer höheren Version installiert war." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Soll der MariaDB-Server automatisch beim Booten starten?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "Der MariaDB-Dienst kann entweder automatisch beim Systemstart oder " -#~ "manuell durch Eingabe des Befehls »/etc/init.d/mysql start« gestartet " -#~ "werden." diff --git a/debian/po/es.po b/debian/po/es.po index 498e943ca6a..3760e4f30f8 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -220,170 +220,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "¿Desea realmente continuar con la desactualización?" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "" -#~ "Existe un archivo con el nombre /var/lib/mysql/debian-*.flag en este " -#~ "sistema." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Este fichero indica que se instaló previamente una versión superior del " -#~ "paquete mariadb-server." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "¿Debería ejecutarse el servidor MariaDB al iniciarse el sistema?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "El servidor MariaDB puede iniciarse en el momento de arranque del sistema " -#~ "o manualmente si escribe la orden «/etc/init.d/mysql start»." - -#~ msgid "" -#~ "To use MariaDB, 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 MariaDB:" - -#~ 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.1 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.1. 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 archivo /etc/hosts. Por " -#~ "ejemplo, si la orden «hostname» devuelve «MiNombreEquipo» entonces deberá " -#~ "existir una línea «10.0.0.1 MiNombreEquipo» en dicho archivo." - -#~ 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 archivo, 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 --git a/debian/po/eu.po b/debian/po/eu.po index 4c22d656c79..0e8b74da486 100644 --- a/debian/po/eu.po +++ b/debian/po/eu.po @@ -183,44 +183,3 @@ msgstr "Pasahitz sarrera errorea" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Idatzi dituzun bi pasahitzak ez dira berdina. Mesedez saiatu berriz." - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Benetan bertsio zaharragora itzuli nahi duzu?" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "Sisteman badago /var/lib/mysql/debian-*.flag izeneko fitxategi bat." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Fitxategi honek aurretik bertsio berriagoko mysql-zerbitzari pakete bat " -#~ "instalatu dela adierazten du." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Abioan MariaDB zerbitzaria abiarazi?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "Sistema abioan MariaDB automatikoki abiarazi daiteke edo eskuz '/etc/init." -#~ "d/mysql start' eginaz." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "MariaDB erabili ahal izateko, hurrengo erabiltzaile eta taldeak gehitu " -#~ "behar dira sisteman:" diff --git a/debian/po/fr.po b/debian/po/fr.po index 46ae1e7ffbc..ef91a14b334 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -185,57 +185,3 @@ 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." - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Faut-il vraiment revenir à la version précédente ?" - -#~ 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." - -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Cela indique qu'une version plus récente du paquet mariadb-server a été " -#~ "précédemment installée." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Faut-il lancer MariaDB au démarrage ?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB peut être lancé soit au démarrage, soit en entrant la commande « /" -#~ "etc/init.d/mysql start »." - -#~ 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 --git a/debian/po/gl.po b/debian/po/gl.po index 948cd8fd839..8ea79f2add5 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -185,62 +185,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "¿Quere pasar a unha versión anterior?" - -#~ 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." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Este ficheiro indica que antes se instalou un paquete mariadb-server " -#~ "cunha versión superior." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "¿Iniciar o servidor MariaDB co ordenador?" - -#~ msgid "" -#~ "The MariaDB 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 MariaDB ao iniciar o ordenador, " -#~ "ou manualmente coa orde \"/etc/init.d/mysql start\"." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "Para empregar MariaDB 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 --git a/debian/po/it.po b/debian/po/it.po index 336bfe3fa43..d9b3fec0d49 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -179,34 +179,3 @@ msgstr "Errore di inserimento della password" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Le due password inserite sono diverse. Riprovare." - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Procedere realmente con l'abbassamento di versione?" - -#~ 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." - -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Quel file indica che in precedenza è stata installata una versione " -#~ "superiore del pacchetto mariadb-server." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Lanciare il server MariaDB all'avvio?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "Il server MariaDB può essere lanciato automaticamente all'avvio del " -#~ "sistema oppure manualmente con il comando «/etc/init.d/mysql start»." diff --git a/debian/po/ja.po b/debian/po/ja.po index ba7bb52763c..85ead48cccd 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -184,35 +184,3 @@ msgstr "パスワード入力エラー" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "入力された二つのパスワードが一致しません。再入力してください。" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "本当にダウングレードを実行しますか?" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "" -#~ "このシステムには /var/lib/mysql/debian-*.flag という名前のファイルが存在" -#~ "しています。" - -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "このファイルが意味するのは、以前により新しいバージョンの mariadb-server " -#~ "パッケージがインストールされていたことを示します。" - -#~ msgid "" -#~ "There is no guarantee that the version you're currently installing will " -#~ "be able to use the current databases." -#~ msgstr "" -#~ "このデータベースを現在インストールしようとしているバージョンで使えるかどう" -#~ "かは保証できません。" - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "MariaDB をシステム起動時に開始しますか?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB の起動方法について、システム起動時に自動的に開始するか、あるいは " -#~ "'/etc/init.d/mysql start' と手で入力して起動するかを選べます。" diff --git a/debian/po/nb.po b/debian/po/nb.po index 4a3e7514513..651f2f8ad5d 100644 --- a/debian/po/nb.po +++ b/debian/po/nb.po @@ -190,99 +190,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#, fuzzy -#~| msgid "Do you really want to downgrade?" -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Er du sikker på at du vil nedgradere?" - -#, 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 mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en " -#~ "mariadb-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." - -#, fuzzy -#~| msgid "Should MySQL start on boot?" -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Skal MariaDB startes ved maskinoppstart?" - -#, fuzzy -#~| msgid "" -#~| "The MySQL can start automatically on boot time or only if you manually " -#~| "type '/etc/init.d/mysql start'." -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB kan startes automatisk når maskinen starter, eller bare hvis du " -#~ "skriver «/etc/init.d/mysql start»." - -#~ 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.1/" -#~| "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.1/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 --git a/debian/po/nl.po b/debian/po/nl.po index 8dea3504592..7da4a752b4d 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -190,102 +190,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#, fuzzy -#~| msgid "Do you really want to downgrade?" -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Wilt u echt een oude versie herstellen?" - -#, 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 mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Waarschuwing: waarschijnlijk is een hogere versie van het mariadb-server " -#~ "pakket geïnstalleerd geweest (het bestand /var/lib/mysql/debian-*.flag " -#~ "bestaat). Er is geen garantie dat de gegevensbestanden, bewerkt met die " -#~ "hogere versie, kunnen worden gebruikt met de versie van mysql die u nu " -#~ "installeert." - -#, fuzzy -#~| msgid "Should MySQL start on boot?" -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Moet MariaDB starten als de computer start?" - -#, fuzzy -#~| msgid "" -#~| "The MySQL can start automatically on boot time or only if you manually " -#~| "type '/etc/init.d/mysql start'." -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB kan automatisch starten bij het starten van de computer, of " -#~ "slechts wanneer u '/etc/init.d/mysql start' handmatig uitvoert." - -#~ msgid "" -#~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" -#~ msgstr "" -#~ "Moet u MySQL-verbindingen accepteren van computers die Debian \"sarge\" " -#~ "of ouder draaien?" - -#, 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.1/" -#~| "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 "" -#~ "De wijze waarop wachtwoorden werden bewaard was niet erg veilig. Dit is " -#~ "verbeterd, maar helaas zullen programma's van computers die Debian 3.1 " -#~ "Sarge draaien, geen verbinding meer kunnen maken met accounts die nieuw " -#~ "zijn, of waarvan het wachtwoord is gewijzigd. Zie /usr/share/doc/mysql-" -#~ "server-5.1/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 "" -#~ "Om mysql te gebruiken dient u een gebruiker en groep aan te maken, " -#~ "gelijkwaardig aan onderstaand voorbeeld, en u dient ervoor te zorgen dat /" -#~ "var/lib/mysql de bijbehorende toegangsrechten heeft (uid en gid mogen " -#~ "anders zijn)." - -#~ 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 "Databases verwijderen die door alle MySQL versies worden gebruikt?" - -#~ msgid "" -#~ "If you do not provide a password no changes will be made to the account." -#~ msgstr "" -#~ "Indien u geen wachtwoord opgeeft zal het account niet worden gewijzigd." - -#~ msgid "" -#~ "When installation finishes, you should verify that the account is " -#~ "properly protected with a password (see README.Debian for more " -#~ "information)." -#~ msgstr "" -#~ "Wanneer de installatie klaar is, dient u te verifiëren dat het account " -#~ "netjes beschermd is met een wachtwoord (zie README.Debian voor meer " -#~ "informatie)." diff --git a/debian/po/pt.po b/debian/po/pt.po index 2d1834deda3..b0150c1890f 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -190,117 +190,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Deseja mesmo fazer downgrade?" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "" -#~ "Existe um ficheiro chamado /var/lib/mysql/debian-*.flag neste sistema." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Tal ficheiro significa que anteriormente foi instalado um pacote mariadb-" -#~ "server com um número de versão superior." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Iniciar o servidor MariaDB no arranque?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "O MariaDB pode ser automaticamente lançado no arranque ou manualmente " -#~ "através do comando '/etc/init.d/mysql start'." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "Para utilizar o MariaDB, 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.1 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.1 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 --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index bdddcc4e5df..001d4b4bd14 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -189,254 +189,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Realmente proceder com o rebaixamento de versão?" - -#~ 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." - -#, fuzzy -#~| msgid "" -#~| "Such file is an indication that a mariadb-server package with a higher " -#~| "version has been installed earlier." -#~ msgid "" -#~ "Such a file is an indication that a mariadb-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 " -#~ "mariadb-server com um número de versão mais alto já foi instalado " -#~ "anteriormente." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Iniciar o servidor MariaDB junto a inicialização da máquina?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "O servidor MariaDB pode ser iniciado automaticamente junto a " -#~ "inicialização da máquina ou manualmente com o comando '/etc/init.d/mysql " -#~ "start'." - -#~ msgid "" -#~ "To use MariaDB, the following entries for users and groups should be " -#~ "added to the system:" -#~ msgstr "" -#~ "Para utilizar o MariaDB, 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 --git a/debian/po/ro.po b/debian/po/ro.po index 328573c0357..b77bc30c1ed 100644 --- a/debian/po/ro.po +++ b/debian/po/ro.po @@ -190,120 +190,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#, 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?" - -#, 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 mariadb-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 " -#~ "mariadb-server. Nu se poate garanta că versiunea instalată acum poate " -#~ "folosi datele versiunii instalate anterior." - -#, fuzzy -#~| msgid "Should MySQL start on boot?" -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Doriţi ca MariaDB să pornească la initializarea sistemului?" - -#, fuzzy -#~| msgid "" -#~| "The MySQL can start automatically on boot time or only if you manually " -#~| "type '/etc/init.d/mysql start'." -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB poate porni automat la iniţializarea sistemului sau doar dacă " -#~ "rulaţi comanda „/etc/init.d/mysql start”." - -#~ 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.1 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.1 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.1/" -#~| "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.1/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 --git a/debian/po/ru.po b/debian/po/ru.po index baa70378169..00496bd1e06 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -187,33 +187,3 @@ msgstr "Ошибка ввода пароля" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Два введённых пароля не одинаковы. Повторите ввод." - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Действительно установить более старую версию?" - -#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -#~ msgstr "В системе найден файл /var/lib/mysql/debian-*.flag." - -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "Это означает, что ранее уже был установлен пакет mariadb-server более " -#~ "новой версии." - -#~ msgid "" -#~ "There is no guarantee that the version you're currently installing will " -#~ "be able to use the current databases." -#~ msgstr "" -#~ "Нет гарантий, что версия, которая устанавливается сейчас, будет способна " -#~ "работать с имеющимися базами данных." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Запускать MariaDB при загрузке системы?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "Сервер MariaDB можно запускать автоматически при загрузке системы или " -#~ "вручную по команде '/etc/init.d/mysql start'." diff --git a/debian/po/sv.po b/debian/po/sv.po index e1bfe1f6d1b..46a64ff81fa 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -181,40 +181,3 @@ msgstr "Fel vid inmatning av lösenord" #: ../mariadb-server-10.4.templates:8001 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." - -#~ msgid "Really proceed with downgrade?" -#~ msgstr "Vill du verkligen genomföra nedgraderingen?" - -#~ 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." - -#~ msgid "" -#~ "Such a file is an indication that a mariadb-server package with a higher " -#~ "version has been installed previously." -#~ msgstr "" -#~ "En sådan fil är en indikation på att paketet mariadb-server med ett högre " -#~ "versionsnummer har installerats tidigare." - -#~ 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." - -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "Ska MariaDB startas vid systemets uppstart?" - -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB-servern kan startas vid systemets uppstart eller manuellt med " -#~ "kommandot \"/etc/init.d/mysql start\"." - -#~ 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 --git a/debian/po/tr.po b/debian/po/tr.po index 77875e462ea..e62399f3b36 100644 --- a/debian/po/tr.po +++ b/debian/po/tr.po @@ -159,165 +159,3 @@ msgstr "" #: ../mariadb-server-10.4.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" - -#, fuzzy -#~| msgid "Should MySQL start on boot?" -#~ msgid "Start the MariaDB server on boot?" -#~ msgstr "MariaDB açılış sırasında başlatılsın mı?" - -#, fuzzy -#~ msgid "" -#~ "The MariaDB server can be launched automatically at boot time or manually " -#~ "with the '/etc/init.d/mysql start' command." -#~ msgstr "" -#~ "MariaDB 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." - -#~ 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." -- cgit v1.2.1 From cbac8f935182ecc5bb907de3ae48942467f0b8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 10 Jun 2019 18:15:25 +0300 Subject: MDEV-19725 Incorrect error handling in ALTER TABLE Some I/O functions and macros that are declared in os0file.h used to return a Boolean status code (nonzero on success). In MySQL 5.7, they were changed to return dberr_t instead. Alas, in MariaDB Server 10.2, some uses of functions were not adjusted to the changed return value. Until MDEV-19231, the valid values of dberr_t were always nonzero. This means that some code that was incorrectly checking for a zero return value from the functions would never detect a failure. After MDEV-19231, some tests for ALTER ONLINE TABLE would fail with cmake -DPLUGIN_PERFSCHEMA=NO. It turned out that the wrappers pfs_os_file_read_no_error_handling_int_fd_func() and pfs_os_file_write_int_fd_func() were wrongly returning bool instead of dberr_t. Also the callers of these functions were wrongly expecting bool (nonzero on success) instead of dberr_t. This mistake had been made when the addition of these functions was merged from MySQL 5.6.36 and 5.7.18 into MariaDB Server 10.2.7. This fix also reverts commit 40becbc3c7a6555d0a4bb186b4336a2899d5995c which attempted to work around the problem. --- storage/innobase/include/os0file.h | 6 +++--- storage/innobase/include/os0file.ic | 20 +++++++++++--------- storage/innobase/include/row0merge.h | 4 +++- storage/innobase/os/os0file.cc | 6 ++++-- storage/innobase/row/row0log.cc | 8 ++++---- storage/innobase/row/row0merge.cc | 11 +++++++---- 6 files changed, 32 insertions(+), 23 deletions(-) diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 324ff99f67b..e85bf74201a 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -2,7 +2,7 @@ Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. -Copyright (c) 2013, 2017, MariaDB Corporation. +Copyright (c) 2013, 2019, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Percona Inc.. Those modifications are @@ -1197,12 +1197,12 @@ to original un-instrumented file I/O APIs */ # define os_file_read_no_error_handling(type, file, buf, offset, n, o) \ os_file_read_no_error_handling_func(type, file, buf, offset, n, o) # define os_file_read_no_error_handling_int_fd(type, file, buf, offset, n) \ - (os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) == 0) + os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL) # define os_file_write(type, name, file, buf, offset, n) \ os_file_write_func(type, name, file, buf, offset, n) # define os_file_write_int_fd(type, name, file, buf, offset, n) \ - (os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) == 0) + os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n) # define os_file_flush(file) os_file_flush_func(file) diff --git a/storage/innobase/include/os0file.ic b/storage/innobase/include/os0file.ic index 7a490bf775a..f363bd5135a 100644 --- a/storage/innobase/include/os0file.ic +++ b/storage/innobase/include/os0file.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2010, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2017, MariaDB Corporation. +Copyright (c) 2013, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -348,9 +348,10 @@ a synchronous read operation. @param[in] n number of bytes to read @param[in] src_file caller file name @param[in] src_line caller line number -@return 0 on error, 1 on success */ +@return error code +@retval DB_SUCCESS if the operation succeeded */ UNIV_INLINE -bool +dberr_t pfs_os_file_read_no_error_handling_int_fd_func( const IORequest& type, int file, @@ -371,14 +372,14 @@ pfs_os_file_read_no_error_handling_int_fd_func( __FILE__, __LINE__); } - bool success = os_file_read_no_error_handling_func( + dberr_t err = os_file_read_no_error_handling_func( type, OS_FILE_FROM_FD(file), buf, offset, n, NULL); if (locker != NULL) { PSI_FILE_CALL(end_file_wait)(locker, n); } - return(success == DB_SUCCESS); // Reverse result + return err; } /** NOTE! Please use the corresponding macro os_file_write(), not directly @@ -435,9 +436,10 @@ os_file_write_int_fd() which requests a synchronous write operation. @param[in] n number of bytes @param[in] src_file file name where func invoked @param[in] src_line line where the func invoked -@return 0 on error, 1 on success */ +@return error code +@retval DB_SUCCESS if the operation succeeded */ UNIV_INLINE -bool +dberr_t pfs_os_file_write_int_fd_func( const IORequest& type, const char* name, @@ -459,14 +461,14 @@ pfs_os_file_write_int_fd_func( __FILE__, __LINE__); } - bool success = os_file_write_func( + dberr_t err = os_file_write_func( type, name, OS_FILE_FROM_FD(file), buf, offset, n); if (locker != NULL) { PSI_FILE_CALL(end_file_wait)(locker, n); } - return(success == DB_SUCCESS); // Reverse result + return err; } /** NOTE! Please use the corresponding macro os_file_flush(), not directly diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index 3b66597c0d7..a1719e0448e 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -370,7 +370,9 @@ row_merge_buf_sort( /********************************************************************//** Write a merge block to the file system. -@return whether the request was completed successfully */ +@return whether the request was completed successfully +@retval false on error +@retval true on success */ UNIV_INTERN bool row_merge_write( diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 8445f635062..2a89a6fc982 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -5038,7 +5038,8 @@ Requests a synchronous write operation. @param[out] buf buffer from which to write @param[in] offset file offset from the start where to read @param[in] n number of bytes to read, starting from offset -@return DB_SUCCESS if request was successful, false if fail */ +@return error code +@retval DB_SUCCESS if the operation succeeded */ dberr_t os_file_write_func( const IORequest& type, @@ -5497,7 +5498,8 @@ Requests a synchronous positioned read operation. @param[out] buf buffer where to read @param[in] offset file offset from the start where to read @param[in] n number of bytes to read, starting from offset -@return DB_SUCCESS or error code */ +@return error code +@retval DB_SUCCESS if the operation succeeded */ dberr_t os_file_read_func( const IORequest& type, diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 0013fabd98e..012cf8b2963 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -396,7 +396,7 @@ row_log_online_op( } log->tail.blocks++; - if (!os_file_write_int_fd( + if (DB_SUCCESS != os_file_write_int_fd( request, "(modification log)", log->fd, @@ -534,7 +534,7 @@ row_log_table_close_func( } log->tail.blocks++; - if (!os_file_write_int_fd( + if (DB_SUCCESS != os_file_write_int_fd( request, "(modification log)", log->fd, @@ -2658,7 +2658,7 @@ all_done: IORequest request(IORequest::READ); byte* buf = index->online_log->head.block; - if (!os_file_read_no_error_handling_int_fd( + if (DB_SUCCESS != os_file_read_no_error_handling_int_fd( request, index->online_log->fd, buf, ofs, srv_sort_buf_size)) { ib::error() @@ -3529,7 +3529,7 @@ all_done: byte* buf = index->online_log->head.block; - if (!os_file_read_no_error_handling_int_fd( + if (DB_SUCCESS != os_file_read_no_error_handling_int_fd( request, index->online_log->fd, buf, ofs, srv_sort_buf_size)) { ib::error() diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index e0c819bea4b..3f8bcb0a430 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1087,8 +1087,9 @@ row_merge_read( DBUG_EXECUTE_IF("row_merge_read_failure", DBUG_RETURN(FALSE);); IORequest request(IORequest::READ); - const bool success = os_file_read_no_error_handling_int_fd( - request, fd, buf, ofs, srv_sort_buf_size); + const bool success = DB_SUCCESS + == os_file_read_no_error_handling_int_fd( + request, fd, buf, ofs, srv_sort_buf_size); /* If encryption is enabled decrypt buffer */ if (success && log_tmp_is_encrypted()) { @@ -1115,7 +1116,9 @@ row_merge_read( /********************************************************************//** Write a merge block to the file system. -@return 0 on error, 1 if write succeded */ +@return whether the request was completed successfully +@retval false on error +@retval true on success */ UNIV_INTERN bool row_merge_write( @@ -1149,7 +1152,7 @@ row_merge_write( } IORequest request(IORequest::WRITE); - const bool success = os_file_write_int_fd( + const bool success = DB_SUCCESS == os_file_write_int_fd( request, "(merge)", fd, out_buf, ofs, buf_len); #ifdef POSIX_FADV_DONTNEED -- cgit v1.2.1 From be5c432a42eed10535354f31dfd6daa07095e555 Mon Sep 17 00:00:00 2001 From: Kentoku SHIBA Date: Tue, 11 Jun 2019 00:25:08 +0900 Subject: MDEV-16249 CHECKSUM TABLE for a spider table is not parallel and saves all data in memory in the spider head by default (#1328) add checksum_null for setting null value of checksum --- sql/ha_partition.cc | 68 +++- sql/ha_partition.h | 3 + sql/handler.cc | 1 + sql/handler.h | 5 +- sql/sql_show.cc | 4 +- sql/sql_table.cc | 4 +- storage/spider/ha_spider.cc | 122 +++++-- storage/spider/ha_spider.h | 14 +- .../checksum_table_with_quick_mode_3_init.inc | 2 +- .../r/checksum_table_with_quick_mode_3.result | 6 +- .../include/checksum_table_parallel_deinit.inc | 16 + .../checksum_table_parallel_extended_deinit.inc | 1 + .../checksum_table_parallel_extended_init.inc | 2 + .../include/checksum_table_parallel_init.inc | 53 +++ .../checksum_table_parallel_no_opt_deinit.inc | 1 + .../checksum_table_parallel_no_opt_init.inc | 2 + .../checksum_table_parallel_quick_deinit.inc | 1 + .../include/checksum_table_parallel_quick_init.inc | 2 + .../r/checksum_table_parallel_extended.result | 130 +++++++ .../r/checksum_table_parallel_no_opt.result | 128 +++++++ .../feature/r/checksum_table_parallel_quick.result | 128 +++++++ .../spider/feature/t/checksum_table_parallel.inc | 107 ++++++ .../feature/t/checksum_table_parallel_extended.cnf | 4 + .../t/checksum_table_parallel_extended.test | 5 + .../feature/t/checksum_table_parallel_no_opt.cnf | 4 + .../feature/t/checksum_table_parallel_no_opt.test | 5 + .../feature/t/checksum_table_parallel_quick.cnf | 4 + .../feature/t/checksum_table_parallel_quick.test | 5 + .../checksum_table_with_quick_mode_3_init.inc | 2 +- .../mysql-test/spider/include/init_spider.inc | 1 + .../r/checksum_table_with_quick_mode_3.result | 6 +- storage/spider/scripts/install_spider.sql | 6 + storage/spider/spd_conn.cc | 15 +- storage/spider/spd_conn.h | 14 +- storage/spider/spd_db_conn.cc | 49 ++- storage/spider/spd_db_conn.h | 9 +- storage/spider/spd_db_handlersocket.cc | 20 +- storage/spider/spd_db_handlersocket.h | 10 +- storage/spider/spd_db_include.cc | 27 ++ storage/spider/spd_db_include.h | 23 +- storage/spider/spd_db_mysql.cc | 388 ++++++++++++++------- storage/spider/spd_db_mysql.h | 32 +- storage/spider/spd_db_oracle.cc | 59 ++-- storage/spider/spd_db_oracle.h | 10 +- storage/spider/spd_environ.h | 1 + storage/spider/spd_include.h | 24 +- storage/spider/spd_malloc.cc | 4 +- storage/spider/spd_sys_table.cc | 126 +++---- storage/spider/spd_sys_table.h | 45 +-- storage/spider/spd_table.cc | 77 ++-- 50 files changed, 1303 insertions(+), 472 deletions(-) create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_deinit.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_deinit.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_init.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_init.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_deinit.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_init.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_deinit.inc create mode 100644 storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_init.inc create mode 100644 storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result create mode 100644 storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result create mode 100644 storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.test create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.test create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf create mode 100644 storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.test diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 4e7fccca3af..e47da94ab20 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -8200,6 +8200,7 @@ int ha_partition::info(uint flag) stats.delete_length= 0; stats.check_time= 0; stats.checksum= 0; + stats.checksum_null= TRUE; for (i= bitmap_get_first_set(&m_part_info->read_partitions); i < m_tot_parts; i= bitmap_get_next_set(&m_part_info->read_partitions, i)) @@ -8213,7 +8214,11 @@ int ha_partition::info(uint flag) stats.delete_length+= file->stats.delete_length; if (file->stats.check_time > stats.check_time) stats.check_time= file->stats.check_time; - stats.checksum+= file->stats.checksum; + if (!file->stats.checksum_null) + { + stats.checksum+= file->stats.checksum; + stats.checksum_null= FALSE; + } } if (stats.records && stats.records < 2 && !(m_file[0]->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT)) @@ -8370,6 +8375,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info, stat_info->update_time= file->stats.update_time; stat_info->check_time= file->stats.check_time; stat_info->check_sum= file->stats.checksum; + stat_info->check_sum_null= file->stats.checksum_null; } @@ -10599,6 +10605,66 @@ void ha_partition::init_table_handle_for_HANDLER() } +/** + Calculate the checksum of the table (all partitions) +*/ + +int ha_partition::pre_calculate_checksum() +{ + int error; + DBUG_ENTER("ha_partition::pre_calculate_checksum"); + m_pre_calling= TRUE; + if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM))) + { + handler **file= m_file; + do + { + if ((error= (*file)->pre_calculate_checksum())) + { + DBUG_RETURN(error); + } + } while (*(++file)); + } + DBUG_RETURN(0); +} + + +int ha_partition::calculate_checksum() +{ + int error; + stats.checksum= 0; + stats.checksum_null= TRUE; + + DBUG_ENTER("ha_partition::calculate_checksum"); + if (!m_pre_calling) + { + if ((error= pre_calculate_checksum())) + { + m_pre_calling= FALSE; + DBUG_RETURN(error); + } + } + m_pre_calling= FALSE; + if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM))) + { + handler **file= m_file; + do + { + if ((error= (*file)->calculate_checksum())) + { + DBUG_RETURN(error); + } + if (!(*file)->stats.checksum_null) + { + stats.checksum+= (*file)->stats.checksum; + stats.checksum_null= FALSE; + } + } while (*(++file)); + } + DBUG_RETURN(0); +} + + /**************************************************************************** MODULE enable/disable indexes ****************************************************************************/ diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 44058c44ce7..18468268077 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1443,6 +1443,9 @@ public: void append_row_to_str(String &str); public: + virtual int pre_calculate_checksum(); + virtual int calculate_checksum(); + /* Enabled keycache for performance reasons, WL#4571 */ virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt); virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); diff --git a/sql/handler.cc b/sql/handler.cc index 124f5c8e9ce..908d49d861a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4899,6 +4899,7 @@ void handler::get_dynamic_partition_info(PARTITION_STATS *stat_info, stat_info->update_time= stats.update_time; stat_info->check_time= stats.check_time; stat_info->check_sum= stats.checksum; + stat_info->check_sum_null= stats.checksum_null; } diff --git a/sql/handler.h b/sql/handler.h index d030a73c76f..7f178dad265 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1922,6 +1922,7 @@ typedef struct { time_t check_time; time_t update_time; ulonglong check_sum; + bool check_sum_null; } PARTITION_STATS; #define UNDEF_NODEGROUP 65535 @@ -2881,6 +2882,7 @@ public: time_t update_time; uint block_size; /* index block size */ ha_checksum checksum; + bool checksum_null; /* number of buffer bytes that native mrr implementation needs, @@ -2892,7 +2894,7 @@ public: index_file_length(0), max_index_file_length(0), delete_length(0), auto_increment_value(0), records(0), deleted(0), mean_rec_length(0), create_time(0), check_time(0), update_time(0), block_size(0), - mrr_length_per_rec(0) + checksum(0), checksum_null(FALSE), mrr_length_per_rec(0) {} }; @@ -3925,6 +3927,7 @@ public: virtual uint max_supported_key_part_length() const { return 255; } virtual uint min_record_length(uint options) const { return 1; } + virtual int pre_calculate_checksum() { return 0; } virtual int calculate_checksum(); virtual bool is_crashed() const { return 0; } virtual bool auto_repair(int error) const { return 0; } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index adf6544ff3e..bf5bb0ae7d5 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5668,7 +5668,9 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables, table->field[16]->store_time(&time); table->field[16]->set_notnull(); } - if (file->ha_table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM)) + if ((file->ha_table_flags() & + (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM)) && + !file->stats.checksum_null) { table->field[18]->store((longlong) file->stats.checksum, TRUE); table->field[18]->set_notnull(); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7c1672ace93..95b3ae8fe17 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -10936,7 +10936,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, (((t->file->ha_table_flags() & HA_HAS_OLD_CHECKSUM) && thd->variables.old_mode) || ((t->file->ha_table_flags() & HA_HAS_NEW_CHECKSUM) && !thd->variables.old_mode))) { - if (t->file->info(HA_STATUS_VARIABLE)) + if (t->file->info(HA_STATUS_VARIABLE) || t->file->stats.checksum_null) protocol->store_null(); else protocol->store((longlong)t->file->stats.checksum); @@ -10956,7 +10956,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, thd->protocol->remove_last_row(); goto err; } - if (error) + if (error || t->file->stats.checksum_null) protocol->store_null(); else protocol->store((longlong)t->file->stats.checksum); diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index fb947ef643f..4fbb6d1a8c1 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -1,4 +1,5 @@ -/* Copyright (C) 2008-2018 Kentoku Shiba +/* Copyright (C) 2008-2019 Kentoku Shiba + Copyright (C) 2019 MariaDB corp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -116,7 +117,7 @@ ha_spider::ha_spider( use_fields = FALSE; #endif use_pre_call = FALSE; - use_pre_records = FALSE; + use_pre_action = FALSE; #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS do_direct_update = FALSE; #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) @@ -228,7 +229,7 @@ ha_spider::ha_spider( use_fields = FALSE; #endif use_pre_call = FALSE; - use_pre_records = FALSE; + use_pre_action = FALSE; #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS do_direct_update = FALSE; #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) @@ -1805,7 +1806,7 @@ int ha_spider::reset() high_priority = FALSE; insert_delayed = FALSE; use_pre_call = FALSE; - use_pre_records = FALSE; + use_pre_action = FALSE; pre_bitmap_checked = FALSE; bulk_insert = FALSE; clone_bitmap_init = FALSE; @@ -8760,22 +8761,24 @@ int ha_spider::info( } if (flag & HA_STATUS_TIME) - stats.update_time = (ulong) share->update_time; + stats.update_time = (ulong) share->stat.update_time; if (flag & (HA_STATUS_CONST | HA_STATUS_VARIABLE)) { - stats.max_data_file_length = share->max_data_file_length; - stats.create_time = (ulong) share->create_time; + stats.max_data_file_length = share->stat.max_data_file_length; + stats.create_time = share->stat.create_time; stats.block_size = spider_param_block_size(thd); } if (flag & HA_STATUS_VARIABLE) { - stats.data_file_length = share->data_file_length; - stats.index_file_length = share->index_file_length; - stats.records = share->records; - stats.mean_rec_length = share->mean_rec_length; - stats.check_time = (ulong) share->check_time; + stats.data_file_length = share->stat.data_file_length; + stats.index_file_length = share->stat.index_file_length; + stats.records = share->stat.records; + stats.mean_rec_length = share->stat.mean_rec_length; + stats.check_time = share->stat.check_time; if (stats.records <= 1 /* && (flag & HA_STATUS_NO_LOCK) */ ) stats.records = 2; + stats.checksum = share->stat.checksum; + stats.checksum_null = share->stat.checksum_null; } if (flag & HA_STATUS_AUTO) { @@ -9014,7 +9017,7 @@ ha_rows ha_spider::records_in_range( key_part_map tgt_key_part_map; KEY_PART_INFO *key_part; Field *field = NULL; - double rows = (double) share->records; + double rows = (double) share->stat.records; double weight, rate; DBUG_PRINT("info",("spider rows1=%f", rows)); if (start_key) @@ -9323,11 +9326,12 @@ int ha_spider::pre_records() result_list.casual_read[search_link_idx] = spider_param_casual_read(thd, share->casual_read); } - if ((error_num = spider_db_show_records(this, search_link_idx, TRUE))) + if ((error_num = spider_db_simple_action(SPIDER_SIMPLE_RECORDS, this, + search_link_idx, TRUE))) { DBUG_RETURN(check_error_mode(error_num)); } - use_pre_records = TRUE; + use_pre_action = TRUE; DBUG_RETURN(0); } @@ -9339,14 +9343,14 @@ ha_rows ha_spider::records() DBUG_PRINT("info",("spider this=%p", this)); if (sql_command == SQLCOM_ALTER_TABLE) { - use_pre_records = FALSE; + use_pre_action = FALSE; DBUG_RETURN(0); } if (!(share->additional_table_flags & HA_HAS_RECORDS) && !this->result_list.direct_limit_offset) { DBUG_RETURN(handler::records()); } - if (!use_pre_records && !this->result_list.direct_limit_offset) + if (!use_pre_action && !this->result_list.direct_limit_offset) { THD *thd = trx->thd; if ( @@ -9357,17 +9361,84 @@ ha_rows ha_spider::records() spider_param_casual_read(thd, share->casual_read); } } - if ((error_num = spider_db_show_records(this, search_link_idx, FALSE))) + if ((error_num = spider_db_simple_action(SPIDER_SIMPLE_RECORDS, this, + search_link_idx, FALSE))) { - use_pre_records = FALSE; + use_pre_action = FALSE; check_error_mode(error_num); DBUG_RETURN(HA_POS_ERROR); } - use_pre_records = FALSE; - share->records = table_rows; + use_pre_action = FALSE; + share->stat.records = table_rows; DBUG_RETURN(table_rows); } +#ifdef HA_HAS_CHECKSUM_EXTENDED +int ha_spider::pre_calculate_checksum() +{ + int error_num; + backup_error_status(); + DBUG_ENTER("ha_spider::pre_calculate_checksum"); + DBUG_PRINT("info",("spider this=%p", this)); + THD *thd = trx->thd; + if ( + spider_param_sync_autocommit(thd) && + (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + ) { + result_list.casual_read[search_link_idx] = + spider_param_casual_read(thd, share->casual_read); + } + action_flags = T_EXTEND; + if ((error_num = spider_db_simple_action(SPIDER_SIMPLE_CHECKSUM_TABLE, this, + search_link_idx, TRUE))) + { + DBUG_RETURN(check_error_mode(error_num)); + } + use_pre_action = TRUE; + DBUG_RETURN(0); +} + +int ha_spider::calculate_checksum() +{ + int error_num; + backup_error_status(); + DBUG_ENTER("ha_spider::calculate_checksum"); + DBUG_PRINT("info",("spider this=%p", this)); + if (!use_pre_action && !this->result_list.direct_limit_offset) + { + THD *thd = trx->thd; + if ( + spider_param_sync_autocommit(thd) && + (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + ) { + result_list.casual_read[search_link_idx] = + spider_param_casual_read(thd, share->casual_read); + } + } + action_flags = T_EXTEND; + if ((error_num = spider_db_simple_action(SPIDER_SIMPLE_CHECKSUM_TABLE, this, + search_link_idx, FALSE))) + { + use_pre_action = FALSE; + DBUG_RETURN(check_error_mode(error_num)); + } + use_pre_action = FALSE; + if (checksum_null) + { + share->stat.checksum_null = TRUE; + share->stat.checksum = 0; + stats.checksum_null = TRUE; + stats.checksum = 0; + } else { + share->stat.checksum_null = FALSE; + share->stat.checksum = checksum_val; + stats.checksum_null = FALSE; + stats.checksum = checksum_val; + } + DBUG_RETURN(0); +} +#endif + const char *ha_spider::table_type() const { DBUG_ENTER("ha_spider::table_type"); @@ -11172,8 +11243,9 @@ double ha_spider::scan_time() DBUG_ENTER("ha_spider::scan_time"); DBUG_PRINT("info",("spider this=%p", this)); DBUG_PRINT("info",("spider scan_time = %.6f", - share->scan_rate * share->records * share->mean_rec_length + 2)); - DBUG_RETURN(share->scan_rate * share->records * share->mean_rec_length + 2); + share->scan_rate * share->stat.records * share->stat.mean_rec_length + 2)); + DBUG_RETURN(share->scan_rate * share->stat.records * + share->stat.mean_rec_length + 2); } double ha_spider::read_time( @@ -11192,8 +11264,8 @@ double ha_spider::read_time( rows / 2 + 2); } else { DBUG_PRINT("info",("spider read_time = %.6f", - share->read_rate * share->mean_rec_length * rows + 2)); - DBUG_RETURN(share->read_rate * share->mean_rec_length * rows + 2); + share->read_rate * share->stat.mean_rec_length * rows + 2)); + DBUG_RETURN(share->read_rate * share->stat.mean_rec_length * rows + 2); } } diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h index 9ffe49754e8..6ac71254b12 100644 --- a/storage/spider/ha_spider.h +++ b/storage/spider/ha_spider.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2008-2018 Kentoku Shiba +/* Copyright (C) 2008-2019 Kentoku Shiba + Copyright (C) 2019 MariaDB corp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -170,7 +171,7 @@ public: bool high_priority; bool insert_delayed; bool use_pre_call; - bool use_pre_records; + bool use_pre_action; bool pre_bitmap_checked; enum thr_lock_type lock_type; int lock_mode; @@ -243,6 +244,11 @@ public: SPIDER_ITEM_HLD *direct_aggregate_item_current; #endif ha_rows table_rows; +#ifdef HA_HAS_CHECKSUM_EXTENDED + ulonglong checksum_val; + bool checksum_null; + uint action_flags; +#endif /* for fulltext search */ bool ft_init_and_first; @@ -512,6 +518,10 @@ public: int check_crd(); int pre_records(); ha_rows records(); +#ifdef HA_HAS_CHECKSUM_EXTENDED + int pre_calculate_checksum(); + int calculate_checksum(); +#endif const char *table_type() const; ulonglong table_flags() const; const char *index_type( diff --git a/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc b/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc index bf2d9163b9a..123410380ab 100644 --- a/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc +++ b/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc @@ -21,7 +21,7 @@ let $CHILD2_1_CREATE_TABLES= let $CHILD2_1_SELECT_TABLES= SELECT pkey FROM tbl_a ORDER BY pkey; let $CHILD2_1_SELECT_ARGUMENT1= - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; --connection master_1 set @old_spider_quick_mode= @@spider_quick_mode; set session spider_quick_mode= 3; diff --git a/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result index eae4895411e..bd423d934f5 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result +++ b/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result @@ -44,10 +44,10 @@ CHECKSUM TABLE tbl_a EXTENDED; Table Checksum auto_test_local.tbl_a 1061386331 connection child2_1; -SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; argument -select `pkey` from `auto_test_remote`.`tbl_a` -SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +checksum table `auto_test_remote`.`tbl_a` extended +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' SELECT pkey FROM tbl_a ORDER BY pkey; pkey 0 diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_deinit.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_deinit.inc new file mode 100644 index 00000000000..52b0625ed9a --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_deinit.inc @@ -0,0 +1,16 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP +--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP +--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP +--connection master_1 +set session spider_bgs_mode= @old_spider_bgs_mode; +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_deinit.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_deinit.inc new file mode 100644 index 00000000000..799bd983393 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_deinit.inc @@ -0,0 +1 @@ +--source checksum_table_parallel_deinit.inc diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_init.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_init.inc new file mode 100644 index 00000000000..f17a532d53b --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_extended_init.inc @@ -0,0 +1,2 @@ +--source checksum_table_parallel_init.inc +--let $MASTER_1_CHECKSUM_TABLE= CHECKSUM TABLE tbl_a EXTENDED diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_init.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_init.inc new file mode 100644 index 00000000000..7aab82515a0 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_init.inc @@ -0,0 +1,53 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +if (!$HAVE_PARTITION) +{ + --source checksum_table_parallel_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a"' + PARTITION BY KEY(pkey) ( + PARTITION pt1 COMMENT='srv "s_2_1"', + PARTITION pt2 COMMENT='srv "s_2_2"' + ); +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES +let $CHILD2_2_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES +let $CHILD2_2_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +--connection master_1 +set @old_spider_bgs_mode= @@spider_bgs_mode; +set session spider_bgs_mode= 1; diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_deinit.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_deinit.inc new file mode 100644 index 00000000000..799bd983393 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_deinit.inc @@ -0,0 +1 @@ +--source checksum_table_parallel_deinit.inc diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_init.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_init.inc new file mode 100644 index 00000000000..230b6432a01 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_no_opt_init.inc @@ -0,0 +1,2 @@ +--source checksum_table_parallel_init.inc +--let $MASTER_1_CHECKSUM_TABLE= CHECKSUM TABLE tbl_a diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_deinit.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_deinit.inc new file mode 100644 index 00000000000..799bd983393 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_deinit.inc @@ -0,0 +1 @@ +--source checksum_table_parallel_deinit.inc diff --git a/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_init.inc b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_init.inc new file mode 100644 index 00000000000..66f6ecbe0ef --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/include/checksum_table_parallel_quick_init.inc @@ -0,0 +1,2 @@ +--source checksum_table_parallel_init.inc +--let $MASTER_1_CHECKSUM_TABLE= CHECKSUM TABLE tbl_a QUICK diff --git a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result new file mode 100644 index 00000000000..34587052181 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_extended.result @@ -0,0 +1,130 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_bgs_mode= @@spider_bgs_mode; +set session spider_bgs_mode= 1; + +this test is for MDEV-16967 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_1_2; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_2_2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; +connection master_1; +CHECKSUM TABLE tbl_a EXTENDED; +connection child2_1_2; +SELECT SLEEP(1); +SLEEP(1) +0 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +argument +checksum table `auto_test_remote`.`tbl_a` extended +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' +connection child2_2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +argument +checksum table `auto_test_remote2`.`tbl_a` extended +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' +connection child2_1; +UNLOCK TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +1 +3 +5 +7 +9 +11 +13 +15 +17 +19 +21 +23 +25 +27 +29 +connection child2_2; +UNLOCK TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +connection master_1; +Table Checksum +auto_test_local.tbl_a 1061386331 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_bgs_mode= @old_spider_bgs_mode; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result new file mode 100644 index 00000000000..4e44bd4cc73 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_no_opt.result @@ -0,0 +1,128 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_bgs_mode= @@spider_bgs_mode; +set session spider_bgs_mode= 1; + +this test is for MDEV-16967 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_1_2; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_2_2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; +connection master_1; +CHECKSUM TABLE tbl_a; +connection child2_1_2; +SELECT SLEEP(1); +SLEEP(1) +0 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +argument +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' +connection child2_2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +argument +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' +connection child2_1; +UNLOCK TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +1 +3 +5 +7 +9 +11 +13 +15 +17 +19 +21 +23 +25 +27 +29 +connection child2_2; +UNLOCK TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +connection master_1; +Table Checksum +auto_test_local.tbl_a NULL + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_bgs_mode= @old_spider_bgs_mode; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result new file mode 100644 index 00000000000..b2c55b34130 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/r/checksum_table_parallel_quick.result @@ -0,0 +1,128 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_bgs_mode= @@spider_bgs_mode; +set session spider_bgs_mode= 1; + +this test is for MDEV-16967 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +connection child2_1_2; +USE auto_test_remote; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_2_2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; +connection master_1; +CHECKSUM TABLE tbl_a QUICK; +connection child2_1_2; +SELECT SLEEP(1); +SLEEP(1) +0 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +argument +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' +connection child2_2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; +argument +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' +connection child2_1; +UNLOCK TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +1 +3 +5 +7 +9 +11 +13 +15 +17 +19 +21 +23 +25 +27 +29 +connection child2_2; +UNLOCK TABLES; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +2 +4 +6 +8 +10 +12 +14 +16 +18 +20 +22 +24 +26 +28 +connection master_1; +Table Checksum +auto_test_local.tbl_a NULL + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session spider_bgs_mode= @old_spider_bgs_mode; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc new file mode 100644 index 00000000000..13e5053d64c --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel.inc @@ -0,0 +1,107 @@ +--echo +--echo this test is for MDEV-16967 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; + +--connection child2_1 +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +--connection child2_1_2 +USE auto_test_remote; + +--connection child2_2 +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +--connection child2_2_2 +USE auto_test_remote2; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +--disable_query_log +echo CHILD2_2_CREATE_TABLES; +eval $CHILD2_2_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +--echo +--echo select test 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; +LOCK TABLE tbl_a WRITE; + +--connection master_1 +send_eval $MASTER_1_CHECKSUM_TABLE; + +--connection child2_1_2 +SELECT SLEEP(1); +eval $CHILD2_1_SELECT_ARGUMENT1; + +--connection child2_2_2 +eval $CHILD2_2_SELECT_ARGUMENT1; + +--connection child2_1 +UNLOCK TABLES; +eval $CHILD2_1_SELECT_TABLES; + +--connection child2_2 +UNLOCK TABLES; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +reap; + +--echo +--echo deinit +--disable_warnings + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--connection child2_1 +DROP DATABASE IF EXISTS auto_test_remote; +SET GLOBAL log_output = @old_log_output; + +--connection child2_2 +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; + +--enable_warnings diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.test b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.test new file mode 100644 index 00000000000..871e1e868ad --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_extended.test @@ -0,0 +1,5 @@ +--source ../include/checksum_table_parallel_extended_init.inc +--source checksum_table_parallel.inc +--source ../include/checksum_table_parallel_extended_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.test b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.test new file mode 100644 index 00000000000..0352d598df6 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_no_opt.test @@ -0,0 +1,5 @@ +--source ../include/checksum_table_parallel_no_opt_init.inc +--source checksum_table_parallel.inc +--source ../include/checksum_table_parallel_no_opt_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.test b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.test new file mode 100644 index 00000000000..f08f782e7c0 --- /dev/null +++ b/storage/spider/mysql-test/spider/feature/t/checksum_table_parallel_quick.test @@ -0,0 +1,5 @@ +--source ../include/checksum_table_parallel_quick_init.inc +--source checksum_table_parallel.inc +--source ../include/checksum_table_parallel_quick_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc index 9ec61a1cb77..0bb12d8f874 100644 --- a/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc +++ b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc @@ -21,7 +21,7 @@ let $CHILD2_1_CREATE_TABLES= let $CHILD2_1_SELECT_TABLES= SELECT pkey FROM tbl_a ORDER BY pkey; let $CHILD2_1_SELECT_ARGUMENT1= - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; --let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 --let $OUTPUT_CHILD_GROUP2= 1 --let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG diff --git a/storage/spider/mysql-test/spider/include/init_spider.inc b/storage/spider/mysql-test/spider/include/init_spider.inc index 1da1ec970b5..c1167b3c37e 100644 --- a/storage/spider/mysql-test/spider/include/init_spider.inc +++ b/storage/spider/mysql-test/spider/include/init_spider.inc @@ -409,6 +409,7 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) check_time datetime not null default '0000-00-00 00:00:00', create_time datetime not null default '0000-00-00 00:00:00', update_time datetime not null default '0000-00-00 00:00:00', + checksum bigint unsigned default null, primary key (db_name, table_name) ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_table_crd; diff --git a/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result index ee8e1f056f3..2fe86099bc2 100644 --- a/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result +++ b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result @@ -45,10 +45,10 @@ CHECKSUM TABLE tbl_a EXTENDED; Table Checksum auto_test_local.tbl_a 1061386331 connection child2_1; -SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %'; argument -select `pkey` from `auto_test_remote`.`tbl_a` -SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +checksum table `auto_test_remote`.`tbl_a` extended +SELECT argument FROM mysql.general_log WHERE argument LIKE '%checksum %' SELECT pkey FROM tbl_a ORDER BY pkey; pkey 0 diff --git a/storage/spider/scripts/install_spider.sql b/storage/spider/scripts/install_spider.sql index f52c78e496d..30c92e6c710 100644 --- a/storage/spider/scripts/install_spider.sql +++ b/storage/spider/scripts/install_spider.sql @@ -150,6 +150,7 @@ create table if not exists mysql.spider_table_sts( check_time datetime not null default '0000-00-00 00:00:00', create_time datetime not null default '0000-00-00 00:00:00', update_time datetime not null default '0000-00-00 00:00:00', + checksum bigint unsigned default null, primary key (db_name, table_name) ) engine=MyISAM default charset=utf8 collate=utf8_bin; create table if not exists mysql.spider_table_crd( @@ -408,6 +409,11 @@ begin modify table_name char(199) not null default ''; end if; + -- Fix for version 3.3.15 + call mysql.spider_fix_one_table('spider_table_sts', 'checksum', + 'alter table mysql.spider_table_sts + add column checksum bigint unsigned default null after update_time'); + -- Fix for MariaDB 10.4: Crash-Safe system tables if @server_name = 'MariaDB' and ( diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc index 9e1dbaf7f28..b1f49f4f250 100644 --- a/storage/spider/spd_conn.cc +++ b/storage/spider/spd_conn.cc @@ -2819,23 +2819,20 @@ void *spider_bg_conn_action( { switch (conn->bg_simple_action) { - case SPIDER_BG_SIMPLE_CONNECT: + case SPIDER_SIMPLE_CONNECT: conn->db_conn->bg_connect(); break; - case SPIDER_BG_SIMPLE_DISCONNECT: + case SPIDER_SIMPLE_DISCONNECT: conn->db_conn->bg_disconnect(); break; - case SPIDER_BG_SIMPLE_RECORDS: - DBUG_PRINT("info",("spider bg simple records")); + default: spider = (ha_spider*) conn->bg_target; *conn->bg_error_num = - spider->dbton_handler[conn->dbton_id]-> - show_records(conn->link_idx); - break; - default: + spider_db_simple_action(conn->bg_simple_action, + spider->dbton_handler[conn->dbton_id], conn->link_idx); break; } - conn->bg_simple_action = SPIDER_BG_SIMPLE_NO_ACTION; + conn->bg_simple_action = SPIDER_SIMPLE_NO_ACTION; if (conn->bg_caller_wait) { pthread_mutex_lock(&conn->bg_conn_sync_mutex); diff --git a/storage/spider/spd_conn.h b/storage/spider/spd_conn.h index ba4db883378..7be18f8c207 100644 --- a/storage/spider/spd_conn.h +++ b/storage/spider/spd_conn.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2008-2018 Kentoku Shiba +/* Copyright (C) 2008-2019 Kentoku Shiba + Copyright (C) 2019 MariaDB corp This 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,10 +18,13 @@ #define SPIDER_LOCK_MODE_SHARED 1 #define SPIDER_LOCK_MODE_EXCLUSIVE 2 -#define SPIDER_BG_SIMPLE_NO_ACTION 0 -#define SPIDER_BG_SIMPLE_CONNECT 1 -#define SPIDER_BG_SIMPLE_DISCONNECT 2 -#define SPIDER_BG_SIMPLE_RECORDS 3 +#define SPIDER_SIMPLE_NO_ACTION 0 +#define SPIDER_SIMPLE_CONNECT 1 +#define SPIDER_SIMPLE_DISCONNECT 2 +#define SPIDER_SIMPLE_RECORDS 3 +#ifdef HA_HAS_CHECKSUM_EXTENDED +#define SPIDER_SIMPLE_CHECKSUM_TABLE 4 +#endif uchar *spider_conn_get_key( SPIDER_CONN *conn, diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index 97a4d362944..f3d607cd6dc 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -5684,7 +5684,38 @@ int spider_db_show_table_status( DBUG_RETURN(error_num); } -int spider_db_show_records( +int spider_db_simple_action( + uint simple_action, + spider_db_handler *db_handler, + int link_idx +) { + int error_num; + DBUG_ENTER("spider_db_simple_action"); + switch (simple_action) + { + case SPIDER_SIMPLE_RECORDS: + DBUG_PRINT("info",("spider simple records")); + error_num = db_handler->show_records( + link_idx + ); + break; +#ifdef HA_HAS_CHECKSUM_EXTENDED + case SPIDER_SIMPLE_CHECKSUM_TABLE: + DBUG_PRINT("info",("spider simple checksum_table")); + error_num = db_handler->checksum_table( + link_idx + ); + break; +#endif + default: + DBUG_ASSERT(0); + break; + } + DBUG_RETURN(error_num); +} + +int spider_db_simple_action( + uint simple_action, ha_spider *spider, int link_idx, bool pre_call @@ -5692,7 +5723,7 @@ int spider_db_show_records( int error_num; THD *thd = spider->trx->thd; SPIDER_CONN *conn; - DBUG_ENTER("spider_db_show_records"); + DBUG_ENTER("spider_db_simple_action"); if (pre_call) { if (spider_param_bgs_mode(thd, spider->share->bgs_mode)) @@ -5705,18 +5736,20 @@ int spider_db_show_records( conn = spider->conns[link_idx]; if (!(error_num = spider_create_conn_thread(conn))) { - spider_bg_conn_simple_action(conn, SPIDER_BG_SIMPLE_RECORDS, FALSE, + spider_bg_conn_simple_action(conn, simple_action, FALSE, spider, link_idx, (int *) &spider->result_list.bgs_error); } } else { conn = spider->conns[link_idx]; - error_num = spider->dbton_handler[conn->dbton_id]->show_records( + error_num = spider_db_simple_action( + simple_action, + spider->dbton_handler[conn->dbton_id], link_idx ); } } else { conn = spider->conns[link_idx]; - if (spider->use_pre_records) + if (spider->use_pre_action) { if (spider_param_bgs_mode(thd, spider->share->bgs_mode)) { @@ -5730,7 +5763,9 @@ int spider_db_show_records( error_num = 0; } } else { - error_num = spider->dbton_handler[conn->dbton_id]->show_records( + error_num = spider_db_simple_action( + simple_action, + spider->dbton_handler[conn->dbton_id], link_idx ); } @@ -5758,7 +5793,7 @@ void spider_db_set_cardinarity( { key_part = &key_info->key_part[roop_count2]; field = key_part->field; - rec_per_key = (ha_rows) share->records / + rec_per_key = (ha_rows) share->stat.records / share->cardinality[field->field_index]; if (rec_per_key > ~(ulong) 0) key_info->rec_per_key[roop_count2] = ~(ulong) 0; diff --git a/storage/spider/spd_db_conn.h b/storage/spider/spd_db_conn.h index b5b0f57a3af..e6ce926f4ee 100644 --- a/storage/spider/spd_db_conn.h +++ b/storage/spider/spd_db_conn.h @@ -697,7 +697,14 @@ int spider_db_show_table_status( uint flag ); -int spider_db_show_records( +int spider_db_simple_action( + uint simple_action, + spider_db_handler *db_handler, + int link_idx +); + +int spider_db_simple_action( + uint simple_action, ha_spider *spider, int link_idx, bool pre_call diff --git a/storage/spider/spd_db_handlersocket.cc b/storage/spider/spd_db_handlersocket.cc index 8dea7685c52..ac81525092b 100644 --- a/storage/spider/spd_db_handlersocket.cc +++ b/storage/spider/spd_db_handlersocket.cc @@ -740,15 +740,7 @@ SPIDER_DB_ROW *spider_db_handlersocket_result::fetch_row_from_tmp_table( int spider_db_handlersocket_result::fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat ) { DBUG_ENTER("spider_db_handlersocket_result::fetch_table_status"); DBUG_PRINT("info",("spider this=%p", this)); @@ -5813,15 +5805,7 @@ int spider_handlersocket_handler::show_table_status( DBUG_ENTER("spider_handlersocket_show_table_status"); res.fetch_table_status( sts_mode, - share->records, - share->mean_rec_length, - share->data_file_length, - share->max_data_file_length, - share->index_file_length, - auto_increment_value, - share->create_time, - share->update_time, - share->check_time + share->stat ); if (auto_increment_value > share->lgtm_tblhnd_share->auto_increment_value) { diff --git a/storage/spider/spd_db_handlersocket.h b/storage/spider/spd_db_handlersocket.h index fce57c8153a..f94be204a70 100644 --- a/storage/spider/spd_db_handlersocket.h +++ b/storage/spider/spd_db_handlersocket.h @@ -215,15 +215,7 @@ public: ); int fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat ); int fetch_table_records( int mode, diff --git a/storage/spider/spd_db_include.cc b/storage/spider/spd_db_include.cc index 2910aa97690..7f600142187 100644 --- a/storage/spider/spd_db_include.cc +++ b/storage/spider/spd_db_include.cc @@ -41,6 +41,16 @@ spider_db_result::spider_db_result( DBUG_VOID_RETURN; } +#ifdef HA_HAS_CHECKSUM_EXTENDED +int spider_db_result::fetch_table_checksum( + ha_spider *spider +) { + DBUG_ENTER("spider_db_result::fetch_table_checksum"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(0); +} +#endif + spider_db_conn::spider_db_conn( SPIDER_CONN *in_conn ) : conn(in_conn), dbton_id(in_conn->dbton_id) @@ -49,3 +59,20 @@ spider_db_conn::spider_db_conn( DBUG_PRINT("info",("spider this=%p", this)); DBUG_VOID_RETURN; } + +#ifdef HA_HAS_CHECKSUM_EXTENDED +bool spider_db_share::checksum_support() +{ + DBUG_ENTER("spider_db_share::checksum_support"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(FALSE); +} + +int spider_db_handler::checksum_table( + int link_idx +) { + DBUG_ENTER("spider_db_handler::checksum_table"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(0); +} +#endif diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h index 325bf80a1e3..94129d1c04f 100644 --- a/storage/spider/spd_db_include.h +++ b/storage/spider/spd_db_include.h @@ -988,20 +988,17 @@ public: ) = 0; virtual int fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat ) = 0; virtual int fetch_table_records( int mode, ha_rows &records ) = 0; +#ifdef HA_HAS_CHECKSUM_EXTENDED + virtual int fetch_table_checksum( + ha_spider *spider + ); +#endif virtual int fetch_table_cardinality( int mode, TABLE *table, @@ -1276,6 +1273,9 @@ public: spider_string *str ) = 0; #endif +#ifdef HA_HAS_CHECKSUM_EXTENDED + virtual bool checksum_support(); +#endif }; class spider_db_handler @@ -1644,6 +1644,11 @@ public: virtual int show_records( int link_idx ) = 0; +#ifdef HA_HAS_CHECKSUM_EXTENDED + virtual int checksum_table( + int link_idx + ); +#endif virtual int show_last_insert_id( int link_idx, ulonglong &last_insert_id diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 6a0aef4bafb..313c6d0495c 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -126,7 +126,7 @@ static const char *name_quote_str = SPIDER_SQL_NAME_QUOTE_STR; #define SPIDER_SQL_SHOW_TABLE_STATUS_STR "show table status from " #define SPIDER_SQL_SHOW_TABLE_STATUS_LEN sizeof(SPIDER_SQL_SHOW_TABLE_STATUS_STR) - 1 -#define SPIDER_SQL_SELECT_TABLES_STATUS_STR "select `table_rows`,`avg_row_length`,`data_length`,`max_data_length`,`index_length`,`auto_increment`,`create_time`,`update_time`,`check_time` from `information_schema`.`tables` where `table_schema` = " +#define SPIDER_SQL_SELECT_TABLES_STATUS_STR "select `table_rows`,`avg_row_length`,`data_length`,`max_data_length`,`index_length`,`auto_increment`,`create_time`,`update_time`,`check_time`,`checksum` from `information_schema`.`tables` where `table_schema` = " #define SPIDER_SQL_SELECT_TABLES_STATUS_LEN sizeof(SPIDER_SQL_SELECT_TABLES_STATUS_STR) - 1 #define SPIDER_SQL_SHOW_WARNINGS_STR "show warnings" #define SPIDER_SQL_SHOW_WARNINGS_LEN sizeof(SPIDER_SQL_SHOW_WARNINGS_STR) - 1 @@ -154,6 +154,15 @@ static const char *name_quote_str = SPIDER_SQL_NAME_QUOTE_STR; #define SPIDER_SQL_USING_HASH_LEN sizeof(SPIDER_SQL_USING_HASH_STR) - 1 #endif +#define SPIDER_SQL_SHOW_RECORDS_RECORDS_POS 0 +#define SPIDER_SQL_EXPLAIN_SELECT_RECORDS_POS 8 + +#ifdef HA_HAS_CHECKSUM_EXTENDED +#define SPIDER_SQL_CHECKSUM_CHECKSUM_POS 1 +#define SPIDER_SQL_CHECKSUM_TABLE_STR "checksum table " +#define SPIDER_SQL_CHECKSUM_TABLE_LEN (sizeof(SPIDER_SQL_CHECKSUM_TABLE_STR) - 1) +#endif + #define SPIDER_SQL_LIKE_STR " like " #define SPIDER_SQL_LIKE_LEN (sizeof(SPIDER_SQL_LIKE_STR) - 1) #define SPIDER_SQL_LIMIT1_STR " limit 1" @@ -787,15 +796,7 @@ SPIDER_DB_ROW *spider_db_mbase_result::fetch_row_from_tmp_table( int spider_db_mbase_result::fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat ) { int error_num; MYSQL_ROW mysql_row; @@ -834,47 +835,47 @@ int spider_db_mbase_result::fetch_table_status( } if (mysql_row[4]) - records = + stat.records = (ha_rows) my_strtoll10(mysql_row[4], (char**) NULL, &error_num); else - records = (ha_rows) 0; + stat.records = (ha_rows) 0; DBUG_PRINT("info", - ("spider records=%lld", records)); + ("spider records=%lld", stat.records)); if (mysql_row[5]) - mean_rec_length = + stat.mean_rec_length = (ulong) my_strtoll10(mysql_row[5], (char**) NULL, &error_num); else - mean_rec_length = 0; + stat.mean_rec_length = 0; DBUG_PRINT("info", - ("spider mean_rec_length=%lu", mean_rec_length)); + ("spider mean_rec_length=%lu", stat.mean_rec_length)); if (mysql_row[6]) - data_file_length = + stat.data_file_length = (ulonglong) my_strtoll10(mysql_row[6], (char**) NULL, &error_num); else - data_file_length = 0; + stat.data_file_length = 0; DBUG_PRINT("info", - ("spider data_file_length=%lld", data_file_length)); + ("spider data_file_length=%lld", stat.data_file_length)); if (mysql_row[7]) - max_data_file_length = + stat.max_data_file_length = (ulonglong) my_strtoll10(mysql_row[7], (char**) NULL, &error_num); else - max_data_file_length = 0; + stat.max_data_file_length = 0; DBUG_PRINT("info", - ("spider max_data_file_length=%lld", max_data_file_length)); + ("spider max_data_file_length=%lld", stat.max_data_file_length)); if (mysql_row[8]) - index_file_length = + stat.index_file_length = (ulonglong) my_strtoll10(mysql_row[8], (char**) NULL, &error_num); else - index_file_length = 0; + stat.index_file_length = 0; DBUG_PRINT("info", - ("spider index_file_length=%lld", index_file_length)); + ("spider index_file_length=%lld", stat.index_file_length)); if (mysql_row[10]) - auto_increment_value = + stat.auto_increment_value = (ulonglong) my_strtoll10(mysql_row[10], (char**) NULL, &error_num); else - auto_increment_value = 1; + stat.auto_increment_value = 1; DBUG_PRINT("info", - ("spider auto_increment_value=%lld", auto_increment_value)); + ("spider auto_increment_value=%lld", stat.auto_increment_value)); if (mysql_row[11]) { #ifdef SPIDER_HAS_TIME_STATUS @@ -883,19 +884,19 @@ int spider_db_mbase_result::fetch_table_status( SPIDER_str_to_datetime(mysql_row[11], strlen(mysql_row[11]), &mysql_time, 0, &time_status); #ifdef MARIADB_BASE_VERSION - create_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.create_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - create_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.create_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif } else - create_time = (time_t) 0; + stat.create_time = (time_t) 0; #ifndef DBUG_OFF { struct tm *ts, tmp_ts; char buf[80]; - ts = localtime_r(&create_time, &tmp_ts); + ts = localtime_r(&stat.create_time, &tmp_ts); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts); DBUG_PRINT("info",("spider create_time=%s", buf)); } @@ -908,19 +909,19 @@ int spider_db_mbase_result::fetch_table_status( SPIDER_str_to_datetime(mysql_row[12], strlen(mysql_row[12]), &mysql_time, 0, &time_status); #ifdef MARIADB_BASE_VERSION - update_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.update_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - update_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.update_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif } else - update_time = (time_t) 0; + stat.update_time = (time_t) 0; #ifndef DBUG_OFF { struct tm *ts, tmp_ts; char buf[80]; - ts = localtime_r(&update_time, &tmp_ts); + ts = localtime_r(&stat.update_time, &tmp_ts); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts); DBUG_PRINT("info",("spider update_time=%s", buf)); } @@ -933,66 +934,77 @@ int spider_db_mbase_result::fetch_table_status( SPIDER_str_to_datetime(mysql_row[13], strlen(mysql_row[13]), &mysql_time, 0, &time_status); #ifdef MARIADB_BASE_VERSION - check_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.check_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - check_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.check_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif } else - check_time = (time_t) 0; + stat.check_time = (time_t) 0; #ifndef DBUG_OFF { struct tm *ts, tmp_ts; char buf[80]; - ts = localtime_r(&check_time, &tmp_ts); + ts = localtime_r(&stat.check_time, &tmp_ts); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts); DBUG_PRINT("info",("spider check_time=%s", buf)); } #endif + if (mysql_row[15]) + { + stat.checksum_null = FALSE; + stat.checksum = + (ha_checksum) my_strtoll10(mysql_row[15], (char**) NULL, &error_num); + DBUG_PRINT("info", ("spider checksum=%lu", (ulong) stat.checksum)); + } else { + stat.checksum_null = TRUE; + stat.checksum = (ha_checksum) 0; + DBUG_PRINT("info", ("spider checksum is null")); + } } else { if (mysql_row[0]) - records = + stat.records = (ha_rows) my_strtoll10(mysql_row[0], (char**) NULL, &error_num); else - records = (ha_rows) 0; + stat.records = (ha_rows) 0; DBUG_PRINT("info", - ("spider records=%lld", records)); + ("spider records=%lld", stat.records)); if (mysql_row[1]) - mean_rec_length = + stat.mean_rec_length = (ulong) my_strtoll10(mysql_row[1], (char**) NULL, &error_num); else - mean_rec_length = 0; + stat.mean_rec_length = 0; DBUG_PRINT("info", - ("spider mean_rec_length=%lu", mean_rec_length)); + ("spider mean_rec_length=%lu", stat.mean_rec_length)); if (mysql_row[2]) - data_file_length = + stat.data_file_length = (ulonglong) my_strtoll10(mysql_row[2], (char**) NULL, &error_num); else - data_file_length = 0; + stat.data_file_length = 0; DBUG_PRINT("info", - ("spider data_file_length=%lld", data_file_length)); + ("spider data_file_length=%lld", stat.data_file_length)); if (mysql_row[3]) - max_data_file_length = + stat.max_data_file_length = (ulonglong) my_strtoll10(mysql_row[3], (char**) NULL, &error_num); else - max_data_file_length = 0; + stat.max_data_file_length = 0; DBUG_PRINT("info", - ("spider max_data_file_length=%lld", max_data_file_length)); + ("spider max_data_file_length=%lld", stat.max_data_file_length)); if (mysql_row[4]) - index_file_length = + stat.index_file_length = (ulonglong) my_strtoll10(mysql_row[4], (char**) NULL, &error_num); else - index_file_length = 0; + stat.index_file_length = 0; DBUG_PRINT("info", - ("spider index_file_length=%lld", index_file_length)); + ("spider index_file_length=%lld", stat.index_file_length)); if (mysql_row[5]) - auto_increment_value = + stat.auto_increment_value = (ulonglong) my_strtoll10(mysql_row[5], (char**) NULL, &error_num); else - auto_increment_value = 1; + stat.auto_increment_value = 1; DBUG_PRINT("info", - ("spider auto_increment_value=%lld", auto_increment_value)); + ("spider auto_increment_value=%lld", stat.auto_increment_value)); if (mysql_row[6]) { #ifdef SPIDER_HAS_TIME_STATUS @@ -1001,19 +1013,19 @@ int spider_db_mbase_result::fetch_table_status( SPIDER_str_to_datetime(mysql_row[6], strlen(mysql_row[6]), &mysql_time, 0, &time_status); #ifdef MARIADB_BASE_VERSION - create_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.create_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - create_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.create_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif } else - create_time = (time_t) 0; + stat.create_time = (time_t) 0; #ifndef DBUG_OFF { struct tm *ts, tmp_ts; char buf[80]; - ts = localtime_r(&create_time, &tmp_ts); + ts = localtime_r(&stat.create_time, &tmp_ts); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts); DBUG_PRINT("info",("spider create_time=%s", buf)); } @@ -1026,19 +1038,19 @@ int spider_db_mbase_result::fetch_table_status( SPIDER_str_to_datetime(mysql_row[7], strlen(mysql_row[7]), &mysql_time, 0, &time_status); #ifdef MARIADB_BASE_VERSION - update_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.update_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - update_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.update_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif } else - update_time = (time_t) 0; + stat.update_time = (time_t) 0; #ifndef DBUG_OFF { struct tm *ts, tmp_ts; char buf[80]; - ts = localtime_r(&update_time, &tmp_ts); + ts = localtime_r(&stat.update_time, &tmp_ts); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts); DBUG_PRINT("info",("spider update_time=%s", buf)); } @@ -1051,34 +1063,46 @@ int spider_db_mbase_result::fetch_table_status( SPIDER_str_to_datetime(mysql_row[8], strlen(mysql_row[8]), &mysql_time, 0, &time_status); #ifdef MARIADB_BASE_VERSION - check_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.check_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - check_time = (time_t) my_system_gmt_sec(&mysql_time, + stat.check_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif } else - check_time = (time_t) 0; + stat.check_time = (time_t) 0; #ifndef DBUG_OFF { struct tm *ts, tmp_ts; char buf[80]; - ts = localtime_r(&check_time, &tmp_ts); + ts = localtime_r(&stat.check_time, &tmp_ts); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts); DBUG_PRINT("info",("spider check_time=%s", buf)); } #endif + if (mysql_row[9]) + { + stat.checksum_null = FALSE; + stat.checksum = + (ha_checksum) my_strtoll10(mysql_row[9], (char**) NULL, &error_num); + DBUG_PRINT("info", ("spider checksum=%lu", (ulong) stat.checksum)); + } else { + stat.checksum_null = TRUE; + stat.checksum = (ha_checksum) 0; + DBUG_PRINT("info", ("spider checksum is null")); + } } DBUG_RETURN(0); } -int spider_db_mbase_result::fetch_table_records( - int mode, - ha_rows &records +int spider_db_mbase_result::fetch_simple_action( + uint simple_action, + uint position, + void *param ) { int error_num; MYSQL_ROW mysql_row; - DBUG_ENTER("spider_db_mbase_result::fetch_table_records"); + DBUG_ENTER("spider_db_mbase_result::fetch_simple_action"); DBUG_PRINT("info",("spider this=%p", this)); if (!(mysql_row = mysql_fetch_row(db_result))) { @@ -1091,32 +1115,78 @@ int spider_db_mbase_result::fetch_table_records( } DBUG_RETURN(ER_QUERY_ON_FOREIGN_DATA_SOURCE); } - if (mode == 1) + if (num_fields() <= position) { - if (mysql_row[0]) - { - records = - (ha_rows) my_strtoll10(mysql_row[0], (char**) NULL, &error_num); - } else - records = (ha_rows) 0; - DBUG_PRINT("info", - ("spider records=%lld", records)); - } else { - if (num_fields() != 10) + DBUG_RETURN(ER_QUERY_ON_FOREIGN_DATA_SOURCE); + } + switch (simple_action) + { + case SPIDER_SIMPLE_RECORDS: { - DBUG_RETURN(ER_QUERY_ON_FOREIGN_DATA_SOURCE); + ha_rows *records = (ha_rows *) param; + if (mysql_row[position]) + { + *records = + (ha_rows) my_strtoll10(mysql_row[position], (char**) NULL, + &error_num); + } else { + *records = (ha_rows) 0; + } + DBUG_PRINT("info", ("spider records=%lld", *records)); + break; } - - if (mysql_row[8]) +#ifdef HA_HAS_CHECKSUM_EXTENDED + case SPIDER_SIMPLE_CHECKSUM_TABLE: { - records = - (ha_rows) my_strtoll10(mysql_row[8], (char**) NULL, &error_num); - } else - records = 0; + ha_spider *spider = (ha_spider *) param; + if (mysql_row[position]) + { + spider->checksum_val = + (ulonglong) my_strtoll10(mysql_row[position], (char**) NULL, + &error_num); + DBUG_PRINT("info", ("spider checksum=%llu", spider->checksum_val)); + spider->checksum_null = FALSE; + } else { + spider->checksum_null = TRUE; + DBUG_PRINT("info", ("spider checksum is null")); + } + break; + } +#endif + default: + DBUG_ASSERT(0); + break; } DBUG_RETURN(0); } +int spider_db_mbase_result::fetch_table_records( + int mode, + ha_rows &records +) { + DBUG_ENTER("spider_db_mbase_result::fetch_table_records"); + DBUG_PRINT("info",("spider this=%p", this)); + if (mode == 1) + { + DBUG_RETURN(fetch_simple_action(SPIDER_SIMPLE_RECORDS, + SPIDER_SQL_SHOW_RECORDS_RECORDS_POS, &records)); + } else { + DBUG_RETURN(fetch_simple_action(SPIDER_SIMPLE_RECORDS, + SPIDER_SQL_EXPLAIN_SELECT_RECORDS_POS, &records)); + } +} + +#ifdef HA_HAS_CHECKSUM_EXTENDED +int spider_db_mbase_result::fetch_table_checksum( + ha_spider *spider +) { + DBUG_ENTER("spider_db_mbase_result::fetch_table_checksum"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(fetch_simple_action(SPIDER_SIMPLE_CHECKSUM_TABLE, + SPIDER_SQL_CHECKSUM_CHECKSUM_POS, spider)); +} +#endif + int spider_db_mbase_result::fetch_table_cardinality( int mode, TABLE *table, @@ -6770,6 +6840,15 @@ int spider_mbase_share::discover_table_structure( } #endif +#ifdef HA_HAS_CHECKSUM_EXTENDED +bool spider_mbase_share::checksum_support() +{ + DBUG_ENTER("spider_mbase_share::checksum_support"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(TRUE); +} +#endif + spider_mbase_handler::spider_mbase_handler( ha_spider *spider, spider_mbase_share *db_share, @@ -12260,16 +12339,9 @@ int spider_mbase_handler::show_table_status( pthread_mutex_unlock(&conn->mta_conn_mutex); error_num = res->fetch_table_status( sts_mode, - share->records, - share->mean_rec_length, - share->data_file_length, - share->max_data_file_length, - share->index_file_length, - auto_increment_value, - share->create_time, - share->update_time, - share->check_time + share->stat ); + auto_increment_value = share->stat.auto_increment_value; res->free_result(); delete res; if (error_num) @@ -12394,16 +12466,9 @@ int spider_mbase_handler::show_table_status( pthread_mutex_unlock(&conn->mta_conn_mutex); error_num = res->fetch_table_status( sts_mode, - share->records, - share->mean_rec_length, - share->data_file_length, - share->max_data_file_length, - share->index_file_length, - auto_increment_value, - share->create_time, - share->update_time, - share->check_time + share->stat ); + auto_increment_value = share->stat.auto_increment_value; res->free_result(); delete res; if (error_num) @@ -12432,11 +12497,11 @@ int spider_mbase_handler::show_table_status( } if (share->static_records_for_status != -1) { - share->records = (ha_rows) share->static_records_for_status; + share->stat.records = (ha_rows) share->static_records_for_status; } if (share->static_mean_rec_length != -1) { - share->mean_rec_length = (ulong) share->static_mean_rec_length; + share->stat.mean_rec_length = (ulong) share->static_mean_rec_length; } if (auto_increment_value > share->lgtm_tblhnd_share->auto_increment_value) { @@ -12740,7 +12805,8 @@ int spider_mbase_handler::show_index( DBUG_RETURN(0); } -int spider_mbase_handler::show_records( +int spider_mbase_handler::simple_action( + uint simple_action, int link_idx ) { int error_num; @@ -12748,7 +12814,49 @@ int spider_mbase_handler::show_records( SPIDER_DB_RESULT *res; SPIDER_SHARE *share = spider->share; uint pos = spider->conn_link_idx[link_idx]; - DBUG_ENTER("spider_mbase_handler::show_records"); + spider_string *str; + DBUG_ENTER("spider_mbase_handler::simple_action"); + switch (simple_action) + { + case SPIDER_SIMPLE_RECORDS: + DBUG_PRINT("info",("spider simple records")); + str = &mysql_share->show_records[pos]; + break; +#ifdef HA_HAS_CHECKSUM_EXTENDED + case SPIDER_SIMPLE_CHECKSUM_TABLE: + DBUG_PRINT("info",("spider simple checksum_table")); + str = &spider->result_list.sqls[link_idx]; + str->length(0); + if (str->reserve( + SPIDER_SQL_CHECKSUM_TABLE_LEN + + mysql_share->db_nm_max_length + + SPIDER_SQL_DOT_LEN + + mysql_share->table_nm_max_length + + /* SPIDER_SQL_NAME_QUOTE_LEN */ 4 + + ((spider->action_flags & T_QUICK) ? SPIDER_SQL_SQL_QUICK_LEN : 0) + + ((spider->action_flags & T_EXTEND) ? SPIDER_SQL_SQL_EXTENDED_LEN : 0) + )) + { + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + str->q_append(SPIDER_SQL_CHECKSUM_TABLE_STR, + SPIDER_SQL_CHECKSUM_TABLE_LEN); + mysql_share->append_table_name(str, pos); + if (spider->action_flags & T_QUICK) + { + str->q_append(SPIDER_SQL_SQL_QUICK_STR, SPIDER_SQL_SQL_QUICK_LEN); + } + if (spider->action_flags & T_EXTEND) + { + str->q_append(SPIDER_SQL_SQL_EXTENDED_STR, + SPIDER_SQL_SQL_EXTENDED_LEN); + } + break; +#endif + default: + DBUG_ASSERT(0); + break; + } pthread_mutex_lock(&conn->mta_conn_mutex); SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); conn->need_mon = &spider->need_mons[link_idx]; @@ -12761,8 +12869,8 @@ int spider_mbase_handler::show_records( ( spider_db_query( conn, - mysql_share->show_records[pos].ptr(), - mysql_share->show_records[pos].length(), + str->ptr(), + str->length(), -1, &spider->need_mons[link_idx]) && (error_num = spider_db_errorno(conn)) @@ -12795,8 +12903,8 @@ int spider_mbase_handler::show_records( share); if (spider_db_query( conn, - mysql_share->show_records[pos].ptr(), - mysql_share->show_records[pos].length(), + str->ptr(), + str->length(), -1, &spider->need_mons[link_idx]) ) { @@ -12838,10 +12946,22 @@ int spider_mbase_handler::show_records( conn->mta_conn_mutex_unlock_later = FALSE; SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); pthread_mutex_unlock(&conn->mta_conn_mutex); - error_num = res->fetch_table_records( - 1, - spider->table_rows - ); + switch (simple_action) + { + case SPIDER_SIMPLE_RECORDS: + DBUG_PRINT("info",("spider simple records")); + error_num = res->fetch_table_records(1, spider->table_rows); + break; +#ifdef HA_HAS_CHECKSUM_EXTENDED + case SPIDER_SIMPLE_CHECKSUM_TABLE: + DBUG_PRINT("info",("spider simple checksum_table")); + error_num = res->fetch_table_checksum(spider); + break; +#endif + default: + DBUG_ASSERT(0); + break; + } res->free_result(); delete res; if (error_num) @@ -12849,10 +12969,34 @@ int spider_mbase_handler::show_records( DBUG_PRINT("info", ("spider error_num=%d 7", error_num)); DBUG_RETURN(error_num); } + DBUG_RETURN(0); +} + +int spider_mbase_handler::show_records( + int link_idx +) { + int error_num; + DBUG_ENTER("spider_mbase_handler::show_records"); + error_num = simple_action(SPIDER_SIMPLE_RECORDS, link_idx); + if (error_num) + { + DBUG_PRINT("info", ("spider error_num=%d", error_num)); + DBUG_RETURN(error_num); + } spider->trx->direct_aggregate_count++; DBUG_RETURN(0); } +#ifdef HA_HAS_CHECKSUM_EXTENDED +int spider_mbase_handler::checksum_table( + int link_idx +) { + DBUG_ENTER("spider_mbase_handler::checksum_table"); + DBUG_RETURN(simple_action(SPIDER_SIMPLE_CHECKSUM_TABLE, link_idx)); + DBUG_RETURN(0); +} +#endif + int spider_mbase_handler::show_last_insert_id( int link_idx, ulonglong &last_insert_id diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index ff7ebc32bd9..49780e0fa7f 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -271,20 +271,22 @@ public: ); int fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat + ); + int fetch_simple_action( + uint simple_action, + uint position, + void *param ); int fetch_table_records( int mode, ha_rows &records ); +#ifdef HA_HAS_CHECKSUM_EXTENDED + int fetch_table_checksum( + ha_spider *spider + ); +#endif int fetch_table_cardinality( int mode, TABLE *table, @@ -669,6 +671,9 @@ public: spider_string *str ); #endif +#ifdef HA_HAS_CHECKSUM_EXTENDED + bool checksum_support(); +#endif protected: int create_table_names_str(); void free_table_names_str(); @@ -1448,9 +1453,18 @@ public: int link_idx, int crd_mode ); + int simple_action( + uint simple_action, + int link_idx + ); int show_records( int link_idx ); +#ifdef HA_HAS_CHECKSUM_EXTENDED + int checksum_table( + int link_idx + ); +#endif int show_last_insert_id( int link_idx, ulonglong &last_insert_id diff --git a/storage/spider/spd_db_oracle.cc b/storage/spider/spd_db_oracle.cc index 1478f04d0f8..773c6b90ed9 100644 --- a/storage/spider/spd_db_oracle.cc +++ b/storage/spider/spd_db_oracle.cc @@ -927,30 +927,22 @@ SPIDER_DB_ROW *spider_db_oracle_result::fetch_row_from_tmp_table( int spider_db_oracle_result::fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat ) { DBUG_ENTER("spider_db_oracle_result::fetch_table_status"); DBUG_PRINT("info",("spider this=%p", this)); /* TODO: develop later */ - records = 2; - mean_rec_length = 65535; - data_file_length = 65535; - max_data_file_length = 65535; - index_file_length = 65535; + stat.records = 2; + stat.mean_rec_length = 65535; + stat.data_file_length = 65535; + stat.max_data_file_length = 65535; + stat.index_file_length = 65535; /* auto_increment_value = 0; */ - create_time = (time_t) 0; - update_time = (time_t) 0; - check_time = (time_t) 0; + stat.create_time = (time_t) 0; + stat.update_time = (time_t) 0; + stat.check_time = (time_t) 0; DBUG_RETURN(0); } @@ -1349,7 +1341,7 @@ int spider_db_oracle::connect( this->connect_retry_interval = connect_retry_interval; if ((error_num = spider_create_conn_thread(conn))) DBUG_RETURN(error_num); - spider_bg_conn_simple_action(conn, SPIDER_BG_SIMPLE_CONNECT, TRUE, NULL, + spider_bg_conn_simple_action(conn, SPIDER_SIMPLE_CONNECT, TRUE, NULL, 0, NULL); if (stored_error_num) @@ -1440,7 +1432,7 @@ void spider_db_oracle::disconnect() DBUG_PRINT("info",("spider this=%p", this)); if (!conn->bg_init) DBUG_VOID_RETURN; - spider_bg_conn_simple_action(conn, SPIDER_BG_SIMPLE_DISCONNECT, TRUE, NULL, + spider_bg_conn_simple_action(conn, SPIDER_SIMPLE_DISCONNECT, TRUE, NULL, 0, NULL); DBUG_VOID_RETURN; } @@ -11143,15 +11135,15 @@ int spider_oracle_handler::show_table_status( if (error_num) DBUG_RETURN(error_num); */ - if (!share->records) - share->records = 10000; - share->mean_rec_length = 65535; - share->data_file_length = 65535; - share->max_data_file_length = 65535; - share->index_file_length = 65535; - share->create_time = (time_t) 0; - share->update_time = (time_t) 0; - share->check_time = (time_t) 0; + if (!share->stat.records) + share->stat.records = 10000; + share->stat.mean_rec_length = 65535; + share->stat.data_file_length = 65535; + share->stat.max_data_file_length = 65535; + share->stat.index_file_length = 65535; + share->stat.create_time = (time_t) 0; + share->stat.update_time = (time_t) 0; + share->stat.check_time = (time_t) 0; } else { pthread_mutex_lock(&conn->mta_conn_mutex); SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); @@ -11235,16 +11227,9 @@ int spider_oracle_handler::show_table_status( pthread_mutex_unlock(&conn->mta_conn_mutex); error_num = res->fetch_table_status( sts_mode, - share->records, - share->mean_rec_length, - share->data_file_length, - share->max_data_file_length, - share->index_file_length, - auto_increment_value, - share->create_time, - share->update_time, - share->check_time + share->stat ); + auto_increment_value = share->stat.auto_increment_value; res->free_result(); delete res; if (error_num) diff --git a/storage/spider/spd_db_oracle.h b/storage/spider/spd_db_oracle.h index e7e5507668d..e3f787c514e 100644 --- a/storage/spider/spd_db_oracle.h +++ b/storage/spider/spd_db_oracle.h @@ -239,15 +239,7 @@ public: ); int fetch_table_status( int mode, - ha_rows &records, - ulong &mean_rec_length, - ulonglong &data_file_length, - ulonglong &max_data_file_length, - ulonglong &index_file_length, - ulonglong &auto_increment_value, - time_t &create_time, - time_t &update_time, - time_t &check_time + ha_statistics &stat ); int fetch_table_records( int mode, diff --git a/storage/spider/spd_environ.h b/storage/spider/spd_environ.h index 42cbf812bbb..728cc7e1781 100644 --- a/storage/spider/spd_environ.h +++ b/storage/spider/spd_environ.h @@ -51,5 +51,6 @@ #define SPIDER_USE_CONST_ITEM_FOR_STRING_INT_REAL_DECIMAL_DATE_ITEM #define SPIDER_SQL_CACHE_IS_IN_LEX #define SPIDER_LIKE_FUNC_HAS_GET_NEGATED +#define HA_HAS_CHECKSUM_EXTENDED #endif #endif /* SPD_ENVIRON_INCLUDED */ diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h index 2886ea02ba4..df0ed93935d 100644 --- a/storage/spider/spd_include.h +++ b/storage/spider/spd_include.h @@ -13,7 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#define SPIDER_DETAIL_VERSION "3.3.14" +#define SPIDER_DETAIL_VERSION "3.3.15" #define SPIDER_HEX_VERSION 0x0303 #if MYSQL_VERSION_ID < 50500 @@ -655,15 +655,7 @@ typedef struct st_spider_patition_share volatile bool crd_init; volatile time_t sts_get_time; volatile time_t crd_get_time; - ulonglong data_file_length; - ulonglong max_data_file_length; - ulonglong index_file_length; - ulonglong auto_increment_value; - ha_rows records; - ulong mean_rec_length; - time_t check_time; - time_t create_time; - time_t update_time; + ha_statistics stat; longlong *cardinality; /* @@ -890,17 +882,7 @@ typedef struct st_spider_share volatile bool auto_increment_init; volatile ulonglong auto_increment_lclval; */ - ulonglong data_file_length; - ulonglong max_data_file_length; - ulonglong index_file_length; -/* - ulonglong auto_increment_value; -*/ - ha_rows records; - ulong mean_rec_length; - time_t check_time; - time_t create_time; - time_t update_time; + ha_statistics stat; longlong static_records_for_status; longlong static_mean_rec_length; diff --git a/storage/spider/spd_malloc.cc b/storage/spider/spd_malloc.cc index b2bb094a38e..40b37ff4377 100644 --- a/storage/spider/spd_malloc.cc +++ b/storage/spider/spd_malloc.cc @@ -1,4 +1,5 @@ -/* Copyright (C) 2012-2017 Kentoku Shiba +/* Copyright (C) 2012-2019 Kentoku Shiba + Copyright (C) 2019 MariaDB corp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1126,6 +1127,7 @@ void spider_string::q_append( ) { DBUG_ENTER("spider_string::q_append"); DBUG_PRINT("info",("spider this=%p", this)); + DBUG_ASSERT(str.alloced_length() >= str.length() + data_len); str.q_append(data, data_len); DBUG_VOID_RETURN; } diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc index a148b5cd55b..07cd6bf1695 100644 --- a/storage/spider/spd_sys_table.cc +++ b/storage/spider/spd_sys_table.cc @@ -1240,28 +1240,29 @@ void spider_store_binlog_pos_gtid( void spider_store_table_sts_info( TABLE *table, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time + ha_statistics *stat ) { MYSQL_TIME mysql_time; DBUG_ENTER("spider_store_table_sts_info"); - table->field[2]->store((longlong) *data_file_length, TRUE); - table->field[3]->store((longlong) *max_data_file_length, TRUE); - table->field[4]->store((longlong) *index_file_length, TRUE); - table->field[5]->store((longlong) *records, TRUE); - table->field[6]->store((longlong) *mean_rec_length, TRUE); - spd_tz_system->gmt_sec_to_TIME(&mysql_time, (my_time_t) *check_time); + table->field[2]->store((longlong) stat->data_file_length, TRUE); + table->field[3]->store((longlong) stat->max_data_file_length, TRUE); + table->field[4]->store((longlong) stat->index_file_length, TRUE); + table->field[5]->store((longlong) stat->records, TRUE); + table->field[6]->store((longlong) stat->mean_rec_length, TRUE); + spd_tz_system->gmt_sec_to_TIME(&mysql_time, (my_time_t) stat->check_time); table->field[7]->store_time(&mysql_time); - spd_tz_system->gmt_sec_to_TIME(&mysql_time, (my_time_t) *create_time); + spd_tz_system->gmt_sec_to_TIME(&mysql_time, (my_time_t) stat->create_time); table->field[8]->store_time(&mysql_time); - spd_tz_system->gmt_sec_to_TIME(&mysql_time, (my_time_t) *update_time); + spd_tz_system->gmt_sec_to_TIME(&mysql_time, (my_time_t) stat->update_time); table->field[9]->store_time(&mysql_time); + if (stat->checksum_null) + { + table->field[10]->set_null(); + table->field[10]->reset(); + } else { + table->field[10]->set_notnull(); + table->field[10]->store((longlong) stat->checksum, TRUE); + } DBUG_VOID_RETURN; } @@ -1386,14 +1387,7 @@ int spider_insert_or_update_table_sts( TABLE *table, const char *name, uint name_length, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time + ha_statistics *stat ) { int error_num; char table_key[MAX_KEY_LENGTH]; @@ -1402,14 +1396,7 @@ int spider_insert_or_update_table_sts( spider_store_tables_name(table, name, name_length); spider_store_table_sts_info( table, - data_file_length, - max_data_file_length, - index_file_length, - records, - mean_rec_length, - check_time, - create_time, - update_time + stat ); if ((error_num = spider_check_sys_table_for_update_all_columns(table, table_key))) @@ -2442,14 +2429,7 @@ int spider_get_sys_tables_static_link_id( void spider_get_sys_table_sts_info( TABLE *table, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time + ha_statistics *stat ) { MYSQL_TIME mysql_time; #ifdef MARIADB_BASE_VERSION @@ -2459,35 +2439,43 @@ void spider_get_sys_table_sts_info( #endif long not_used_long; DBUG_ENTER("spider_get_sys_table_sts_info"); - *data_file_length = (ulonglong) table->field[2]->val_int(); - *max_data_file_length = (ulonglong) table->field[3]->val_int(); - *index_file_length = (ulonglong) table->field[4]->val_int(); - *records = (ha_rows) table->field[5]->val_int(); - *mean_rec_length = (ulong) table->field[6]->val_int(); + stat->data_file_length = (ulonglong) table->field[2]->val_int(); + stat->max_data_file_length = (ulonglong) table->field[3]->val_int(); + stat->index_file_length = (ulonglong) table->field[4]->val_int(); + stat->records = (ha_rows) table->field[5]->val_int(); + stat->mean_rec_length = (ulong) table->field[6]->val_int(); table->field[7]->get_date(&mysql_time, SPIDER_date_mode_t(0)); #ifdef MARIADB_BASE_VERSION - *check_time = (time_t) my_system_gmt_sec(&mysql_time, + stat->check_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - *check_time = (time_t) my_system_gmt_sec(&mysql_time, + stat->check_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif table->field[8]->get_date(&mysql_time, SPIDER_date_mode_t(0)); #ifdef MARIADB_BASE_VERSION - *create_time = (time_t) my_system_gmt_sec(&mysql_time, + stat->create_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - *create_time = (time_t) my_system_gmt_sec(&mysql_time, + stat->create_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif table->field[9]->get_date(&mysql_time, SPIDER_date_mode_t(0)); #ifdef MARIADB_BASE_VERSION - *update_time = (time_t) my_system_gmt_sec(&mysql_time, + stat->update_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_uint); #else - *update_time = (time_t) my_system_gmt_sec(&mysql_time, + stat->update_time = (time_t) my_system_gmt_sec(&mysql_time, ¬_used_long, ¬_used_my_bool); #endif + if (table->field[10]->is_null()) + { + stat->checksum_null = TRUE; + stat->checksum = 0; + } else { + stat->checksum_null = FALSE; + stat->checksum = (ha_checksum) table->field[10]->val_int(); + } DBUG_VOID_RETURN; } @@ -2908,14 +2896,7 @@ int spider_sys_insert_or_update_table_sts( THD *thd, const char *name, uint name_length, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time, + ha_statistics *stat, bool need_lock ) { int error_num; @@ -2938,14 +2919,7 @@ int spider_sys_insert_or_update_table_sts( table_sts, name, name_length, - data_file_length, - max_data_file_length, - index_file_length, - records, - mean_rec_length, - check_time, - create_time, - update_time + stat ))) goto error; spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); @@ -3080,14 +3054,7 @@ int spider_sys_get_table_sts( THD *thd, const char *name, uint name_length, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time, + ha_statistics *stat, bool need_lock ) { int error_num; @@ -3120,14 +3087,7 @@ int spider_sys_get_table_sts( } else { spider_get_sys_table_sts_info( table_sts, - data_file_length, - max_data_file_length, - index_file_length, - records, - mean_rec_length, - check_time, - create_time, - update_time + stat ); } diff --git a/storage/spider/spd_sys_table.h b/storage/spider/spd_sys_table.h index 9e2d54c3e28..7a28ea20010 100644 --- a/storage/spider/spd_sys_table.h +++ b/storage/spider/spd_sys_table.h @@ -289,14 +289,7 @@ void spider_store_binlog_pos_gtid( void spider_store_table_sts_info( TABLE *table, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time + ha_statistics *stat ); void spider_store_table_crd_info( @@ -330,14 +323,7 @@ int spider_insert_or_update_table_sts( TABLE *table, const char *name, uint name_length, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time + ha_statistics *stat ); int spider_insert_or_update_table_crd( @@ -493,14 +479,7 @@ int spider_get_sys_tables_static_link_id( void spider_get_sys_table_sts_info( TABLE *table, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time + ha_statistics *stat ); void spider_get_sys_table_crd_info( @@ -564,14 +543,7 @@ int spider_sys_insert_or_update_table_sts( THD *thd, const char *name, uint name_length, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time, + ha_statistics *stat, bool need_lock ); @@ -602,14 +574,7 @@ int spider_sys_get_table_sts( THD *thd, const char *name, uint name_length, - ulonglong *data_file_length, - ulonglong *max_data_file_length, - ulonglong *index_file_length, - ha_rows *records, - ulong *mean_rec_length, - time_t *check_time, - time_t *create_time, - time_t *update_time, + ha_statistics *stat, bool need_lock ); diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 97c42189736..ad3d10dc642 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -4378,6 +4378,9 @@ SPIDER_SHARE *spider_create_share( uchar *tmp_cardinality_upd, *tmp_table_mon_mutex_bitmap; char buf[MAX_FIELD_WIDTH], *buf_pos; char link_idx_str[SPIDER_SQL_INT_LEN]; +#ifdef HA_HAS_CHECKSUM_EXTENDED + bool checksum_support = TRUE; +#endif DBUG_ENTER("spider_create_share"); length = (uint) strlen(table_name); bitmap_size = spider_bitmap_size(table_share->fields); @@ -4536,8 +4539,24 @@ SPIDER_SHARE *spider_create_share( { goto error_init_dbton; } +#ifdef HA_HAS_CHECKSUM_EXTENDED + if ( + spider_dbton[roop_count].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL && + !share->dbton_share[roop_count]->checksum_support() + ) { + checksum_support = FALSE; + } +#endif } } +#ifdef HA_HAS_CHECKSUM_EXTENDED + if (checksum_support) + { + share->additional_table_flags |= + HA_HAS_OLD_CHECKSUM | + HA_HAS_NEW_CHECKSUM; + } +#endif DBUG_RETURN(share); /* @@ -5780,14 +5799,7 @@ int spider_free_share( thd, share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, - &share->data_file_length, - &share->max_data_file_length, - &share->index_file_length, - &share->records, - &share->mean_rec_length, - &share->check_time, - &share->create_time, - &share->update_time, + &share->stat, FALSE ); } @@ -6163,21 +6175,7 @@ void spider_copy_sts_to_pt_share( SPIDER_SHARE *share ) { DBUG_ENTER("spider_copy_sts_to_pt_share"); - memcpy(&partition_share->data_file_length, &share->data_file_length, - sizeof(ulonglong) * 4 + sizeof(ha_rows) + - sizeof(ulong) + sizeof(time_t) * 3); -/* - partition_share->data_file_length = share->data_file_length; - partition_share->max_data_file_length = share->max_data_file_length; - partition_share->index_file_length = share->index_file_length; - partition_share->auto_increment_value = - share->lgtm_tblhnd_share->auto_increment_value; - partition_share->records = share->records; - partition_share->mean_rec_length = share->mean_rec_length; - partition_share->check_time = share->check_time; - partition_share->create_time = share->create_time; - partition_share->update_time = share->update_time; -*/ + partition_share->stat = share->stat; DBUG_VOID_RETURN; } @@ -6186,23 +6184,7 @@ void spider_copy_sts_to_share( SPIDER_PARTITION_SHARE *partition_share ) { DBUG_ENTER("spider_copy_sts_to_share"); - memcpy(&share->data_file_length, &partition_share->data_file_length, - sizeof(ulonglong) * 4 + sizeof(ha_rows) + - sizeof(ulong) + sizeof(time_t) * 3); -/* - share->data_file_length = partition_share->data_file_length; - share->max_data_file_length = partition_share->max_data_file_length; - share->index_file_length = partition_share->index_file_length; - share->lgtm_tblhnd_share->auto_increment_value = - partition_share->auto_increment_value; - DBUG_PRINT("info",("spider auto_increment_value=%llu", - share->lgtm_tblhnd_share->auto_increment_value)); - share->records = partition_share->records; - share->mean_rec_length = partition_share->mean_rec_length; - share->check_time = partition_share->check_time; - share->create_time = partition_share->create_time; - share->update_time = partition_share->update_time; -*/ + share->stat = partition_share->stat; DBUG_VOID_RETURN; } @@ -7693,10 +7675,8 @@ int spider_get_sts( if ( sts_sync == 0 ) { -#endif /* get */ get_type = 1; -#ifdef WITH_PARTITION_STORAGE_ENGINE } else if ( !share->partition_share->sts_init ) { @@ -7735,14 +7715,7 @@ int spider_get_sts( current_thd, share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, - &share->data_file_length, - &share->max_data_file_length, - &share->index_file_length, - &share->records, - &share->mean_rec_length, - &share->check_time, - &share->create_time, - &share->update_time, + &share->stat, FALSE ); if ( @@ -7850,10 +7823,8 @@ int spider_get_crd( if ( crd_sync == 0 ) { -#endif /* get */ get_type = 1; -#ifdef WITH_PARTITION_STORAGE_ENGINE } else if ( !share->partition_share->crd_init ) { @@ -9367,7 +9338,9 @@ int spider_discover_table_structure( str.q_append(share->table_name.str, share->table_name.length); str.q_append(SPIDER_SQL_LCL_NAME_QUOTE_STR, SPIDER_SQL_LCL_NAME_QUOTE_LEN); str.q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); +#ifdef WITH_PARTITION_STORAGE_ENGINE str_len = str.length(); +#endif #ifdef SPIDER_HAS_HASH_VALUE_TYPE my_hash_value_type hash_value = my_calc_hash(&spider_open_tables, (uchar*) table_name, table_name_length); -- cgit v1.2.1 From 40ff8019d2a00071f533bb3210b4d3a552e95bc8 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 7 Jun 2019 11:41:18 +0200 Subject: MDEV-19709 Bitmap<128>::merge etc may crash on older GCC versions Older GCC generates SSE instruction on not-128-bit-aligned data in Bitmap<128>::buffer Workaround by forcing GCC not to use SSE on Bitmap template. --- sql/sql_bitmap.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 93c5056a8fb..4f1acb60161 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -27,6 +27,18 @@ #include #include +/* + Workaround GCC optimizer bug (generating SSE instuctions on unaligned data) +*/ +#if defined (__GNUC__) && defined(__x86_64__) && (__GNUC__ < 6) +#define NEED_GCC_NO_SSE_WORKAROUND +#endif + +#ifdef NEED_GCC_NO_SSE_WORKAROUND +#pragma GCC push_options +#pragma GCC target ("no-sse") +#endif + template class Bitmap { uint32 buffer[(width + 31) / 32]; @@ -266,6 +278,11 @@ public: }; }; +#ifdef NEED_GCC_NO_SSE_WORKAROUND +#pragma GCC pop_options +#undef NEED_GCC_NO_SSE_WORKAROUND +#endif + /* An iterator to quickly walk over bits in ulonglong bitmap. */ class Table_map_iterator { -- cgit v1.2.1 From a0cb7551a4467fbce74f3ced78549bf92866c11f Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 10 Jun 2019 15:56:36 +0530 Subject: MDEV-18880: Optimizer trace prints date in hexadecimal Introduced a print_key_value function to makes sure that the trace prints data in readable format for readable characters and the rest of the characters are printed as hexadecimal. --- mysql-test/main/opt_trace.result | 298 +++++++++++++++++++++++++++++++++- mysql-test/main/opt_trace.test | 54 ++++++ mysql-test/main/opt_trace_ucs2.result | 54 ++++++ mysql-test/main/opt_trace_ucs2.test | 10 ++ sql/field.cc | 55 +++++++ sql/field.h | 14 ++ sql/opt_range.cc | 32 +--- sql/sql_string.cc | 12 ++ sql/sql_string.h | 3 + 9 files changed, 501 insertions(+), 31 deletions(-) create mode 100644 mysql-test/main/opt_trace_ucs2.result create mode 100644 mysql-test/main/opt_trace_ucs2.test diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 3e4b7fe6e8a..82a2196545d 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -1446,7 +1446,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { { "index": "id", "covering": true, - "ranges": ["(0x24a20f) <= (a)"], + "ranges": ["(2001-01-04) <= (a)"], "rows": 9, "cost": 2.35 } @@ -1462,7 +1462,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { "rows": 9, "cost": 2.35, "key_parts_used_for_access": ["id"], - "ranges": ["(0x24a20f) <= (a)"], + "ranges": ["(2001-01-04) <= (a)"], "chosen": false, "cause": "cost" }, @@ -1624,7 +1624,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { { "index": "id", "covering": true, - "ranges": ["(0x24a20f) <= (a) <= (0x24a20f)"], + "ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"], "rows": 9, "cost": 2.35 } @@ -1640,7 +1640,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { "rows": 9, "cost": 2.35, "key_parts_used_for_access": ["id", "a"], - "ranges": ["(0x24a20f) <= (a) <= (0x24a20f)"], + "ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"], "chosen": false, "cause": "cost" }, @@ -6130,7 +6130,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "index": "start_date", "ranges": [ - "(0x4ac60f,NULL) < (start_date,end_date)" + "(2019-02-10,NULL) < (start_date,end_date)" ], "rowid_ordered": false, "using_mrr": false, @@ -6214,7 +6214,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "index": "i_b", "ranges": [ - "(0xd95b94336a9946a39cf5b58cfe772d8c) <= (b) <= (0xd95b94336a9946a39cf5b58cfe772d8c)" + "(\xD9[\x943j\x99F\xA3\x9C\xF5\xB5\x8C\xFEw-\x8C) <= (b) <= (\xD9[\x943j\x99F\xA3\x9C\xF5\xB5\x8C\xFEw-\x8C)" ], "rowid_ordered": true, "using_mrr": false, @@ -6268,4 +6268,290 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) } ] drop table t1; +# +# MDEV-18880: Optimizer trace prints date in hexadecimal +# +CREATE TABLE t1(i INT PRIMARY KEY, b VARCHAR(10) CHARSET BINARY , INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, NULL); +set optimizer_trace=1; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i_b i_b 13 const 1 Using index condition +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "i_b", + "ranges": + [ + "(ab\x0A) <= (b) <= (ab\x0A)" + ], + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.3787, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +ALTER TABLE t1 modify column b BINARY(10) AFTER i; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i_b i_b 11 const 1 Using index condition +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "i_b", + "ranges": + [ + "(ab\x0A\x00\x00\x00\x00\x00\x00\x00) <= (b) <= (ab\x0A\x00\x00\x00\x00\x00\x00\x00)" + ], + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.3785, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +ALTER TABLE t1 modify column b VARBINARY(10) AFTER i; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i_b i_b 13 const 1 Using index condition +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "i_b", + "ranges": + [ + "(ab\x0A) <= (b) <= (ab\x0A)" + ], + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.3787, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +drop table t1; +CREATE TABLE t1(i INT PRIMARY KEY, b CHAR(10), INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, NULL); +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i_b i_b 11 const 1 Using index condition +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "i_b", + "ranges": + [ + "(ab\n) <= (b) <= (ab\n)" + ], + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 2.3785, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +drop table t1; +CREATE TABLE t1(i INT PRIMARY KEY, b blob , INDEX i_b(b)); +Warnings: +Note 1071 Specified key was too long; max key length is 1000 bytes +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, NULL); +set optimizer_trace=1; +EXPLAIN SELECT * FROM t1 WHERE b= 'ab\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i_b i_b 1003 const 1 Using where +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "i_b", + "ranges": + [ + "(ab\x0A) <= (b) <= (ab\x0A)" + ], + "rowid_ordered": false, + "using_mrr": false, + "index_only": false, + "rows": 1, + "cost": 3.5719, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +drop table t1; +CREATE TABLE t1(i INT PRIMARY KEY, b VARCHAR(10), INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, 'ab\n'); +set optimizer_trace=1; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref i_b i_b 13 const 2 Using index condition +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "i_b", + "ranges": + [ + "(ab\n) <= (b) <= (ab\n)" + ], + "rowid_ordered": true, + "using_mrr": false, + "index_only": false, + "rows": 2, + "cost": 3.6324, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +drop table t1; +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table one_k (a int); +insert into one_k select A.a + B.a*10 + C.a*100 from t0 A, t0 B, t0 C; +create table t1 (start_date date, end_date date, filler char(100), key(start_date, end_date)) ; +insert into t1 select date_add(now(), interval a day), date_add(now(), interval (a+7) day), 'data' from one_k; +explain format=json select * from t1 force index(start_date) where start_date >= '2019-02-10' and end_date <'2019-04-01'; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "range", + "possible_keys": ["start_date"], + "key": "start_date", + "key_length": "8", + "used_key_parts": ["start_date", "end_date"], + "rows": 1000, + "filtered": 100, + "index_condition": "t1.start_date >= '2019-02-10' and t1.end_date < '2019-04-01'" + } + } +} +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "start_date", + "ranges": + [ + "(2019-02-10,NULL) < (start_date,end_date)" + ], + "rowid_ordered": false, + "using_mrr": false, + "index_only": false, + "rows": 1000, + "cost": 1282.2, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +drop table t1, t0, one_k; set optimizer_trace='enabled=off'; diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 981a53ac1ad..916b9313ca6 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -444,4 +444,58 @@ select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) fr drop table t1; +--echo # +--echo # MDEV-18880: Optimizer trace prints date in hexadecimal +--echo # + +CREATE TABLE t1(i INT PRIMARY KEY, b VARCHAR(10) CHARSET BINARY , INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, NULL); +set optimizer_trace=1; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +ALTER TABLE t1 modify column b BINARY(10) AFTER i; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; + +ALTER TABLE t1 modify column b VARBINARY(10) AFTER i; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +drop table t1; + +CREATE TABLE t1(i INT PRIMARY KEY, b CHAR(10), INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, NULL); +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +drop table t1; + +CREATE TABLE t1(i INT PRIMARY KEY, b blob , INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, NULL); +set optimizer_trace=1; +EXPLAIN SELECT * FROM t1 WHERE b= 'ab\n'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +drop table t1; + +CREATE TABLE t1(i INT PRIMARY KEY, b VARCHAR(10), INDEX i_b(b)); +INSERT INTO t1 VALUES (1, 'ab\n'); +INSERT INTO t1 VALUES (2, 'ab\n'); +set optimizer_trace=1; +EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +drop table t1; +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table one_k (a int); +insert into one_k select A.a + B.a*10 + C.a*100 from t0 A, t0 B, t0 C; +create table t1 (start_date date, end_date date, filler char(100), key(start_date, end_date)) ; +--disable_warnings +insert into t1 select date_add(now(), interval a day), date_add(now(), interval (a+7) day), 'data' from one_k; +--enable_warnings +explain format=json select * from t1 force index(start_date) where start_date >= '2019-02-10' and end_date <'2019-04-01'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +drop table t1, t0, one_k; + set optimizer_trace='enabled=off'; diff --git a/mysql-test/main/opt_trace_ucs2.result b/mysql-test/main/opt_trace_ucs2.result new file mode 100644 index 00000000000..306fdbf94ad --- /dev/null +++ b/mysql-test/main/opt_trace_ucs2.result @@ -0,0 +1,54 @@ +create or replace table t1 (col1 char(10) character set ucs2, filler char(100), key(col1)) ; +insert into t1 values ('a', 'a'); +insert into t1 values ('a', 'a'); +set optimizer_trace=1; +explain format=json select * from t1 force index(col1) where col1 >='a'; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "t1", + "access_type": "range", + "possible_keys": ["col1"], + "key": "col1", + "key_length": "21", + "used_key_parts": ["col1"], + "rows": 2, + "filtered": 100, + "index_condition": "t1.col1 >= 'a'" + } + } +} +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) +[ + + { + "range_scan_alternatives": + [ + + { + "index": "col1", + "ranges": + [ + "(a) <= (col1)" + ], + "rowid_ordered": false, + "using_mrr": false, + "index_only": false, + "rows": 2, + "cost": 3.7609, + "chosen": true + } + ], + "analyzing_roworder_intersect": + { + "cause": "too few roworder scans" + }, + "analyzing_index_merge_union": + [ + ] + } +] +drop table t1; diff --git a/mysql-test/main/opt_trace_ucs2.test b/mysql-test/main/opt_trace_ucs2.test new file mode 100644 index 00000000000..827dc403d58 --- /dev/null +++ b/mysql-test/main/opt_trace_ucs2.test @@ -0,0 +1,10 @@ +--source include/not_embedded.inc +--source include/have_ucs2.inc + +create or replace table t1 (col1 char(10) character set ucs2, filler char(100), key(col1)) ; +insert into t1 values ('a', 'a'); +insert into t1 values ('a', 'a'); +set optimizer_trace=1; +explain format=json select * from t1 force index(col1) where col1 >='a'; +select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index a671195ba2b..46e33dc8526 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -11242,3 +11242,58 @@ bool Field::val_str_nopad(MEM_ROOT *mem_root, LEX_CSTRING *to) thd->variables.sql_mode= sql_mode_backup; return rc; } + + +void Field::print_key_value(String *out, uint32 length) +{ + if (charset() == &my_charset_bin) + print_key_value_binary(out, ptr, length); + else + val_str(out); +} + + +void Field_string::print_key_value(String *out, uint32 length) +{ + if (charset() == &my_charset_bin) + { + size_t len= field_charset->cset->lengthsp(field_charset, (const char*) ptr, length); + print_key_value_binary(out, ptr, static_cast(len)); + } + else + { + THD *thd= get_thd(); + sql_mode_t sql_mode_backup= thd->variables.sql_mode; + thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH; + val_str(out,out); + thd->variables.sql_mode= sql_mode_backup; + } +} + + +void Field_varstring::print_key_value(String *out, uint32 length) +{ + if (charset() == &my_charset_bin) + print_key_value_binary(out, get_data(), get_length()); + else + val_str(out,out); +} + + +void Field_blob::print_key_value(String *out, uint32 length) +{ + if (charset() == &my_charset_bin) + { + uchar *blob; + memcpy(&blob, ptr+packlength, sizeof(uchar*)); + print_key_value_binary(out, blob, get_length()); + } + else + val_str(out, out); +} + + +void Field::print_key_value_binary(String *out, const uchar* key, uint32 length) +{ + out->append_semi_hex((const char*)key, length, charset()); +} \ No newline at end of file diff --git a/sql/field.h b/sql/field.h index ceb4a8bb93f..8b65f2e95e4 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1383,6 +1383,8 @@ public: virtual int set_time() { return 1; } bool set_warning(Sql_condition::enum_warning_level, unsigned int code, int cuted_increment, ulong current_row=0) const; + virtual void print_key_value(String *out, uint32 length); + void print_key_value_binary(String *out, const uchar* key, uint32 length); protected: bool set_warning(unsigned int code, int cuted_increment) const { @@ -3592,6 +3594,7 @@ public: { return charset() == &my_charset_bin ? FALSE : TRUE; } Field *make_new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type); virtual uint get_key_image(uchar *buff,uint length, imagetype type); + void print_key_value(String *out, uint32 length); private: int save_field_metadata(uchar *first_byte); }; @@ -3697,6 +3700,7 @@ public: uint is_equal(Create_field *new_field); void hash(ulong *nr, ulong *nr2); uint length_size() { return length_bytes; } + void print_key_value(String *out, uint32 length); private: int save_field_metadata(uchar *first_byte); }; @@ -4035,6 +4039,7 @@ public: uint32 char_length() const; uint32 character_octet_length() const; uint is_equal(Create_field *new_field); + void print_key_value(String *out, uint32 length); friend void TABLE::remember_blob_values(String *blob_storage); friend void TABLE::restore_blob_values(String *blob_storage); @@ -4159,6 +4164,10 @@ public: geometry_type get_geometry_type() { return geom_type; }; static geometry_type geometry_type_merge(geometry_type, geometry_type); uint get_srid() { return srid; } + void print_key_value(String *out, uint32 length) + { + out->append(STRING_WITH_LEN("unprintable_geometry_value")); + } }; uint gis_field_options_image(uchar *buff, List &create_fields); @@ -4466,6 +4475,11 @@ public: { return get_mm_leaf_int(param, key_part, cond, op, value, true); } + void print_key_value(String *out, uint32 length) + { + val_int_as_str(out, 1); + } + private: virtual size_t do_last_null_byte() const; int save_field_metadata(uchar *first_byte); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index bff5bd371b6..d0c4ed2ffbc 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -15835,12 +15835,10 @@ static void print_key_value(String *out, const KEY_PART_INFO *key_part, { // Byte 0 of a nullable key is the null-byte. If set, key is NULL. if (field->real_maybe_null() && *key) + { out->append(STRING_WITH_LEN("NULL")); - else - (field->type() == MYSQL_TYPE_GEOMETRY) - ? out->append(STRING_WITH_LEN("unprintable_geometry_value")) - : out->append(STRING_WITH_LEN("unprintable_blob_value")); - goto next; + goto next; + } } if (field->real_maybe_null()) @@ -15859,28 +15857,12 @@ static void print_key_value(String *out, const KEY_PART_INFO *key_part, store_length--; } - /* - Binary data cannot be converted to UTF8 which is what the - optimizer trace expects. If the column is binary, the hex - representation is printed to the trace instead. - */ - if (field->flags & BINARY_FLAG) - { - out->append("0x"); - for (uint i = 0; i < store_length; i++) - { - out->append(_dig_vec_lower[*(key + i) >> 4]); - out->append(_dig_vec_lower[*(key + i) & 0x0F]); - } - goto next; - } - field->set_key_image(key, key_part->length); - if (field->type() == MYSQL_TYPE_BIT) - (void)field->val_int_as_str(&tmp, 1); // may change tmp's charset + field->print_key_value(&tmp, key_part->length); + if (field->charset() == &my_charset_bin) + out->append(tmp.ptr(), tmp.length(), tmp.charset()); else - field->val_str(&tmp); // may change tmp's charset - out->append(tmp.ptr(), tmp.length(), tmp.charset()); + tmp.print(out, system_charset_info); next: if (key + store_length < key_end) diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 410f52a8c74..1b567ecb325 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -1196,3 +1196,15 @@ uint convert_to_printable(char *to, size_t to_len, *t= '\0'; return (uint) (t - to); } + + +bool String::append_semi_hex(const char *s, uint len, CHARSET_INFO *cs) +{ + size_t dst_len= len * 4 + 1; //extra length for the '\0' character + if (reserve(dst_len)) + return true; + uint nbytes= convert_to_printable(Ptr + str_length, dst_len, s, len, cs); + DBUG_ASSERT((ulonglong) str_length + nbytes < UINT_MAX32); + str_length+= nbytes; + return false; +} diff --git a/sql/sql_string.h b/sql/sql_string.h index caefee7ec09..d8edf5e81f0 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -674,6 +674,7 @@ public: int reserve(size_t space_needed) { + DBUG_ASSERT((ulonglong) str_length + space_needed < UINT_MAX32); return realloc(str_length + space_needed); } int reserve(size_t space_needed, size_t grow_by); @@ -959,6 +960,8 @@ public: { return !sortcmp(this, other, cs); } +private: + bool append_semi_hex(const char *s, uint len, CHARSET_INFO *cs); }; -- cgit v1.2.1 From 1b86ef9f5424ae5af17ec352516f1d7ac129a5c3 Mon Sep 17 00:00:00 2001 From: Varun Date: Tue, 11 Jun 2019 12:39:46 +0530 Subject: enabled test archive_gis --- mysql-test/suite/archive/disabled.def | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/suite/archive/disabled.def b/mysql-test/suite/archive/disabled.def index ae841eaaf33..888298bbb09 100644 --- a/mysql-test/suite/archive/disabled.def +++ b/mysql-test/suite/archive/disabled.def @@ -9,5 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## - -archive_gis : MDEV-17297 wait for the fix and then enable it -- cgit v1.2.1 From bb70d41932a23669dedf108d1af8581a3e7813d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 Jun 2019 13:52:20 +0300 Subject: MDEV-19709: Unbreak the build for clang --- sql/sql_bitmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 4f1acb60161..b37905e205b 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -30,7 +30,7 @@ /* Workaround GCC optimizer bug (generating SSE instuctions on unaligned data) */ -#if defined (__GNUC__) && defined(__x86_64__) && (__GNUC__ < 6) +#if defined (__GNUC__) && defined(__x86_64__) && (__GNUC__ < 6) && !defined(__clang__) #define NEED_GCC_NO_SSE_WORKAROUND #endif -- cgit v1.2.1 From 27fcdb161c8bb1fd21d2706ba17a3326f8221b9c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 11 Jun 2019 17:51:09 +0200 Subject: MDEV-16249 CHECKSUM TABLE for a spider table is not parallel and saves all data in memory in the spider head by default (#1328) followup for be5c432a42e ha_partition::calculate_checksum() has to invoke calculate_checksum() for partitions unconditionally, not under (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM). Because the server uses ::info() to ask for a live checksum, while calculate_checksum() must, precisely, calculate it the slow way, also for tables that don't have the live checksum at all. Also, fix the compilation on Windows (ha_checksum/ulonglong type mix). --- sql/ha_partition.cc | 26 ++++++++++++-------------- sql/handler.cc | 4 ++-- storage/spider/ha_spider.h | 2 +- storage/spider/spd_db_mysql.cc | 4 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index e47da94ab20..8a0b9822493 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -10645,22 +10645,20 @@ int ha_partition::calculate_checksum() } } m_pre_calling= FALSE; - if ((table_flags() & (HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM))) + + handler **file= m_file; + do { - handler **file= m_file; - do + if ((error= (*file)->calculate_checksum())) { - if ((error= (*file)->calculate_checksum())) - { - DBUG_RETURN(error); - } - if (!(*file)->stats.checksum_null) - { - stats.checksum+= (*file)->stats.checksum; - stats.checksum_null= FALSE; - } - } while (*(++file)); - } + DBUG_RETURN(error); + } + if (!(*file)->stats.checksum_null) + { + stats.checksum+= (*file)->stats.checksum; + stats.checksum_null= FALSE; + } + } while (*(++file)); DBUG_RETURN(0); } diff --git a/sql/handler.cc b/sql/handler.cc index 908d49d861a..dfb5c69e675 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -5054,7 +5054,7 @@ int handler::calculate_checksum() return HA_ERR_ABORTED_BY_USER; ha_checksum row_crc= 0; - error= table->file->ha_rnd_next(table->record[0]); + error= ha_rnd_next(table->record[0]); if (error) break; @@ -5108,7 +5108,7 @@ int handler::calculate_checksum() stats.checksum+= row_crc; } - table->file->ha_rnd_end(); + ha_rnd_end(); return error == HA_ERR_END_OF_FILE ? 0 : error; } diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h index 6ac71254b12..6f5359007f1 100644 --- a/storage/spider/ha_spider.h +++ b/storage/spider/ha_spider.h @@ -245,7 +245,7 @@ public: #endif ha_rows table_rows; #ifdef HA_HAS_CHECKSUM_EXTENDED - ulonglong checksum_val; + ha_checksum checksum_val; bool checksum_null; uint action_flags; #endif diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 313c6d0495c..393263e152d 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -1142,9 +1142,9 @@ int spider_db_mbase_result::fetch_simple_action( if (mysql_row[position]) { spider->checksum_val = - (ulonglong) my_strtoll10(mysql_row[position], (char**) NULL, + (ha_checksum) my_strtoll10(mysql_row[position], (char**) NULL, &error_num); - DBUG_PRINT("info", ("spider checksum=%llu", spider->checksum_val)); + DBUG_PRINT("info", ("spider checksum=%llu", (ulonglong)spider->checksum_val)); spider->checksum_null = FALSE; } else { spider->checksum_null = TRUE; -- cgit v1.2.1 From 0af1840892fd5c8d49ff2935b7169556a5e4a4d1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 7 Jun 2019 20:04:09 +0200 Subject: MDEV-19706 RPM no longer installs init script on systemd systems, but preun script still tries to erase it --- support-files/rpm/server-preun.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support-files/rpm/server-preun.sh b/support-files/rpm/server-preun.sh index 1d733a7d899..f4eb81a7f75 100644 --- a/support-files/rpm/server-preun.sh +++ b/support-files/rpm/server-preun.sh @@ -7,9 +7,9 @@ if [ $1 = 0 ] ; then fi if [ -x %{_sysconfdir}/init.d/mysql ] ; then %{_sysconfdir}/init.d/mysql stop > /dev/null - fi - if [ -x /sbin/chkconfig ] ; then - /sbin/chkconfig --del mysql > /dev/null 2>&1 + if [ -x /sbin/chkconfig ] ; then + /sbin/chkconfig --del mysql > /dev/null 2>&1 + fi fi fi -- cgit v1.2.1 From 1f6b02e9f0059932da4a9c05fdfc26f473a89cde Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 12 Jun 2019 01:08:09 +0200 Subject: MDEV-19709 Workaround "internal compiler bug" on GCC v 4.9 GCC crashes during compilation, on a code fragment that was added to workaround code generation bug on GCC. To fix, I randomly moved pragmas around, which seems to make GCC happy. --- sql/sql_bitmap.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index b37905e205b..cce80ce2bc8 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -27,6 +27,10 @@ #include #include + +template class Bitmap +{ + /* Workaround GCC optimizer bug (generating SSE instuctions on unaligned data) */ @@ -39,8 +43,6 @@ #pragma GCC target ("no-sse") #endif -template class Bitmap -{ uint32 buffer[(width + 31) / 32]; public: Bitmap() @@ -276,13 +278,15 @@ public: } enum { BITMAP_END = width }; }; -}; #ifdef NEED_GCC_NO_SSE_WORKAROUND #pragma GCC pop_options #undef NEED_GCC_NO_SSE_WORKAROUND #endif +}; + + /* An iterator to quickly walk over bits in ulonglong bitmap. */ class Table_map_iterator { -- cgit v1.2.1 From 8e3a4be45c551883d37e5598f0b4108ccf31521c Mon Sep 17 00:00:00 2001 From: Kentoku SHIBA Date: Wed, 12 Jun 2019 19:30:50 +0900 Subject: MDEV-6275 spider_same_server_link not enforced (#1330) --- storage/spider/ha_spider.cc | 4 +- .../bugfix/include/same_server_link_deinit.inc | 11 +++++ .../bugfix/include/same_server_link_init.inc | 15 ++++++ .../spider/bugfix/r/same_server_link.result | 42 +++++++++++++++++ .../spider/bugfix/t/same_server_link.cnf | 2 + .../spider/bugfix/t/same_server_link.test | 55 ++++++++++++++++++++++ storage/spider/spd_db_mysql.cc | 26 ++++++++++ storage/spider/spd_err.h | 3 ++ storage/spider/spd_table.cc | 8 ++++ 9 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/include/same_server_link_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/same_server_link_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/r/same_server_link.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/same_server_link.test diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index 4fbb6d1a8c1..33e81201fff 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -9431,9 +9431,9 @@ int ha_spider::calculate_checksum() stats.checksum = 0; } else { share->stat.checksum_null = FALSE; - share->stat.checksum = checksum_val; + share->stat.checksum = (ha_checksum) checksum_val; stats.checksum_null = FALSE; - stats.checksum = checksum_val; + stats.checksum = (ha_checksum) checksum_val; } DBUG_RETURN(0); } diff --git a/storage/spider/mysql-test/spider/bugfix/include/same_server_link_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/same_server_link_deinit.inc new file mode 100644 index 00000000000..a4e8a10db19 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/same_server_link_deinit.inc @@ -0,0 +1,11 @@ +--connection master_1 +set global spider_same_server_link= @old_global_spider_same_server_link; +set session spider_same_server_link= @old_session_spider_same_server_link; +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/bugfix/include/same_server_link_init.inc b/storage/spider/mysql-test/spider/bugfix/include/same_server_link_init.inc new file mode 100644 index 00000000000..2c8150c905d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/same_server_link_init.inc @@ -0,0 +1,15 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_b", host "127.0.0.1", port "$MASTER_1_MYPORT", user "root"'; +--connection master_1 +set @old_global_spider_same_server_link= @@global.spider_same_server_link; +set @old_session_spider_same_server_link= @@session.spider_same_server_link; +set global spider_same_server_link= 0; +set session spider_same_server_link= 0; diff --git a/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result b/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result new file mode 100644 index 00000000000..1f4177568a7 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/same_server_link.result @@ -0,0 +1,42 @@ +for master_1 +for child2 +for child3 +connection master_1; +set @old_global_spider_same_server_link= @@global.spider_same_server_link; +set @old_session_spider_same_server_link= @@session.spider_same_server_link; +set global spider_same_server_link= 0; +set session spider_same_server_link= 0; + +this test is for MDEV-6268 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +create table +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1 + +select test 1 +connection master_1; +INSERT INTO tbl_a VALUES(1); + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection master_1; +set global spider_same_server_link= @old_global_spider_same_server_link; +set session spider_same_server_link= @old_session_spider_same_server_link; +for master_1 +for child2 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf b/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf new file mode 100644 index 00000000000..b0853e32654 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/same_server_link.cnf @@ -0,0 +1,2 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/same_server_link.test b/storage/spider/mysql-test/spider/bugfix/t/same_server_link.test new file mode 100644 index 00000000000..1468f00cd1c --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/same_server_link.test @@ -0,0 +1,55 @@ +--source ../include/same_server_link_init.inc +--echo +--echo this test is for MDEV-6268 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; +--enable_warnings + +--echo +--echo create table + +--connection master_1 +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +echo CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log + +--echo +--echo select test 1 + +--connection master_1 +--disable_result_log +--error 12720 +INSERT INTO tbl_a VALUES(1); +--enable_result_log + +--echo +--echo deinit +--disable_warnings + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--enable_warnings +--source ../include/same_server_link_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 393263e152d..18e2d2acbd5 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -56,6 +56,8 @@ extern HASH spider_open_connections; extern HASH spider_ipport_conns; extern SPIDER_DBTON spider_dbton[SPIDER_DBTON_SIZE]; extern const char spider_dig_upper[]; +extern const char **spd_mysqld_unix_port; +extern uint *spd_mysqld_port; spider_db_mysql_util spider_db_mysql_utility; spider_db_mariadb_util spider_db_mariadb_utility; @@ -1970,6 +1972,30 @@ int spider_db_mbase::connect( conn->tgt_default_group); } + if (!spider_param_same_server_link(thd)) + { + if (!strcmp(tgt_host, my_localhost)) + { + if (!strcmp(tgt_socket, *spd_mysqld_unix_port)) + { + my_printf_error(ER_SPIDER_SAME_SERVER_LINK_NUM, + ER_SPIDER_SAME_SERVER_LINK_STR1, MYF(0), + tgt_host, tgt_socket); + DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM); + } + } else if (!strcmp(tgt_host, "127.0.0.1") || + !strcmp(tgt_host, glob_hostname)) + { + if (tgt_port == *spd_mysqld_port) + { + my_printf_error(ER_SPIDER_SAME_SERVER_LINK_NUM, + ER_SPIDER_SAME_SERVER_LINK_STR2, MYF(0), + tgt_host, tgt_port); + DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM); + } + } + } + if (connect_mutex) pthread_mutex_lock(&spider_open_conn_mutex); /* tgt_db not use */ diff --git a/storage/spider/spd_err.h b/storage/spider/spd_err.h index a80d903bd6e..9889fcfa7fb 100644 --- a/storage/spider/spd_err.h +++ b/storage/spider/spd_err.h @@ -124,6 +124,9 @@ #define ER_SPIDER_CON_COUNT_ERROR_STR "Too many connections between spider and remote" #define ER_SPIDER_TABLE_OPEN_TIMEOUT_NUM 12714 #define ER_SPIDER_TABLE_OPEN_TIMEOUT_STR "Table %s.%s open timeout" +#define ER_SPIDER_SAME_SERVER_LINK_NUM 12720 +#define ER_SPIDER_SAME_SERVER_LINK_STR1 "Host:%s and Socket:%s aim self server. Please change spider_same_server_link parameter if this link is required." +#define ER_SPIDER_SAME_SERVER_LINK_STR2 "Host:%s and Port:%ld aim self server. Please change spider_same_server_link parameter if this link is required." #define ER_SPIDER_COND_SKIP_NUM 12801 #define ER_SPIDER_UNKNOWN_NUM 12500 diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index ad3d10dc642..fc2aa6c1d60 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -122,6 +122,8 @@ HASH *spd_db_att_xid_cache; struct charset_info_st *spd_charset_utf8_bin; const char **spd_defaults_extra_file; const char **spd_defaults_file; +const char **spd_mysqld_unix_port; +uint *spd_mysqld_port; bool volatile *spd_abort_loop; Time_zone *spd_tz_system; extern long spider_conn_mutex_id; @@ -6934,6 +6936,10 @@ int spider_db_init( GetProcAddress(current_module, "my_defaults_extra_file"); spd_defaults_file = (const char **) GetProcAddress(current_module, "my_defaults_file"); + spd_mysqld_unix_port = (const char **) + GetProcAddress(current_module, "?mysqld_unix_port@@3PADA"); + spd_mysqld_port = (uint *) + GetProcAddress(current_module, "?mysqld_port@@3IA"); spd_abort_loop = (bool volatile *) GetProcAddress(current_module, "?abort_loop@@3_NC"); spd_tz_system = *(Time_zone **) @@ -6960,6 +6966,8 @@ int spider_db_init( spd_charset_utf8_bin = &my_charset_utf8_bin; spd_defaults_extra_file = &my_defaults_extra_file; spd_defaults_file = &my_defaults_file; + spd_mysqld_unix_port = (const char **) &mysqld_unix_port; + spd_mysqld_port = &mysqld_port; spd_abort_loop = &abort_loop; spd_tz_system = my_tz_SYSTEM; #endif -- cgit v1.2.1