Skip to content

SUSE patches we keep against 5.7 #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions client/upgrade/program.cc
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,14 @@ class Program : public Base::Abstract_connection_program
*/
int get_upgrade_info_file_name(char* name)
{
string datadir;
int res= Show_variable_query_extractor::get_variable_value(
this->m_query_runner, "datadir", &datadir);
if (res != 0)
{
return res;
static string datadir;
if(datadir.empty()) {
int res= Show_variable_query_extractor::get_variable_value(
this->m_query_runner, "datadir", &datadir);
if (res != 0)
{
return res;
}
}

fn_format(name, "mysql_upgrade_info", datadir.c_str(), "", MYF(0));
Expand Down
2 changes: 1 addition & 1 deletion libservices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ SET(MYSQLSERVICES_SOURCES
rpl_transaction_ctx_service.c
rpl_transaction_write_set_service.c)

ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
ADD_LIBRARY(mysqlservices STATIC ${MYSQLSERVICES_SOURCES})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
1 change: 1 addition & 0 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ ENDIF()

SET(HOSTNAME "hostname")
SET(MYSQLD_USER "mysql")
SET(MYSQLD_GROUP "mysql")

ENDIF(UNIX)

Expand Down
2 changes: 1 addition & 1 deletion scripts/mysql_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fi

version='@VERSION@'
socket='@MYSQL_UNIX_ADDR@'
ldflags='@LDFLAGS@'
ldflags='@SAVE_LDFLAGS@'

if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
port=0
Expand Down
22 changes: 19 additions & 3 deletions scripts/mysql_install_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ args=""
defaults=""
mysqld_opt=""
user=""
group=""

force=0
in_rpm=0
Expand Down Expand Up @@ -68,6 +69,11 @@ Usage: $0 [OPTIONS]
user. You must be root to use this option. By default
mysqld runs using your current login name and files and
directories that it creates will be owned by you.
--group=group_name The login group to use for running mysqld. Files and
directories created by mysqld will be owned by this
group. You must be root to use this option. By default
mysqld runs using your current group and files and
directories that it creates will be owned by you.

All other options are passed to the mysqld program

Expand Down Expand Up @@ -108,11 +114,11 @@ parse_arguments()
--builddir=*) builddir=`parse_arg "$arg"` ;;
--srcdir=*) srcdir=`parse_arg "$arg"` ;;
--ldata=*|--datadir=*) ldata=`parse_arg "$arg"` ;;
--user=*)
# Note that the user will be passed to mysqld so that it runs
# as 'user' (crucial e.g. if log-bin=/some_other_path/
# where a chown of datadir won't help)
user=`parse_arg "$arg"` ;;
--user=*) user=`parse_arg "$arg"` ;;
--group=*) group=`parse_arg "$arg"` ;;
--skip-name-resolve) ip_only=1 ;;
--verbose) verbose=1 ;; # Obsolete
--rpm) in_rpm=1 ;;
Expand Down Expand Up @@ -365,7 +371,12 @@ do
fi
if test -n "$user"
then
chown $user $dir
if test -z "$group"
then
chown $user $dir
else
chown $user:$group $dir
fi
if test $? -ne 0
then
echo "Cannot change ownership of the database directories to the '$user'"
Expand All @@ -380,6 +391,11 @@ then
args="$args --user=$user"
fi

if test -n "$group"
then
args="$args --group=$group"
fi

# When doing a "cross bootstrap" install, no reference to the current
# host should be added to the system tables. So we filter out any
# lines which contain the current host name.
Expand Down
17 changes: 15 additions & 2 deletions scripts/mysqld_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ logging=init
want_syslog=0
syslog_tag=
user='@MYSQLD_USER@'
group='@MYSQLD_GROUP@'
pid_file=
err_log=

Expand Down Expand Up @@ -196,6 +197,7 @@ parse_arguments() {
--pid-file=*) pid_file="$val" ;;
--plugin-dir=*) PLUGIN_DIR="$val" ;;
--user=*) user="$val"; SET_USER=1 ;;
--group=*) group="$val"; SET_USER=1 ;;

