Merge branch '10.1' into 10.2

This commit is contained in:
Sergei Golubchik 2019-03-29 10:58:20 +01:00
commit f2a0c758da
36 changed files with 278 additions and 157 deletions

View file

@ -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)

View file

@ -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 "")

39
cmake/build_depends.cmake Normal file
View file

@ -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)

View file

@ -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)

View file

@ -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$
#
)

View file

@ -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()

View file

@ -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)

View file

@ -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")

View file

@ -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 \

View file

@ -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
#

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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));
}
/*

View file

@ -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'"

View file

@ -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();

View file

@ -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);
}

View file

@ -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)

View file

@ -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

View file

@ -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);
}
}

View file

@ -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(

View file

@ -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. */
/****************************************************************************/

View file

@ -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);
/***********************************************************************/

View file

@ -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_;

View file

@ -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");

View file

@ -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;

View file

@ -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;
}
}

View file

@ -4827,12 +4827,6 @@ will_not_choose:
srv_force_recovery);
return;
}
/* In mariabackup lets not crash. */
if (IS_XTRABACKUP()) {
return;
}
abort();
}

View file

@ -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);

View file

@ -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;

View file

@ -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. */

View file

@ -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;
}
}

View file

@ -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);