diff options
36 files changed, 278 insertions, 157 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 73263535240..03ab7216bad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -481,6 +481,8 @@ IF(UNIX) INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme) ENDIF() +INCLUDE(build_depends) + INCLUDE(CPack) IF(WIN32 AND SIGNCODE) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 7753366add3..97e9768964e 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -95,8 +95,8 @@ IF(WIN32) ELSEIF(RPM) SET(WITH_SSL system CACHE STRING "") SET(WITH_ZLIB system CACHE STRING "") - SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "") - SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "") + SET(CHECKMODULE /usr/bin/checkmodule CACHE FILEPATH "") + SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "") ELSEIF(DEB) SET(WITH_SSL system CACHE STRING "") SET(WITH_ZLIB system CACHE STRING "") diff --git a/cmake/build_depends.cmake b/cmake/build_depends.cmake new file mode 100644 index 00000000000..0d17c22cf98 --- /dev/null +++ b/cmake/build_depends.cmake @@ -0,0 +1,39 @@ +IF(RPM) + MACRO(FIND_DEP V) + SET(out ${V}_DEP) + IF (NOT DEFINED ${out}) + IF(EXISTS ${${V}} AND NOT IS_DIRECTORY ${${V}}) + EXECUTE_PROCESS(COMMAND ${ARGN} RESULT_VARIABLE res OUTPUT_VARIABLE O OUTPUT_STRIP_TRAILING_WHITESPACE) + ELSE() + SET(res 1) + ENDIF() + IF (res) + SET(O) + ELSE() + MESSAGE(STATUS "Need ${O} for ${${V}}") + ENDIF() + SET(${out} ${O} CACHE INTERNAL "Package that contains ${${V}}" FORCE) + ENDIF() + ENDMACRO() + + GET_CMAKE_PROPERTY(ALL_VARS CACHE_VARIABLES) + FOREACH (V ${ALL_VARS}) + GET_PROPERTY(H CACHE ${V} PROPERTY HELPSTRING) + IF (H MATCHES "^Have library [^/]" AND ${V}) + STRING(REGEX REPLACE "^Have library " "" L ${H}) + SET(V ${L}_LIBRARY) + FIND_LIBRARY(${V} ${L}) + ENDIF() + GET_PROPERTY(T CACHE ${V} PROPERTY TYPE) + IF ((T STREQUAL FILEPATH OR V MATCHES "^CMAKE_COMMAND$") AND ${V} MATCHES "^/") + IF (RPM) + FIND_DEP(${V} rpm -q --qf "%{NAME}" -f ${${V}}) + ELSE() # must be DEB + MESSAGE(FATAL_ERROR "Not implemented") + ENDIF () + SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP}) + ENDIF() + ENDFOREACH() + LIST(REMOVE_DUPLICATES BUILD_DEPS) + STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}") +ENDIF(RPM) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 6bc0cc81ada..7aefdce9bf0 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -83,6 +83,12 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE " %define _sysconfdir ${INSTALL_SYSCONFDIR} %define restart_flag_dir %{_localstatedir}/lib/rpm-state/mariadb %define restart_flag %{restart_flag_dir}/need-restart + +%{?filter_setup: +%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d +%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d +%filter_setup +} ") # this creative hack is described here: http://www.cmake.org/pipermail/cmake/2012-January/048416.html @@ -223,36 +229,6 @@ ELSEIF(RPM MATCHES "(rhel|centos)8") SET(PYTHON_SHEBANG "/usr/bin/python3") ENDIF() -# workaround for lots of perl dependencies added by rpmbuild -SETA(CPACK_RPM_test_PACKAGE_PROVIDES - "perl(lib::mtr_gcov.pl)" - "perl(lib::mtr_gprof.pl)" - "perl(lib::mtr_io.pl)" - "perl(lib::mtr_misc.pl)" - "perl(lib::mtr_process.pl)" - "perl(lib::v1/mtr_cases.pl)" - "perl(lib::v1/mtr_gcov.pl)" - "perl(lib::v1/mtr_gprof.pl)" - "perl(lib::v1/mtr_im.pl)" - "perl(lib::v1/mtr_io.pl)" - "perl(lib::v1/mtr_match.pl)" - "perl(lib::v1/mtr_misc.pl)" - "perl(lib::v1/mtr_process.pl)" - "perl(lib::v1/mtr_report.pl)" - "perl(lib::v1/mtr_stress.pl)" - "perl(lib::v1/mtr_timer.pl)" - "perl(lib::v1/mtr_unique.pl)" - "perl(mtr_cases)" - "perl(mtr_io.pl)" - "perl(mtr_match)" - "perl(mtr_misc.pl)" - "perl(mtr_gcov.pl)" - "perl(mtr_gprof.pl)" - "perl(mtr_process.pl)" - "perl(mtr_report)" - "perl(mtr_results)" - "perl(mtr_unique)") - # If we want to build build MariaDB-shared-compat, # extract compat libraries from MariaDB-shared-5.3 rpm FILE(GLOB compat53 RELATIVE ${CMAKE_SOURCE_DIR} @@ -299,5 +275,24 @@ IF(compat53 AND compat101) ENDIF() ENDIF() -ENDIF(RPM) +################ +IF(CMAKE_VERSION VERSION_GREATER "3.9.99") + +SET(CPACK_SOURCE_GENERATOR "RPM") +SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS + "-DBUILD_CONFIG=mysql_release" + "-DRPM=${RPM}" + "-DCPACK_RPM_BUILD_SOURCE_DIRS_PREFIX=/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}" + ) +MACRO(ADDIF var) + IF(DEFINED ${var}) + SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-D${var}=${${var}}") + ENDIF() +ENDMACRO() + +ADDIF(BUILD_CONFIG) +ADDIF(WITH_SSL) + +ENDIF() +ENDIF(RPM) diff --git a/cmake/cpack_source_ignore_files.cmake b/cmake/cpack_source_ignore_files.cmake index 2627e6cb697..fbd6ea6963d 100644 --- a/cmake/cpack_source_ignore_files.cmake +++ b/cmake/cpack_source_ignore_files.cmake @@ -15,18 +15,19 @@ SET(CPACK_SOURCE_IGNORE_FILES \\\\.git/ -\\\\.gitignore -CMakeCache\\\\.txt -cmake_dist\\\\.cmake -CPackSourceConfig\\\\.cmake -CPackConfig.cmake -/cmake_install\\\\.cmake -/CTestTestfile\\\\.cmake +\\\\.gitignore$ +\\\\.gitattributes$ +CMakeCache\\\\.txt$ +cmake_dist\\\\.cmake$ +CPackSourceConfig\\\\.cmake$ +CPackConfig.cmake$ +/cmake_install\\\\.cmake$ +/CTestTestfile\\\\.cmake$ /CMakeFiles/ /version_resources/ /_CPack_Packages/ -$\\\\.gz -$\\\\.zip +\\\\.gz$ +\\\\.zip$ /CMakeFiles/ /version_resources/ /_CPack_Packages/ @@ -49,5 +50,6 @@ include/config\\\\.h$ include/my_config\\\\.h$ /autom4te\\\\.cache/ errmsg\\\\.sys$ +\\\\.rpm$ # ) diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 4e902d7fed8..caba370c4ae 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -28,10 +28,15 @@ SET(MY_WARNING_FLAGS -Woverloaded-virtual -Wvla -Wwrite-strings + -Werror ) -IF(MYSQL_MAINTAINER_MODE MATCHES "ON") - SET(WHERE) +IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0") + SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=maybe-uninitialized) +ENDIF() + +IF(MYSQL_MAINTAINER_MODE MATCHES "OFF") + RETURN() ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO") SET(WHERE DEBUG) ENDIF() diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 65e85983d68..268bc6e4a63 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -233,9 +233,6 @@ MACRO(MYSQL_ADD_PLUGIN) IF (NOT ARG_CLIENT) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE) ENDIF() - # workarounds for cmake issues #13248 and #12864: - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE) IF(NOT ARG_CLIENT AND UNIX) IF (NOT ARG_CONFIG) diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index f7365066ef6..627c3a00279 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -38,22 +38,14 @@ MACRO(CHECK_SYSTEMD) SET(LIBSYSTEMD systemd) ENDIF() SET(CMAKE_REQUIRED_LIBRARIES ${LIBSYSTEMD}) - CHECK_C_SOURCE_COMPILES( - " - #include <systemd/sd-daemon.h> - int main() - { - sd_listen_fds(0); - }" - HAVE_SYSTEMD) + CHECK_LIBRARY_EXISTS(systemd sd_listen_fds "" HAVE_SYSTEMD_SD_LISTEN_FDS) CHECK_INCLUDE_FILES(systemd/sd-daemon.h HAVE_SYSTEMD_SD_DAEMON_H) - CHECK_FUNCTION_EXISTS(sd_listen_fds HAVE_SYSTEMD_SD_LISTEN_FDS) CHECK_FUNCTION_EXISTS(sd_notify HAVE_SYSTEMD_SD_NOTIFY) CHECK_FUNCTION_EXISTS(sd_notifyf HAVE_SYSTEMD_SD_NOTIFYF) SET(CMAKE_REQUIRED_LIBRARIES) - IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS + IF(HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) - ADD_DEFINITIONS(-DHAVE_SYSTEMD) + SET(HAVE_SYSTEMD TRUE) SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) IF(DEB) SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld") diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h index b2df0019dfe..84fb3c6798d 100644 --- a/include/mysql/client_plugin.h +++ b/include/mysql/client_plugin.h @@ -32,17 +32,18 @@ */ #undef MYSQL_PLUGIN_EXPORT #if defined(_MSC_VER) - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) - #else - #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) - #endif + #define MYSQL_PLUGIN_EXPORT_C __declspec(dllexport) #else /*_MSC_VER */ - #ifdef __cplusplus - #define MYSQL_PLUGIN_EXPORT extern "C" - #else - #define MYSQL_PLUGIN_EXPORT - #endif + #define MYSQL_PLUGIN_EXPORT_C +#endif +#ifdef __cplusplus +#define MYSQL_PLUGIN_EXPORT extern "C" MYSQL_PLUGIN_EXPORT_C +#define C_MODE_START extern "C" { +#define C_MODE_END } +#else +#define MYSQL_PLUGIN_EXPORT MYSQL_PLUGIN_EXPORT_C +#define C_MODE_START +#define C_MODE_END #endif #ifndef MYSQL_ABI_CHECK @@ -60,11 +61,12 @@ #define MYSQL_CLIENT_MAX_PLUGINS 3 #define mysql_declare_client_plugin(X) \ - MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \ + C_MODE_START MYSQL_PLUGIN_EXPORT_C \ + struct st_mysql_client_plugin_ ## X \ _mysql_client_plugin_declaration_ = { \ MYSQL_CLIENT_ ## X ## _PLUGIN, \ MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION, -#define mysql_end_client_plugin } +#define mysql_end_client_plugin }; C_MODE_END /* generic plugin header structure */ #define MYSQL_CLIENT_PLUGIN_HEADER \ diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 3c99366168c..38021807b55 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -1076,6 +1076,15 @@ t1 CREATE TABLE `t1` ( `a` longtext CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +create table t1 (a int); +alter table t1 add column b blob, alter column b set default "foo"; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` blob DEFAULT 'foo' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; # # End of 10.2 test # diff --git a/mysql-test/suite/binlog/r/binlog_innodb_stm.result b/mysql-test/suite/binlog/r/binlog_innodb_stm.result new file mode 100644 index 00000000000..829ed7d3c61 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_innodb_stm.result @@ -0,0 +1,17 @@ +create table categories( +cat_id int not null primary key, +cat_name varchar(255) not null, +cat_description text +) engine=innodb; +create table products( +prd_id int not null auto_increment primary key, +prd_name varchar(355) not null, +prd_price decimal, +cat_id int not null, +foreign key fk_cat(cat_id) +references categories(cat_id) +on update cascade +) engine=innodb; +insert into categories values (1, 'drinks', 'drinks'); +update categories set cat_description=2 where cat_id=1; +drop table products, categories; diff --git a/mysql-test/suite/binlog/t/binlog_innodb_stm.test b/mysql-test/suite/binlog/t/binlog_innodb_stm.test new file mode 100644 index 00000000000..4dfa7a76584 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_innodb_stm.test @@ -0,0 +1,26 @@ +source include/have_innodb.inc; +source include/have_binlog_format_statement.inc; + +# +# MDEV-18466 Unsafe to log updates on tables referenced by foreign keys with triggers in statement format +# + +create table categories( + cat_id int not null primary key, + cat_name varchar(255) not null, + cat_description text +) engine=innodb; + +create table products( + prd_id int not null auto_increment primary key, + prd_name varchar(355) not null, + prd_price decimal, + cat_id int not null, + foreign key fk_cat(cat_id) + references categories(cat_id) + on update cascade +) engine=innodb; + +insert into categories values (1, 'drinks', 'drinks'); +update categories set cat_description=2 where cat_id=1; +drop table products, categories; diff --git a/mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result b/mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result new file mode 100644 index 00000000000..29b815420ba --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_slave_invalid_external_user.result @@ -0,0 +1,15 @@ +include/master-slave.inc +[connection master] +CREATE USER test_user@localhost; +SET PASSWORD FOR test_user@localhost = password('PWD'); +GRANT ALL ON *.* TO test_user@localhost WITH GRANT OPTION; +connect conn_test,localhost,test_user,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connection conn_test; +CREATE TABLE t1 (f1 INT); +CREATE TABLE t2 (f2 VARCHAR(64)); +CREATE TRIGGER tr_before BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; +CREATE DEFINER='root'@'localhost' TRIGGER tr_after AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; +INSERT INTO t1 VALUES (1); +DROP USER 'test_user'@'localhost'; +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test b/mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test new file mode 100644 index 00000000000..5099d7ee49e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test @@ -0,0 +1,42 @@ +# ==== Purpose ==== +# +# Test verifies that when applier thread tries to access 'variable_name' of +# INFORMATION_SCHEMA.SESSION_VARIABLES table through triggers it successfully +# retrieves all the session variables. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Create two tables t1 and t2. +# 1 - Create a trigger such that it reads the names of all session variables +# from INFORMATION_SCHEMA.SESSION_VARIABLES table and populates one of the +# tables. +# 2 - Do a DML on master and wait for it to be replicated and ensure that +# slave is in sync with master and it is up and running. +# +# ==== References ==== +# +# MDEV-14784: Slave crashes in show_status_array upon running a trigger with +# select from I_S + +--source include/master-slave.inc +--source include/have_binlog_format_mixed.inc +--enable_connect_log +CREATE USER test_user@localhost; +SET PASSWORD FOR test_user@localhost = password('PWD'); +GRANT ALL ON *.* TO test_user@localhost WITH GRANT OPTION; +connect(conn_test,localhost,test_user,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK); + +--connection conn_test +CREATE TABLE t1 (f1 INT); +CREATE TABLE t2 (f2 VARCHAR(64)); +CREATE TRIGGER tr_before BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; +CREATE DEFINER='root'@'localhost' TRIGGER tr_after AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES; + +INSERT INTO t1 VALUES (1); +--disable_connect_log +# Cleanup +--connection master +DROP USER 'test_user'@'localhost'; +DROP TABLE t1, t2; +--source include/rpl_end.inc diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 2c74d4ea241..f97ddc755ce 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -694,6 +694,11 @@ CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8); SHOW CREATE TABLE t1; DROP TABLE t1; +# ALTER SET DEFAULT +create table t1 (a int); +alter table t1 add column b blob, alter column b set default "foo"; +show create table t1; +drop table t1; --echo # --echo # End of 10.2 test diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index 51317527c77..606fef002e7 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -8,6 +8,7 @@ IF(HAVE_PAM_APPL_H) IF(HAVE_STRNDUP) ADD_DEFINITIONS(-DHAVE_STRNDUP) ENDIF(HAVE_STRNDUP) + FIND_LIBRARY(PAM_LIBRARY pam) MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY) ENDIF(HAVE_PAM_APPL_H) diff --git a/sql/log.cc b/sql/log.cc index df928e89390..2152fa4f11f 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -9646,9 +9646,9 @@ TC_LOG_BINLOG::log_and_order(THD *thd, my_xid xid, bool all, */ if (!xid || !need_unlog) DBUG_RETURN(BINLOG_COOKIE_DUMMY(cache_mngr->delayed_error)); - else - DBUG_RETURN(BINLOG_COOKIE_MAKE(cache_mngr->binlog_id, - cache_mngr->delayed_error)); + + DBUG_RETURN(BINLOG_COOKIE_MAKE(cache_mngr->binlog_id, + cache_mngr->delayed_error)); } /* diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 3102a00a4ab..60f1253dd63 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -2377,31 +2377,8 @@ ER_TABLE_NOT_LOCKED spa "Tabla '%-.192s' no fue trabada con LOCK TABLES" swe "Tabell '%-.192s' är inte låst med LOCK TABLES" ukr "Таблицю '%-.192s' не було блоковано з LOCK TABLES" -ER_BLOB_CANT_HAVE_DEFAULT 42000 - cze "Blob položka '%-.192s' nemůže mít defaultní hodnotu" - dan "BLOB feltet '%-.192s' kan ikke have en standard værdi" - nla "Blob veld '%-.192s' can geen standaardwaarde bevatten" - eng "BLOB/TEXT column '%-.192s' can't have a default value" - est "BLOB-tüüpi tulp '%-.192s' ei saa omada vaikeväärtust" - fre "BLOB '%-.192s' ne peut avoir de valeur par défaut" - ger "BLOB/TEXT-Feld '%-.192s' darf keinen Vorgabewert (DEFAULT) haben" - greek "Τα Blob πεδία '%-.192s' δεν μπορούν να έχουν προκαθορισμένες τιμές (default value)" - hindi "BLOB/TEXT कॉलम '%-.192s' का डिफ़ॉल्ट मान नहीं हो सकता" - hun "A(z) '%-.192s' blob objektumnak nem lehet alapertelmezett erteke" - ita "Il campo BLOB '%-.192s' non puo` avere un valore di default" - jpn "BLOB/TEXT 列 '%-.192s' にはデフォルト値を指定できません。" - kor "BLOB 칼럼 '%-.192s' 는 디폴트 값을 가질 수 없습니다." - nor "Blob feltet '%-.192s' kan ikke ha en standard verdi" - norwegian-ny "Blob feltet '%-.192s' kan ikkje ha ein standard verdi" - pol "Pole typu blob '%-.192s' nie może mieć domy?lnej warto?ci" - por "Coluna BLOB '%-.192s' não pode ter um valor padrão (default)" - rum "Coloana BLOB '%-.192s' nu poate avea o valoare default" - rus "Невозможно указывать значение по умолчанию для столбца BLOB '%-.192s'" - serbian "BLOB kolona '%-.192s' ne može imati default vrednost" - slo "Pole BLOB '%-.192s' nemôže mať implicitnú hodnotu" - spa "Campo Blob '%-.192s' no puede tener valores patron" - swe "BLOB fält '%-.192s' kan inte ha ett DEFAULT-värde" - ukr "Стовбець BLOB '%-.192s' не може мати значення по замовчуванню" +ER_UNUSED_17 + eng "You should never see it" ER_WRONG_DB_NAME 42000 cze "Nepřípustné jméno databáze '%-.100s'" dan "Ugyldigt database navn '%-.100s'" diff --git a/sql/sp_head.cc b/sql/sp_head.cc index effe9d1735f..bb24c3b91bb 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -598,6 +598,7 @@ sp_head::sp_head() DBUG_ENTER("sp_head::sp_head"); + m_security_ctx.init(); m_backpatch.empty(); m_cont_backpatch.empty(); m_lex.empty(); diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 155ed3bcecb..76bb65fba30 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -563,7 +563,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (!table->table->part_info) { my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0)); - goto err2; + thd->resume_subsequent_commits(suspended_wfc); + DBUG_RETURN(TRUE); } if (set_part_state(alter_info, table->table->part_info, PART_ADMIN)) { @@ -1216,9 +1217,6 @@ err: } close_thread_tables(thd); // Shouldn't be needed thd->mdl_context.release_transactional_locks(); -#ifdef WITH_PARTITION_STORAGE_ENGINE -err2: -#endif thd->resume_subsequent_commits(suspended_wfc); DBUG_RETURN(TRUE); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 512f7fdfd56..1c29e3d18a7 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5799,16 +5799,18 @@ int THD::decide_logging_format(TABLE_LIST *tables) replicated_tables_count++; - if (table->lock_type <= TL_READ_NO_INSERT && - table->prelocking_placeholder != TABLE_LIST::FK) - has_read_tables= true; - else if (table->table->found_next_number_field && - (table->lock_type >= TL_WRITE_ALLOW_WRITE)) + if (table->prelocking_placeholder != TABLE_LIST::FK) { - has_auto_increment_write_tables= true; - has_auto_increment_write_tables_not_first= found_first_not_own_table; - if (table->table->s->next_number_keypart != 0) - has_write_table_auto_increment_not_first_in_pk= true; + if (table->lock_type <= TL_READ_NO_INSERT) + has_read_tables= true; + else if (table->table->found_next_number_field && + (table->lock_type >= TL_WRITE_ALLOW_WRITE)) + { + has_auto_increment_write_tables= true; + has_auto_increment_write_tables_not_first= found_first_not_own_table; + if (table->table->s->next_number_keypart != 0) + has_write_table_auto_increment_not_first_in_pk= true; + } } if (table->lock_type >= TL_WRITE_ALLOW_WRITE) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b559e36315b..071f4763b34 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7873,11 +7873,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, } if (alter) { - if (def->sql_type == MYSQL_TYPE_BLOB) - { - my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0), def->change); - goto err; - } if ((def->default_value= alter->default_value)) // Use new default def->flags&= ~NO_DEFAULT_VALUE_FLAG; else diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 1f8c9765c16..6ec9a589974 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -226,7 +226,7 @@ bool wsrep_sst_wait () total_wtime += difftime(end_time, start_time); WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime); service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL, - "WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime); + "WSREP state transfer ongoing, current seqno: %" PRId64 " waited %f secs", local_seqno, total_wtime); } } @@ -1469,7 +1469,7 @@ void wsrep_SE_init_wait() total_wtime += difftime(end_time, start_time); WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime); service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL, - "WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime); + "WSREP state transfer ongoing, current seqno: %" PRId64 " waited %f secs", local_seqno, total_wtime); } } diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index c8747f889c6..e524088623d 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -40,6 +40,10 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h) add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS) add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT ) +macro(DISABLE_WARNING W) + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-error=${W}") + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-${W}" DEBUG) +endmacro() # # OS specific C flags, definitions and source files. @@ -47,14 +51,15 @@ add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT ) IF(UNIX) MY_CHECK_AND_SET_COMPILER_FLAG("-Wall -Wmissing-declarations") if(NOT WITH_WARNINGS) - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-function") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-variable") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-value") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-parentheses") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-strict-aliasing") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-misleading-indentation") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-format-truncation") - MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough") + DISABLE_WARNING("unused-function") + DISABLE_WARNING("unused-variable") + DISABLE_WARNING("unused-value") + DISABLE_WARNING("parentheses") + DISABLE_WARNING("strict-aliasing") + DISABLE_WARNING("misleading-indentation") + DISABLE_WARNING("format-truncation") + DISABLE_WARNING("implicit-fallthrough") + DISABLE_WARNING("type-limits") endif(NOT WITH_WARNINGS) add_definitions( -DUNIX -DLINUX -DUBUNTU ) @@ -164,7 +169,8 @@ IF(CONNECT_WITH_ODBC) # the library 'libiodbc' gets compiled with 'sql'h. # This will also need changes in the sources (e.g. #include <isql.h>). - find_path(ODBC_INCLUDE_DIR sql.h + find_file(ODBC_INCLUDES sql.h + PATHS /usr/include /usr/include/odbc /usr/local/include @@ -174,7 +180,7 @@ IF(CONNECT_WITH_ODBC) #"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include" #"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" #"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include" - DOC "Specify the directory containing sql.h." + DOC "Specify the path to sql.h." ) find_library(ODBC_LIBRARY @@ -193,9 +199,10 @@ IF(CONNECT_WITH_ODBC) DOC "Specify the ODBC driver manager library here." ) - mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR) + mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDES) - IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY) + IF(ODBC_INCLUDES AND ODBC_LIBRARY) + get_filename_component(ODBC_INCLUDE_DIR "${ODBC_INCLUDES}" PATH) set(CMAKE_REQUIRED_LIBRARIES ${ODBC_LIBRARY}) set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES( diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 07b1c2d2e7d..13c9aa4835b 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -32,6 +32,10 @@ /****************************************************************************/ #include "mycat.h" +#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) +bool MongoEnabled(void); +#endif // JAVA_SUPPORT || CMGO_SUPPORT + /****************************************************************************/ /* Structures used to pass info between CONNECT and ha_connect. */ /****************************************************************************/ diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 5aef6d9c660..c41ea0970ed 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -102,10 +102,6 @@ extern "C" HINSTANCE s_hModule; // Saved module handle #endif // !__WIN__ -#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) -bool MongoEnabled(void); -#endif // JAVA_SUPPORT || CMGO_SUPPORT - PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); /***********************************************************************/ diff --git a/storage/mroonga/lib/mrn_context_pool.cpp b/storage/mroonga/lib/mrn_context_pool.cpp index d297ee9a338..a26005b16c0 100644 --- a/storage/mroonga/lib/mrn_context_pool.cpp +++ b/storage/mroonga/lib/mrn_context_pool.cpp @@ -77,7 +77,7 @@ namespace mrn { } private: - static const unsigned int CLEAR_THREATHOLD_IN_SECONDS = 60 * 5; + static const int CLEAR_THREATHOLD_IN_SECONDS = 60 * 5; mysql_mutex_t *mutex_; LIST *pool_; diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 1c5d7903145..b4d69af12c4 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -7030,7 +7030,7 @@ int spider_get_sts( int sts_sync_level, uint flag ) { - int get_type; + int get_type __attribute__ ((unused)); int error_num = 0; DBUG_ENTER("spider_get_sts"); @@ -7152,7 +7152,7 @@ int spider_get_crd( #endif int crd_sync_level ) { - int get_type; + int get_type __attribute__ ((unused)); int error_num = 0; DBUG_ENTER("spider_get_crd"); @@ -8382,7 +8382,7 @@ int spider_discover_table_structure( #ifdef WITH_PARTITION_STORAGE_ENGINE partition_info *part_info = thd->work_part_info; #endif - uint str_len; + uint str_len __attribute__ ((unused)); char buf[MAX_FIELD_WIDTH]; spider_string str(buf, sizeof(buf), system_charset_info); DBUG_ENTER("spider_discover_table_structure"); diff --git a/storage/xtradb/btr/btr0scrub.cc b/storage/xtradb/btr/btr0scrub.cc index 2e667e64d0b..0e7c0d5b061 100644 --- a/storage/xtradb/btr/btr0scrub.cc +++ b/storage/xtradb/btr/btr0scrub.cc @@ -145,10 +145,10 @@ btr_scrub_lock_dict_func(ulint space_id, bool lock_to_close_table, time_t now = time(0); if (now >= last + 30) { fprintf(stderr, - "WARNING: %s:%u waited " TIMETPF " seconds for" + "WARNING: %s:%u waited %ld seconds for" " dict_sys lock, space: %lu" " lock_to_close_table: %d\n", - file, line, now - start, space_id, + file, line, (long)(now - start), space_id, lock_to_close_table); last = now; diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 6e954b2acf2..14a87861e6d 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -2453,9 +2453,9 @@ fil_space_crypt_close_tablespace( if (now >= last + 30) { ib_logf(IB_LOG_LEVEL_WARN, - "Waited " TIMETPF " seconds to drop space: %s (" ULINTPF + "Waited %ld seconds to drop space: %s (" ULINTPF ") active threads %u flushing=%d.", - now - start, space->name, space->id, cnt, flushing); + (long)(now - start), space->name, space->id, cnt, flushing); last = now; } } diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index dab6f354b32..690b4c8df8b 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -4827,12 +4827,6 @@ will_not_choose: srv_force_recovery); return; } - - /* In mariabackup lets not crash. */ - if (IS_XTRABACKUP()) { - return; - } - abort(); } diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index c9f30c952da..0b368f0cca4 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -11015,7 +11015,7 @@ wsrep_append_foreign_key( key_type, copy); if (rcode) { - DBUG_PRINT("wsrep", ("row key failed: %zu", rcode)); + DBUG_PRINT("wsrep", ("row key failed: %lu", rcode)); WSREP_ERROR("Appending cascaded fk row key failed: %s, %lu", (wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void", rcode); diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 6d1520bc6a3..c35ec40e381 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -471,7 +471,6 @@ macro ULINTPF. */ # define INT64PF "%lld" # define UINT64PF "%llu" # define UINT64PFx "%016llx" -# define TIMETPF "%ld" typedef __int64 ib_int64_t; typedef unsigned __int64 ib_uint64_t; typedef unsigned __int32 ib_uint32_t; @@ -481,7 +480,6 @@ typedef unsigned __int32 ib_uint32_t; # define INT64PF "%" PRId64 # define UINT64PF "%" PRIu64 # define UINT64PFx "%016" PRIx64 -# define TIMETPF "%" PRIdFAST32 typedef int64_t ib_int64_t; typedef uint64_t ib_uint64_t; typedef uint32_t ib_uint32_t; diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 2183d281b78..9daa2cc906f 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -5401,7 +5401,7 @@ lock_table( lock_mutex_enter(); DBUG_EXECUTE_IF("fatal-semaphore-timeout", - { os_thread_sleep(3600000000); }); + { os_thread_sleep(3600000000U); }); /* We have to check if the new lock is compatible with any locks other transactions have in the table lock queue. */ diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc index 47075c6cbc8..5e7ff6e910b 100644 --- a/storage/xtradb/row/row0mysql.cc +++ b/storage/xtradb/row/row0mysql.cc @@ -3320,17 +3320,17 @@ fil_wait_crypt_bg_threads( time_t now = time(0); if (now >= last + 30) { fprintf(stderr, - "WARNING: waited " TIMETPF " seconds " + "WARNING: waited %ld seconds " "for ref-count on table: %s space: %u\n", - now - start, table->name, table->space); + (long)(now - start), table->name, table->space); last = now; } if (now >= start + 300) { fprintf(stderr, - "WARNING: after " TIMETPF " seconds, gave up waiting " + "WARNING: after %ld seconds, gave up waiting " "for ref-count on table: %s space: %u\n", - now - start, table->name, table->space); + (long)(now - start), table->name, table->space); break; } } diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index 287f1cb837a..2e36148d05f 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -357,7 +357,7 @@ void mdev17133() // random size 2nd read res= my_b_read(&info, buf_i + total + MY_MIN(19, curr_read_size), 19 >= curr_read_size ? 0 : curr_read_size - 19); - ok(res == 0, "rest of read %lu", curr_read_size - 19); + ok(res == 0, "rest of read %zu", curr_read_size - 19); // mark read bytes in the used part of the cache buffer memset(info.buffer, 0, info.read_pos - info.buffer); |