# these might have been set in a [mysqld_safe] section of my.cnf
# they are added to mysqld command line to override settings from my.cnf
Expand Down Expand Up @@ -619,11 +621,17 @@ then
if test "$user" != "root" -o $SET_USER = 1
then
USER_OPTION="--user=$user"
GROUP_OPTION="--group=$group"
fi
# Change the err log to the right user, if it is in use
if [ $want_syslog -eq 0 ]; then
touch "$err_log"
chown $user "$err_log"
if [ "$user" -a "$group" ]; then
chown $user:$group $err_log
else
[ "$user" ] && chown $user $err_log
[ "$group" ] && chgrp $group $err_log
fi
fi
if test -n "$open_files"
then
Expand All @@ -642,7 +650,12 @@ mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
mkdir $mysql_unix_port_dir
chown $user $mysql_unix_port_dir
if [ "$user" -a "$group" ]; then
chown $user:$group $mysql_unix_port_dir
else
[ "$user" ] && chown $user $mysql_unix_port_dir
[ "$group" ] && chgrp $group $mysql_unix_port_dir
fi
chmod 755 $mysql_unix_port_dir
fi

Expand Down
8 changes: 4 additions & 4 deletions sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ SET (BINLOG_SOURCE rpl_gtid_misc.cc
log_event.cc log_event_old.cc binlog.cc sql_binlog.cc
rpl_filter.cc rpl_record.cc rpl_record_old.cc
rpl_utility.cc rpl_injector.cc rpl_table_access.cc)
ADD_LIBRARY(binlog ${BINLOG_SOURCE})
ADD_LIBRARY(binlog STATIC ${BINLOG_SOURCE})
TARGET_LINK_LIBRARIES(binlog binlogevents_static)

SET (RPL_SOURCE rpl_handler.cc rpl_tblmap.cc rpl_context.cc)
ADD_DEPENDENCIES(binlog GenError)
ADD_LIBRARY(rpl ${RPL_SOURCE})
ADD_LIBRARY(rpl STATIC ${RPL_SOURCE})
SET (MASTER_SOURCE rpl_master.cc rpl_binlog_sender.cc)
ADD_DEPENDENCIES(rpl GenError)
ADD_LIBRARY(master ${MASTER_SOURCE})
ADD_LIBRARY(master STATIC ${MASTER_SOURCE})
ADD_DEPENDENCIES(master GenError)
SET (SLAVE_SOURCE rpl_slave.cc rpl_reporting.cc rpl_mi.cc rpl_rli.cc
rpl_info_handler.cc rpl_info_file.cc
Expand All @@ -372,7 +372,7 @@ SET (SLAVE_SOURCE rpl_slave.cc rpl_reporting.cc rpl_mi.cc rpl_rli.cc
rpl_rli_pdb.cc rpl_info_dummy.cc rpl_mts_submode.cc
rpl_slave_commit_order_manager.cc rpl_msr.cc
rpl_trx_boundary_parser.cc rpl_channel_service_interface.cc)
ADD_LIBRARY(slave ${SLAVE_SOURCE})
ADD_LIBRARY(slave STATIC ${SLAVE_SOURCE})
ADD_DEPENDENCIES(slave GenError)

######################### GUnit Lib #################################
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/row/row0log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2684,7 +2684,7 @@ row_log_table_apply_ops(
and be ignored when the operation is unsupported. */
fallocate(index->online_log->fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
ofs, srv_buf_size);
ofs, srv_sort_buf_size);
#endif /* FALLOC_FL_PUNCH_HOLE */

next_mrec = index->online_log->head.block;
Expand Down Expand Up @@ -3521,7 +3521,7 @@ row_log_apply_ops(
and be ignored when the operation is unsupported. */
fallocate(index->online_log->fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
ofs, srv_buf_size);
ofs, srv_sort_buf_size);
#endif /* FALLOC_FL_PUNCH_HOLE */

next_mrec = index->online_log->head.block;
Expand Down
1 change: 1 addition & 0 deletions support-files/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ELSE()
SET(CFLAGS ${CMAKE_C_FLAGS})
SET(CXXFLAGS ${CMAKE_CXX_FLAGS})
SET(MYSQLD_USER "mysql")
SET(MYSQLD_GROUP "mysql")
SET(ini_file_extension "cnf")
SET(HOSTNAME "hostname")
SET(CNF_SOCKET_LINE "# socket = .....")
Expand Down