Commit 09a2107b authored by Sergei Golubchik's avatar Sergei Golubchik

Merge branch '10.0' into 10.1

parents bbf0c9d4 0d622bed
...@@ -467,8 +467,9 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL ...@@ -467,8 +467,9 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
) )
INSTALL_DOCUMENTATION(README CREDITS COPYING COPYING.LESSER COPYING.thirdparty INSTALL_DOCUMENTATION(README CREDITS COPYING COPYING.thirdparty
EXCEPTIONS-CLIENT COMPONENT Readme) EXCEPTIONS-CLIENT COMPONENT Readme)
# MDEV-6526 these files are not installed anymore # MDEV-6526 these files are not installed anymore
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC #INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN) # ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
......
This diff is collapsed.
...@@ -87,6 +87,8 @@ IF(WIN32) ...@@ -87,6 +87,8 @@ IF(WIN32)
ELSEIF(RPM) ELSEIF(RPM)
SET(WITH_SSL system CACHE STRING "") SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB 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 "")
ELSEIF(DEB) ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "") SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "") SET(WITH_ZLIB system CACHE STRING "")
......
...@@ -38,6 +38,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) ...@@ -38,6 +38,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
SET(sources ${ARG_DEFAULT_ARGS}) SET(sources ${ARG_DEFAULT_ARGS})
ADD_VERSION_INFO(${target} EXECUTABLE sources) ADD_VERSION_INFO(${target} EXECUTABLE sources)
IF(MSVC)
# Add compatibility manifest, to fix GetVersionEx on Windows 8.1 and later
IF (CMAKE_VERSION VERSION_GREATER 3.3)
SET(sources ${sources} ${PROJECT_SOURCE_DIR}/cmake/win_compatibility.manifest)
ENDIF()
ENDIF()
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install # tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL) IF(NOT ARG_EXCLUDE_FROM_ALL)
......
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista and Windows Server 2008 -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 and Windows Server 2008 R2 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 and Windows Server 2012 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 and Windows Server 2012 R2 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</asmv1:assembly>
...@@ -646,8 +646,7 @@ extern File my_create_with_symlink(const char *linkname, const char *filename, ...@@ -646,8 +646,7 @@ extern File my_create_with_symlink(const char *linkname, const char *filename,
myf MyFlags); myf MyFlags);
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags); extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
extern int my_symlink(const char *content, const char *linkname, myf MyFlags); extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
extern int my_handler_delete_with_symlink(PSI_file_key key, const char *name, extern int my_handler_delete_with_symlink(const char *filename, myf sync_dir);
const char *ext, myf sync_dir);
extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags); extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags);
extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset, extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset,
......
...@@ -441,6 +441,20 @@ ...@@ -441,6 +441,20 @@
inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5)
#endif #endif
/**
@def mysql_file_delete_with_symlink(K, P1, P2, P3)
Instrumented delete with symbolic link.
@c mysql_file_delete_with_symlink is a replacement
for @c my_handler_delete_with_symlink.
*/
#ifdef HAVE_PSI_FILE_INTERFACE
#define mysql_file_delete_with_symlink(K, P1, P2, P3) \
inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2, P3)
#else
#define mysql_file_delete_with_symlink(K, P1, P2, P3) \
inline_mysql_file_delete_with_symlink(P1, P2, P3)
#endif
/** /**
@def mysql_file_rename_with_symlink(K, P1, P2, P3) @def mysql_file_rename_with_symlink(K, P1, P2, P3)
Instrumented rename with symbolic link. Instrumented rename with symbolic link.
...@@ -1294,6 +1308,7 @@ inline_mysql_file_rename( ...@@ -1294,6 +1308,7 @@ inline_mysql_file_rename(
return result; return result;
} }
static inline File static inline File
inline_mysql_file_create_with_symlink( inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE #ifdef HAVE_PSI_FILE_INTERFACE
...@@ -1324,6 +1339,35 @@ inline_mysql_file_create_with_symlink( ...@@ -1324,6 +1339,35 @@ inline_mysql_file_create_with_symlink(
} }
static inline int
inline_mysql_file_delete_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
PSI_file_key key, const char *src_file, uint src_line,
#endif
const char *name, const char *ext, myf flags)
{
int result;
char buf[FN_REFLEN];
char *fullname= fn_format(buf, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT);
#ifdef HAVE_PSI_FILE_INTERFACE
struct PSI_file_locker *locker;
PSI_file_locker_state state;
locker= PSI_FILE_CALL(get_thread_file_name_locker)
(&state, key, PSI_FILE_DELETE, fullname, &locker);
if (likely(locker != NULL))
{
PSI_FILE_CALL(start_file_close_wait)(locker, src_file, src_line);
result= my_handler_delete_with_symlink(fullname, flags);
PSI_FILE_CALL(end_file_close_wait)(locker, result);
return result;
}
#endif
result= my_handler_delete_with_symlink(fullname, flags);
return result;
}
static inline int static inline int
inline_mysql_file_rename_with_symlink( inline_mysql_file_rename_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE #ifdef HAVE_PSI_FILE_INTERFACE
......
...@@ -2474,6 +2474,19 @@ select 1 from dual where null not in (select 1 from t2); ...@@ -2474,6 +2474,19 @@ select 1 from dual where null not in (select 1 from t2);
1 1
1 1
drop table t1,t2; drop table t1,t2;
#
# MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))'
# failed with SELECT SQ, TEXT field
#
CREATE TABLE t1 (a VARCHAR(8), KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('foo'),( 'bar');
CREATE TABLE t2 (b VARCHAR(8), c TINYTEXT, KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('baz','baz'),('qux', 'qux');
SELECT ( SELECT COUNT(*) FROM t1 WHERE a = c ) AS field, COUNT(DISTINCT c)
FROM t2 WHERE b <= 'quux' GROUP BY field;
field COUNT(DISTINCT c)
0 1
drop table t1,t2;
SET optimizer_switch= @@global.optimizer_switch; SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size; set @@tmp_table_size= @@global.tmp_table_size;
# #
......
...@@ -14,7 +14,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; ...@@ -14,7 +14,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go';
select * from t1; select * from t1;
set debug_sync='now WAIT_FOR ok'; set debug_sync='now WAIT_FOR ok';
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MAD' not found (Errcode: 20 "Not a directory") ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MAD' not found (Errcode: 20 <errmsg>)
flush tables; flush tables;
drop table if exists t1; drop table if exists t1;
create table t1 (a int, b char(16), index (a)) create table t1 (a int, b char(16), index (a))
...@@ -32,7 +32,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; ...@@ -32,7 +32,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run';
select a from t1; select a from t1;
set debug_sync='now WAIT_FOR waiting'; set debug_sync='now WAIT_FOR waiting';
set debug_sync='now SIGNAL run'; set debug_sync='now SIGNAL run';
ERROR HY000: Can't find file: './test/t1.MAI' (errno: 20 "Not a directory") ERROR HY000: Can't find file: './test/t1.MAI' (errno: 20 <errmsg>)
flush tables; flush tables;
drop table if exists t1; drop table if exists t1;
drop table mysql.t1; drop table mysql.t1;
......
...@@ -13,7 +13,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; ...@@ -13,7 +13,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go';
select * from t1; select * from t1;
set debug_sync='now WAIT_FOR ok'; set debug_sync='now WAIT_FOR ok';
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MYD' not found (Errcode: 20 "Not a directory") ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MYD' not found (Errcode: 20 <errmsg>)
flush tables; flush tables;
drop table if exists t1; drop table if exists t1;
create table t1 (a int, b char(16), index (a)) create table t1 (a int, b char(16), index (a))
...@@ -31,7 +31,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; ...@@ -31,7 +31,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run';
select a from t1; select a from t1;
set debug_sync='now WAIT_FOR waiting'; set debug_sync='now WAIT_FOR waiting';
set debug_sync='now SIGNAL run'; set debug_sync='now SIGNAL run';
ERROR HY000: Can't find file: './test/t1.MYI' (errno: 20 "Not a directory") ERROR HY000: Can't find file: './test/t1.MYI' (errno: 20 <errmsg>)
flush tables; flush tables;
drop table if exists t1; drop table if exists t1;
drop table mysql.t1; drop table mysql.t1;
......
...@@ -316,6 +316,3 @@ id title ...@@ -316,6 +316,3 @@ id title
13 lòve 13 lòve
14 LÒVE 14 LÒVE
DROP TABLE articles; DROP TABLE articles;
SET SESSION innodb_ft_enable_stopword=1;
SET GLOBAL innodb_ft_server_stopword_table=default;
SET SESSION innodb_ft_user_stopword_table=default;
...@@ -2,16 +2,8 @@ ...@@ -2,16 +2,8 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
# Valgrind would complain about memory leaks when we crash on purpose. # Embedded server tests do not support restarting
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc --source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
let $innodb_ft_server_stopword_table_orig=`SELECT @@innodb_ft_server_stopword_table`;
let $innodb_ft_enable_stopword_orig=`SELECT @@innodb_ft_enable_stopword`;
let $innodb_ft_user_stopword_table_orig=`SELECT @@innodb_ft_user_stopword_table`;
SELECT @@innodb_ft_server_stopword_table; SELECT @@innodb_ft_server_stopword_table;
SELECT @@innodb_ft_enable_stopword; SELECT @@innodb_ft_enable_stopword;
...@@ -414,8 +406,3 @@ SELECT * FROM articles WHERE MATCH (title) ...@@ -414,8 +406,3 @@ SELECT * FROM articles WHERE MATCH (title)
AGAINST ('love' IN NATURAL LANGUAGE MODE); AGAINST ('love' IN NATURAL LANGUAGE MODE);
DROP TABLE articles; DROP TABLE articles;
# Restore Values
eval SET SESSION innodb_ft_enable_stopword=$innodb_ft_enable_stopword_orig;
eval SET GLOBAL innodb_ft_server_stopword_table=default;
eval SET SESSION innodb_ft_user_stopword_table=default;
...@@ -2016,6 +2016,22 @@ select 1 from dual where null not in (select 1 from t1); ...@@ -2016,6 +2016,22 @@ select 1 from dual where null not in (select 1 from t1);
select 1 from dual where null not in (select 1 from t2); select 1 from dual where null not in (select 1 from t2);
drop table t1,t2; drop table t1,t2;
--echo #
--echo # MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))'
--echo # failed with SELECT SQ, TEXT field
--echo #
CREATE TABLE t1 (a VARCHAR(8), KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('foo'),( 'bar');
CREATE TABLE t2 (b VARCHAR(8), c TINYTEXT, KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('baz','baz'),('qux', 'qux');
SELECT ( SELECT COUNT(*) FROM t1 WHERE a = c ) AS field, COUNT(DISTINCT c)
FROM t2 WHERE b <= 'quux' GROUP BY field;
drop table t1,t2;
SET optimizer_switch= @@global.optimizer_switch; SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size; set @@tmp_table_size= @@global.tmp_table_size;
......
...@@ -25,7 +25,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo; ...@@ -25,7 +25,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo;
exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo; exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo;
set debug_sync='now SIGNAL go'; set debug_sync='now SIGNAL go';
connection default; connection default;
replace_regex / '.*\/tmp\// 'MYSQLTEST_VARDIR\/tmp\// /31/20/; replace_regex / '.*\/tmp\// 'MYSQLTEST_VARDIR\/tmp\// /31/20/ /40/20/ /20.*/20 <errmsg>)/;
error 29; error 29;
reap; reap;
flush tables; flush tables;
...@@ -49,7 +49,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo; ...@@ -49,7 +49,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo;
exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo; exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo;
set debug_sync='now SIGNAL run'; set debug_sync='now SIGNAL run';
connection default; connection default;
replace_regex / '.*\/test\// '.\/test\// /31/20/; replace_regex / '.*\/test\// '.\/test\// /31/20/ /40/20/ /20.*/20 <errmsg>)/;
error ER_FILE_NOT_FOUND; error ER_FILE_NOT_FOUND;
reap; reap;
flush tables; flush tables;
......
...@@ -170,22 +170,20 @@ int my_rename_with_symlink(const char *from, const char *to, myf MyFlags) ...@@ -170,22 +170,20 @@ int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
in this case both the symlink and the symlinked file are deleted, in this case both the symlink and the symlinked file are deleted,
but only if the symlinked file is not in the datadir. but only if the symlinked file is not in the datadir.
*/ */
int my_handler_delete_with_symlink(PSI_file_key key, const char *name, int my_handler_delete_with_symlink(const char *filename, myf sync_dir)
const char *ext, myf sync_dir)
{ {
char orig[FN_REFLEN], real[FN_REFLEN]; char real[FN_REFLEN];
int res= 0; int res= 0;
DBUG_ENTER("my_handler_delete_with_symlink"); DBUG_ENTER("my_handler_delete_with_symlink");
fn_format(orig, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT); if (my_is_symlink(filename))
if (my_is_symlink(orig))
{ {
/* /*
Delete the symlinked file only if the symlink is not Delete the symlinked file only if the symlink is not
pointing into datadir. pointing into datadir.
*/ */
if (!(my_realpath(real, orig, MYF(0)) || mysys_test_invalid_symlink(real))) if (!(my_realpath(real, filename, MYF(0)) || mysys_test_invalid_symlink(real)))
res= mysql_file_delete(key, real, MYF(MY_NOSYMLINKS | sync_dir)); res= my_delete(real, MYF(MY_NOSYMLINKS | sync_dir));
} }
DBUG_RETURN(mysql_file_delete(key, orig, MYF(sync_dir)) || res); DBUG_RETURN(my_delete(filename, MYF(sync_dir)) || res);
} }
...@@ -3356,6 +3356,7 @@ void handler::print_error(int error, myf errflag) ...@@ -3356,6 +3356,7 @@ void handler::print_error(int error, myf errflag)
break; break;
case ENOENT: case ENOENT:
case ENOTDIR: case ENOTDIR:
case ELOOP:
textno=ER_FILE_NOT_FOUND; textno=ER_FILE_NOT_FOUND;
break; break;
case ENOSPC: case ENOSPC:
...@@ -3840,7 +3841,7 @@ int handler::delete_table(const char *name) ...@@ -3840,7 +3841,7 @@ int handler::delete_table(const char *name)
for (const char **ext=bas_ext(); *ext ; ext++) for (const char **ext=bas_ext(); *ext ; ext++)
{ {
if (my_handler_delete_with_symlink(key_file_misc, name, *ext, 0)) if (mysql_file_delete_with_symlink(key_file_misc, name, *ext, 0))
{ {
if (my_errno != ENOENT) if (my_errno != ENOENT)
{ {
......
...@@ -4612,6 +4612,11 @@ class Item_copy :public Item ...@@ -4612,6 +4612,11 @@ class Item_copy :public Item
virtual double val_real() = 0; virtual double val_real() = 0;
virtual longlong val_int() = 0; virtual longlong val_int() = 0;
virtual int save_in_field(Field *field, bool no_conversions) = 0; virtual int save_in_field(Field *field, bool no_conversions) = 0;
bool walk(Item_processor processor, bool walk_subquery, uchar *args)
{
return (item->walk(processor, walk_subquery, args)) ||
(this->*processor)(args);
}
}; };
/** /**
......
...@@ -1084,6 +1084,7 @@ bool Master_info_index::init_all_master_info() ...@@ -1084,6 +1084,7 @@ bool Master_info_index::init_all_master_info()
int err_num= 0, succ_num= 0; // The number of success read Master_info int err_num= 0, succ_num= 0; // The number of success read Master_info
char sign[MAX_CONNECTION_NAME+1]; char sign[MAX_CONNECTION_NAME+1];
File index_file_nr; File index_file_nr;
THD *thd;
DBUG_ENTER("init_all_master_info"); DBUG_ENTER("init_all_master_info");
DBUG_ASSERT(master_info_index); DBUG_ASSERT(master_info_index);
...@@ -1115,6 +1116,10 @@ bool Master_info_index::init_all_master_info() ...@@ -1115,6 +1116,10 @@ bool Master_info_index::init_all_master_info()
DBUG_RETURN(1); DBUG_RETURN(1);
} }
thd= new THD; /* Needed by start_slave_threads */
thd->thread_stack= (char*) &thd;
thd->store_globals();
reinit_io_cache(&index_file, READ_CACHE, 0L,0,0); reinit_io_cache(&index_file, READ_CACHE, 0L,0,0);
while (!init_strvar_from_file(sign, sizeof(sign), while (!init_strvar_from_file(sign, sizeof(sign),
&index_file, NULL)) &index_file, NULL))
...@@ -1130,7 +1135,7 @@ bool Master_info_index::init_all_master_info() ...@@ -1130,7 +1135,7 @@ bool Master_info_index::init_all_master_info()
mi->error()) mi->error())
{ {
delete mi; delete mi;
DBUG_RETURN(1); goto error;
} }
init_thread_mask(&thread_mask,mi,0 /*not inverse*/); init_thread_mask(&thread_mask,mi,0 /*not inverse*/);
...@@ -1159,7 +1164,7 @@ bool Master_info_index::init_all_master_info() ...@@ -1159,7 +1164,7 @@ bool Master_info_index::init_all_master_info()
{ {
/* Master_info is not in HASH; Add it */ /* Master_info is not in HASH; Add it */
if (master_info_index->add_master_info(mi, FALSE)) if (master_info_index->add_master_info(mi, FALSE))
DBUG_RETURN(1); goto error;
succ_num++; succ_num++;
mi->unlock_slave_threads(); mi->unlock_slave_threads();
} }
...@@ -1196,14 +1201,14 @@ bool Master_info_index::init_all_master_info() ...@@ -1196,14 +1201,14 @@ bool Master_info_index::init_all_master_info()
/* Master_info was not registered; add it */ /* Master_info was not registered; add it */
if (master_info_index->add_master_info(mi, FALSE)) if (master_info_index->add_master_info(mi, FALSE))
DBUG_RETURN(1); goto error;
succ_num++; succ_num++;
if (!opt_skip_slave_start) if (!opt_skip_slave_start)
{ {
if (start_slave_threads(current_thd, if (start_slave_threads(current_thd,
1 /* need mutex */, 1 /* need mutex */,
0 /* no wait for start*/, 1 /* wait for start*/,
mi, mi,
buf_master_info_file, buf_master_info_file,
buf_relay_log_info_file, buf_relay_log_info_file,
...@@ -1222,6 +1227,8 @@ bool Master_info_index::init_all_master_info() ...@@ -1222,6 +1227,8 @@ bool Master_info_index::init_all_master_info()
mi->unlock_slave_threads(); mi->unlock_slave_threads();
} }
} }
thd->reset_globals();
delete thd;
if (!err_num) // No Error on read Master_info if (!err_num) // No Error on read Master_info
{ {
...@@ -1229,16 +1236,19 @@ bool Master_info_index::init_all_master_info() ...@@ -1229,16 +1236,19 @@ bool Master_info_index::init_all_master_info()
sql_print_information("Reading of all Master_info entries succeded"); sql_print_information("Reading of all Master_info entries succeded");
DBUG_RETURN(0); DBUG_RETURN(0);
} }
else if (succ_num) // Have some Error and some Success if (succ_num) // Have some Error and some Success
{ {
sql_print_warning("Reading of some Master_info entries failed"); sql_print_warning("Reading of some Master_info entries failed");
DBUG_RETURN(2); DBUG_RETURN(2);
} }
else // All failed
{ sql_print_error("Reading of all Master_info entries failed!");
sql_print_error("Reading of all Master_info entries failed!"); DBUG_RETURN(1);
DBUG_RETURN(1);
} error:
thd->reset_globals();
delete thd;
DBUG_RETURN(1);
} }
......
...@@ -1360,11 +1360,10 @@ handle_rpl_parallel_thread(void *arg) ...@@ -1360,11 +1360,10 @@ handle_rpl_parallel_thread(void *arg)
*/ */
rpl_parallel_entry *e= rpt->current_entry; rpl_parallel_entry *e= rpt->current_entry;
/* /*
Ensure that we will unblock rpl_pause_for_ftrwl() Wait for rpl_unpause_after_ftwrl() to wake us up.
e->pause_sub_id may be LONGLONG_MAX if rpt->current_entry has changed Note that rpl_pause_for_ftwrl() may wait for 'e->pause_sub_id'
to change. This should happen eventually in finish_event_group()
*/ */
DBUG_ASSERT(e->pause_sub_id == (uint64)ULONGLONG_MAX ||
e->last_committed_sub_id >= e->pause_sub_id);
mysql_mutex_lock(&e->LOCK_parallel_entry); mysql_mutex_lock(&e->LOCK_parallel_entry);
mysql_mutex_unlock(&rpt->LOCK_rpl_thread); mysql_mutex_unlock(&rpt->LOCK_rpl_thread);
if (rpt->pause_for_ftwrl) if (rpt->pause_for_ftwrl)
......
...@@ -4841,7 +4841,7 @@ WARN_DATA_TRUNCATED 01000 ...@@ -4841,7 +4841,7 @@ WARN_DATA_TRUNCATED 01000
spa "Datos truncados para columna '%s' en la línea %lu" spa "Datos truncados para columna '%s' en la línea %lu"
ER_WARN_USING_OTHER_HANDLER ER_WARN_USING_OTHER_HANDLER
eng "Using storage engine %s for table '%s'" eng "Using storage engine %s for table '%s'"
ger "Für Tabelle '%s' wird Speicher-Engine %s benutzt" ger "Speicher-Engine %s wird für Tabelle '%s' benutzt"
jpn "ストレージエンジン %s が表 '%s' に利用されています。" jpn "ストレージエンジン %s が表 '%s' に利用されています。"
por "Usando engine de armazenamento %s para tabela '%s'" por "Usando engine de armazenamento %s para tabela '%s'"
spa "Usando motor de almacenamiento %s para tabla '%s'" spa "Usando motor de almacenamiento %s para tabla '%s'"
......
...@@ -519,13 +519,22 @@ int init_slave() ...@@ -519,13 +519,22 @@ int init_slave()
if (active_mi->host[0] && !opt_skip_slave_start) if (active_mi->host[0] && !opt_skip_slave_start)
{ {
if (start_slave_threads(0, /* No active thd */ int error;
1 /* need mutex */, THD *thd= new THD;
0 /* no wait for start*/, thd->thread_stack= (char*) &thd;
active_mi, thd->store_globals();
master_info_file,
relay_log_info_file, error= start_slave_threads(0, /* No active thd */
SLAVE_IO | SLAVE_SQL)) 1 /* need mutex */,
1 /* wait for start*/,
active_mi,
master_info_file,
relay_log_info_file,
SLAVE_IO | SLAVE_SQL);
thd->reset_globals();
delete thd;
if (error)
{ {
sql_print_error("Failed to create slave threads"); sql_print_error("Failed to create slave threads");
goto err; goto err;
......
...@@ -846,7 +846,7 @@ mysql_rm_db_internal(THD *thd,char *db, bool if_exists, bool silent) ...@@ -846,7 +846,7 @@ mysql_rm_db_internal(THD *thd,char *db, bool if_exists, bool silent)
if there exists a table with the name 'db', so let's just do it if there exists a table with the name 'db', so let's just do it
separately. We know this file exists and needs to be deleted anyway. separately. We know this file exists and needs to be deleted anyway.
*/ */
if (my_handler_delete_with_symlink(key_file_misc, path, "", MYF(0)) && if (mysql_file_delete_with_symlink(key_file_misc, path, "", MYF(0)) &&
my_errno != ENOENT) my_errno != ENOENT)
{ {
my_error(EE_DELETE, MYF(0), path, my_errno); my_error(EE_DELETE, MYF(0), path, my_errno);
...@@ -1152,7 +1152,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, ...@@ -1152,7 +1152,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
We ignore ENOENT error in order to skip files that was deleted We ignore ENOENT error in order to skip files that was deleted
by concurrently running statement like REPAIR TABLE ... by concurrently running statement like REPAIR TABLE ...
*/ */
if (my_handler_delete_with_symlink(key_file_misc, filePath, "", MYF(0)) && if (mysql_file_delete_with_symlink(key_file_misc, filePath, "", MYF(0)) &&
my_errno != ENOENT) my_errno != ENOENT)
{ {
my_error(EE_DELETE, MYF(0), filePath, my_errno); my_error(EE_DELETE, MYF(0), filePath, my_errno);
...@@ -1268,7 +1268,7 @@ long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path) ...@@ -1268,7 +1268,7 @@ long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path)
continue; continue;
} }
strxmov(filePath, org_path, "/", file->name, NullS); strxmov(filePath, org_path, "/", file->name, NullS);
if (my_handler_delete_with_symlink(key_file_misc, filePath, "", MYF(MY_WME))) if (mysql_file_delete_with_symlink(key_file_misc, filePath, "", MYF(MY_WME)))
{ {
goto err; goto err;
} }
......
...@@ -2200,7 +2200,7 @@ static int mysql_test_handler_read(Prepared_statement *stmt, ...@@ -2200,7 +2200,7 @@ static int mysql_test_handler_read(Prepared_statement *stmt,
THD *thd= stmt->thd; THD *thd= stmt->thd;
LEX *lex= stmt->lex; LEX *lex= stmt->lex;
SQL_HANDLER *ha_table; SQL_HANDLER *ha_table;
DBUG_ENTER("mysql_test_select"); DBUG_ENTER("mysql_test_handler_read");
lex->select_lex.context.resolve_in_select_list= TRUE; lex->select_lex.context.resolve_in_select_list= TRUE;
......
...@@ -571,7 +571,7 @@ enum open_frm_error open_table_def(THD *thd, TABLE_SHARE *share, uint flags) ...@@ -571,7 +571,7 @@ enum open_frm_error open_table_def(THD *thd, TABLE_SHARE *share, uint flags)
{ {
DBUG_ASSERT(flags & GTS_TABLE); DBUG_ASSERT(flags & GTS_TABLE);
DBUG_ASSERT(flags & GTS_USE_DISCOVERY); DBUG_ASSERT(flags & GTS_USE_DISCOVERY);
my_handler_delete_with_symlink(key_file_frm, path, "", MYF(0)); mysql_file_delete_with_symlink(key_file_frm, path, "", MYF(0));
file= -1; file= -1;
} }
else else
......
...@@ -86,13 +86,14 @@ int maria_delete_table_files(const char *name, my_bool temporary, myf sync_dir) ...@@ -86,13 +86,14 @@ int maria_delete_table_files(const char *name, my_bool temporary, myf sync_dir)
{ {
DBUG_ENTER("maria_delete_table_files"); DBUG_ENTER("maria_delete_table_files");
if (my_handler_delete_with_symlink(key_file_kfile, name, MARIA_NAME_IEXT, MYF(MY_WME | sync_dir)) || if (mysql_file_delete_with_symlink(key_file_kfile, name, MARIA_NAME_IEXT, MYF(MY_WME | sync_dir)) ||
my_handler_delete_with_symlink(key_file_dfile, name, MARIA_NAME_DEXT, MYF(MY_WME | sync_dir))) mysql_file_delete_with_symlink(key_file_dfile, name, MARIA_NAME_DEXT, MYF(MY_WME | sync_dir)))
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
if (!temporary) { if (!temporary)
my_handler_delete_with_symlink(key_file_dfile, name, ".TMD", MYF(0)); {
my_handler_delete_with_symlink(key_file_dfile, name, ".OLD", MYF(0)); mysql_file_delete_with_symlink(key_file_dfile, name, ".TMD", MYF(0));
mysql_file_delete_with_symlink(key_file_dfile, name, ".OLD", MYF(0));
} }
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -34,14 +34,14 @@ int mi_delete_table(const char *name) ...@@ -34,14 +34,14 @@ int mi_delete_table(const char *name)
check_table_is_closed(name,"delete"); check_table_is_closed(name,"delete");
#endif #endif
if (my_handler_delete_with_symlink(mi_key_file_kfile, name, MI_NAME_IEXT, MYF(MY_WME)) || if (mysql_file_delete_with_symlink(mi_key_file_kfile, name, MI_NAME_IEXT, MYF(MY_WME)) ||
my_handler_delete_with_symlink(mi_key_file_dfile, name, MI_NAME_DEXT, MYF(MY_WME))) mysql_file_delete_with_symlink(mi_key_file_dfile, name, MI_NAME_DEXT, MYF(MY_WME)))
DBUG_RETURN(my_errno); DBUG_RETURN(my_errno);
// optionally present: // optionally present:
my_handler_delete_with_symlink(mi_key_file_dfile, name, ".OLD", MYF(0)); mysql_file_delete_with_symlink(mi_key_file_dfile, name, ".OLD", MYF(0));
my_handler_delete_with_symlink(mi_key_file_dfile, name, ".TMD", MYF(0)); mysql_file_delete_with_symlink(mi_key_file_dfile, name, ".TMD", MYF(0));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -51,7 +51,7 @@ IF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 ) ...@@ -51,7 +51,7 @@ IF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 )
SET(WIX_MSVC_SUFFIX "VS2010") SET(WIX_MSVC_SUFFIX "VS2010")
ELSEIF(MSVC_VERSION EQUAL 1800) ELSEIF(MSVC_VERSION EQUAL 1800)
SET(WIX_MSVC_SUFFIX "VS2013") SET(WIX_MSVC_SUFFIX "VS2013")
ELSEIF (MSVC_VERSION EQUAL 1900) ELSE()
SET(WIX_MSVC_SUFFIX "VS2015") SET(WIX_MSVC_SUFFIX "VS2015")
ENDIF() ENDIF()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment