Skip to content

Commit

Permalink
Merge branch '10.0' into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Mar 21, 2017
2 parents bbf0c9d + 0d622be commit 09a2107
Show file tree
Hide file tree
Showing 27 changed files with 184 additions and 588 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,9 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
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)

# MDEV-6526 these files are not installed anymore
#INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
Expand Down
516 changes: 0 additions & 516 deletions COPYING.LESSER

This file was deleted.

2 changes: 2 additions & 0 deletions cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,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 "")
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
Expand Down
8 changes: 8 additions & 0 deletions cmake/mysql_add_executable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)

SET(sources ${ARG_DEFAULT_ARGS})
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})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)
Expand Down
22 changes: 22 additions & 0 deletions cmake/win_compatibility.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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>
3 changes: 1 addition & 2 deletions include/my_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,7 @@ extern File my_create_with_symlink(const char *linkname, const char *filename,
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_handler_delete_with_symlink(PSI_file_key key, const char *name,
const char *ext, myf sync_dir);
extern int my_handler_delete_with_symlink(const char *filename, myf sync_dir);

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,
Expand Down
44 changes: 44 additions & 0 deletions include/mysql/psi/mysql_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,20 @@
inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5)
#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)
Instrumented rename with symbolic link.
Expand Down Expand Up @@ -1294,6 +1308,7 @@ inline_mysql_file_rename(
return result;
}


static inline File
inline_mysql_file_create_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
Expand Down Expand Up @@ -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
inline_mysql_file_rename_with_symlink(
#ifdef HAVE_PSI_FILE_INTERFACE
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/r/subselect4.result
Original file line number Diff line number Diff line change
Expand Up @@ -2474,6 +2474,19 @@ select 1 from dual where null not in (select 1 from t2);
1
1
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 @@tmp_table_size= @@global.tmp_table_size;
#
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/symlink-aria-11902.result
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go';
select * from t1;
set debug_sync='now WAIT_FOR ok';
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;
drop table if exists t1;
create table t1 (a int, b char(16), index (a))
Expand All @@ -32,7 +32,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run';
select a from t1;
set debug_sync='now WAIT_FOR waiting';
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;
drop table if exists t1;
drop table mysql.t1;
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/symlink-myisam-11902.result
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go';
select * from t1;
set debug_sync='now WAIT_FOR ok';
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;
drop table if exists t1;
create table t1 (a int, b char(16), index (a))
Expand All @@ -31,7 +31,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run';
select a from t1;
set debug_sync='now WAIT_FOR waiting';
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;
drop table if exists t1;
drop table mysql.t1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,3 @@ id title
13 lòve
14 LÒVE
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;
15 changes: 1 addition & 14 deletions mysql-test/suite/innodb_fts/t/innodb_fts_stopword_charset.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@

-- source include/have_innodb.inc

# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
# Embedded server tests do not support restarting
--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_enable_stopword;
Expand Down Expand Up @@ -414,8 +406,3 @@ SELECT * FROM articles WHERE MATCH (title)
AGAINST ('love' IN NATURAL LANGUAGE MODE);

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;
16 changes: 16 additions & 0 deletions mysql-test/t/subselect4.test
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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 @@tmp_table_size= @@global.tmp_table_size;

Expand Down
4 changes: 2 additions & 2 deletions mysql-test/t/symlink-myisam-11902.test
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo;
exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo;
set debug_sync='now SIGNAL go';
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;
reap;
flush tables;
Expand All @@ -49,7 +49,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo;
exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo;
set debug_sync='now SIGNAL run';
connection default;
replace_regex / '.*\/test\// '.\/test\// /31/20/;
replace_regex / '.*\/test\// '.\/test\// /31/20/ /40/20/ /20.*/20 <errmsg>)/;
error ER_FILE_NOT_FOUND;
reap;
flush tables;
Expand Down
14 changes: 6 additions & 8 deletions mysys/my_symlink2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
but only if the symlinked file is not in the datadir.
*/
int my_handler_delete_with_symlink(PSI_file_key key, const char *name,
const char *ext, myf sync_dir)
int my_handler_delete_with_symlink(const char *filename, myf sync_dir)
{
char orig[FN_REFLEN], real[FN_REFLEN];
char real[FN_REFLEN];
int res= 0;
DBUG_ENTER("my_handler_delete_with_symlink");

fn_format(orig, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT);
if (my_is_symlink(orig))
if (my_is_symlink(filename))
{
/*
Delete the symlinked file only if the symlink is not
pointing into datadir.
*/
if (!(my_realpath(real, orig, MYF(0)) || mysys_test_invalid_symlink(real)))
res= mysql_file_delete(key, real, MYF(MY_NOSYMLINKS | sync_dir));
if (!(my_realpath(real, filename, MYF(0)) || mysys_test_invalid_symlink(real)))
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);
}
3 changes: 2 additions & 1 deletion sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3356,6 +3356,7 @@ void handler::print_error(int error, myf errflag)
break;
case ENOENT:
case ENOTDIR:
case ELOOP:
textno=ER_FILE_NOT_FOUND;
break;
case ENOSPC:
Expand Down Expand Up @@ -3840,7 +3841,7 @@ int handler::delete_table(const char *name)

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)
{
Expand Down
5 changes: 5 additions & 0 deletions sql/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -4612,6 +4612,11 @@ class Item_copy :public Item
virtual double val_real() = 0;
virtual longlong val_int() = 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);
}
};

/**
Expand Down
Loading

0 comments on commit 09a2107

Please sign in to comment.