Skip to content

Commit

Permalink
Merge branch '5.5' into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cvicentiu committed Jan 12, 2017
2 parents 9a4bc0d + ab93a4d commit 1c5ca7c
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ support-files/mysql.spec
support-files/mysqld_multi.server
support-files/wsrep.cnf
support-files/wsrep_notify
support-files/SELinux/centos6-mariadb.pp
tags
tests/async_queries
tests/bug25714
Expand Down
10 changes: 10 additions & 0 deletions mysql-test/r/ctype_ucs.result
Original file line number Diff line number Diff line change
Expand Up @@ -4550,6 +4550,16 @@ SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _ucs2 0x0061));
CHAR_LENGTH(TRIM(BOTH 0x00 FROM _ucs2 0x0061))
1
#
# MDEV-11685: sql_mode can't be set with non-ascii connection charset
#
SET character_set_connection=ucs2;
SET sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;
@@sql_mode
NO_ENGINE_SUBSTITUTION
SET sql_mode=DEFAULT;
SET NAMES utf8;
#
# End of 5.5 tests
#
#
Expand Down
10 changes: 10 additions & 0 deletions mysql-test/r/ctype_utf16.result
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,16 @@ ERROR HY000: Invalid utf16 character string: 'DE9899'
DO LPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 10000, 0x0061DE989999);
ERROR HY000: Invalid utf16 character string: 'DE9899'
#
# MDEV-11685: sql_mode can't be set with non-ascii connection charset
#
SET character_set_connection=utf16;
SET sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;
@@sql_mode
NO_ENGINE_SUBSTITUTION
SET sql_mode=DEFAULT;
SET NAMES utf8;
#
# End of 5.5 tests
#
#
Expand Down
10 changes: 10 additions & 0 deletions mysql-test/r/ctype_utf32.result
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,16 @@ select hex(lower(cast(0xffff0000 as char character set utf32))) as c;
c
FFFF0000
#
# MDEV-11685: sql_mode can't be set with non-ascii connection charset
#
SET character_set_connection=utf32;
SET sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;
@@sql_mode
NO_ENGINE_SUBSTITUTION
SET sql_mode=DEFAULT;
SET NAMES utf8;
#
# End of 5.5 tests
#
#
Expand Down
8 changes: 8 additions & 0 deletions mysql-test/t/ctype_ucs.test
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,14 @@ SELECT CHAR_LENGTH(TRIM(BOTH 0x0001 FROM _ucs2 0x0061));
SELECT CHAR_LENGTH(TRIM(BOTH 0x61 FROM _ucs2 0x0061));
SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _ucs2 0x0061));

--echo #
--echo # MDEV-11685: sql_mode can't be set with non-ascii connection charset
--echo #
SET character_set_connection=ucs2;
SET sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;
SET sql_mode=DEFAULT;
SET NAMES utf8;

--echo #
--echo # End of 5.5 tests
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/t/ctype_utf16.test
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,15 @@ DO RPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 10000, 0x0061DE989999);
--error ER_INVALID_CHARACTER_STRING
DO LPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 10000, 0x0061DE989999);

--echo #
--echo # MDEV-11685: sql_mode can't be set with non-ascii connection charset
--echo #
SET character_set_connection=utf16;
SET sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;
SET sql_mode=DEFAULT;
SET NAMES utf8;

--echo #
--echo # End of 5.5 tests
--echo #
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/t/ctype_utf32.test
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,15 @@ SELECT CHAR_LENGTH(TRIM(BOTH 0x00 FROM _utf32 0x00000061));
#
select hex(lower(cast(0xffff0000 as char character set utf32))) as c;

--echo #
--echo # MDEV-11685: sql_mode can't be set with non-ascii connection charset
--echo #
SET character_set_connection=utf32;
SET sql_mode='NO_ENGINE_SUBSTITUTION';
SELECT @@sql_mode;
SET sql_mode=DEFAULT;
SET NAMES utf8;

--echo #
--echo # End of 5.5 tests
--echo #
Expand Down
9 changes: 7 additions & 2 deletions scripts/mysqld_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,13 @@ max_fast_restarts=5
have_sleep=1

# close stdout and stderr, everything goes to $logging now
exec 1>&-
exec 2>&-
if expr "${-}" : '.*x' > /dev/null
then
:
else
exec 1>&-
exec 2>&-
fi

while true
do
Expand Down
2 changes: 1 addition & 1 deletion sql/sys_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ class Sys_var_set: public Sys_var_typelib

if (var->value->result_type() == STRING_RESULT)
{
if (!(res=var->value->val_str(&str)))
if (!(res=var->value->val_str_ascii(&str)))
return true;
else
{
Expand Down
2 changes: 1 addition & 1 deletion support-files/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ IF(UNIX)
ENDFOREACH()
IF(INSTALL_SUPPORTFILESDIR)
INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles)
INSTALL(DIRECTORY RHEL4-SElinux/ DESTINATION ${inst_location}/SELinux/RHEL4 COMPONENT SupportFiles)
ADD_SUBDIRECTORY(SELinux)
ENDIF()

INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
Expand Down
35 changes: 35 additions & 0 deletions support-files/SELinux/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2017, MariaDB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

FIND_PROGRAM(CHECKMODULE checkmodule)
FIND_PROGRAM(SEMODULE_PACKAGE semodule_package)
MARK_AS_ADVANCED(CHECKMODULE SEMODULE_PACKAGE)

SET(params DESTINATION ${INSTALL_SUPPORTFILESDIR}/SELinux COMPONENT SupportFiles)

IF(CHECKMODULE AND SEMODULE_PACKAGE)
FOREACH(pol centos6-mariadb)
SET(src ${CMAKE_CURRENT_SOURCE_DIR}/${pol}.te)
SET(mod ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${pol}-pp.dir/${pol}.mod)
SET(out ${CMAKE_CURRENT_BINARY_DIR}/${pol}.pp)
ADD_CUSTOM_COMMAND(OUTPUT ${out}
COMMAND ${CHECKMODULE} -M -m ${src} -o ${mod}
COMMAND ${SEMODULE_PACKAGE} -m ${mod} -o ${out}
DEPENDS ${src})
ADD_CUSTOM_TARGET(${pol}-pp ALL DEPENDS ${out})
INSTALL(FILES ${out} ${params})
ENDFOREACH()
ENDIF()
INSTALL(FILES centos6-mariadb.te rhel4-mysql.fc rhel4-mysql.te ${params})
9 changes: 9 additions & 0 deletions support-files/SELinux/centos6-mariadb.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module mariadb 1.0;

require {
type mysqld_safe_t;
class capability { setuid setgid };
}

#============= mysqld_safe_t ==============
allow mysqld_safe_t self:capability { setuid setgid };
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion support-files/rpm/server-postin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ if [ -f /etc/redhat-release ] ; then
echo ' make load'
echo
echo
fi
fi
if grep 'CentOS release 6' /etc/redhat-release >/dev/null 2>&1; then
if [ -x /usr/sbin/semodule ] ; then
/usr/sbin/semodule -i /usr/share/mysql/SELinux/centos6-mariadb.pp
fi
fi
fi

if [ -x sbin/restorecon ] ; then
Expand Down

0 comments on commit 1c5ca7c

Please sign in to comment.