import mariadb-10.0.15-4.el6

This commit is contained in:
Karanbir Singh 2015-01-15 13:19:27 +00:00
parent 5da7772673
commit 4b7078bf0d
39 changed files with 2973 additions and 5 deletions

1
.mariadb.metadata Normal file
View file

@ -0,0 +1 @@
9154cb68504d469b1bac636b85e30b2b2da2586092476d6ad2f9d6bc462909d8 SOURCES/mariadb-10.0.15.tar.gz

View file

@ -1,5 +0,0 @@
The master branch has no content
Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6
If you find this file in a distro specific branch, it means that no content has been checked in yet

13
SOURCES/README.mysql-cnf Normal file
View file

@ -0,0 +1,13 @@
This directory contains prepared configuration files with .cnf extension,
which provide a configuration for some common MariaDB deployment scenarios.
These configuration files do not include the default configuration of datadir,
log-file and pid-file locations, as specified in the default my.cnf file,
provided in this distribution.
Thus, it is recommended to use these configuration files as an addition to the
default my.cnf configuration file.
Since default my.cnf contains `!includedir @INSTALL_SYSCONF2DIR@` directive, it is
recommended to copy required configuration under @INSTALL_SYSCONF2DIR@ directory,
so the default my.cnf specifications will be extended.

View file

@ -0,0 +1,4 @@
The official MySQL documentation is not freely redistributable, so we cannot
include it in RHEL or Fedora. You can find it on-line at
http://dev.mysql.com/doc/

View file

@ -0,0 +1,9 @@
MySQL is distributed under GPL v2, but there are some licensing exceptions
that allow the client libraries to be linked with a non-GPL application,
so long as the application is under a license approved by Oracle.
For details see
http://www.mysql.com/about/legal/licensing/foss-exception/
Some innobase code from Percona and Google is under BSD license.
Some code related to test-suite is under LGPLv2.

View file

@ -0,0 +1,16 @@
Don't guess basedir in mysql_config; we place it under _libdir because
of multilib conflicts, so use rather configured @prefix@ path directly.
diff -up mariadb-10.0.13/scripts/mysql_config.sh.patch32 mariadb-10.0.13/scripts/mysql_config.sh
--- mariadb-10.0.13/scripts/mysql_config.sh.patch32 2014-08-13 17:28:51.174776518 +0200
+++ mariadb-10.0.13/scripts/mysql_config.sh 2014-08-13 17:32:18.205275028 +0200
@@ -76,8 +76,7 @@ get_full_path ()
me=`get_full_path $0`
-# Script might have been renamed but assume mysql_<something>config<something>
-basedir=`echo $me | sed -e 's;/bin/mysql_.*config.*;;'`
+basedir='@prefix@'
ldata='@localstatedir@'
execdir='@libexecdir@'

View file

@ -0,0 +1,16 @@
This issue has been found by Coverity - static analysis tool.
mysql-5.5.31/strings/ctype-ucs2.c:1707:sign_extension Suspicious implicit sign extension: "s[0]" with type "unsigned char" (8 bits, unsigned) is promoted in "(s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "(s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
diff -up mariadb-10.0.15/strings/ctype-ucs2.c.orig mariadb-10.0.15/strings/ctype-ucs2.c
--- mariadb-10.0.15/strings/ctype-ucs2.c.orig 2014-11-27 15:14:11.129554529 +0100
+++ mariadb-10.0.15/strings/ctype-ucs2.c 2014-11-27 15:13:06.806439653 +0100
@@ -1932,7 +1932,7 @@ my_utf32_uni(CHARSET_INFO *cs __attribut
{
if (s + 4 > e)
return MY_CS_TOOSMALL4;
- *pwc= (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]);
+ *pwc= (((my_wc_t)s[0]) << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]);
return 4;
}

View file

@ -0,0 +1,57 @@
The following problems have been found by Coverity - static analysis tool.
mysql-5.5.31/plugin/semisync/semisync_master.cc:672:parameter_as_source Note: This defect has an elevated risk because the source argument is a parameter of the current function.
mysql-5.5.31/plugin/semisync/semisync_master.cc:661:parameter_as_source Note: This defect has an elevated risk because the source argument is a parameter of the current function.
mysql-5.5.31/plugin/semisync/semisync_master.cc:555:parameter_as_source Note: This defect has an elevated risk because the source argument is a parameter of the current function.
diff -up mariadb-10.0.15/plugin/semisync/semisync_master.cc.orig mariadb-10.0.15/plugin/semisync/semisync_master.cc
--- mariadb-10.0.15/plugin/semisync/semisync_master.cc.orig 2014-11-27 15:16:59.664855517 +0100
+++ mariadb-10.0.15/plugin/semisync/semisync_master.cc 2014-11-27 15:16:17.029779375 +0100
@@ -553,7 +553,8 @@ int ReplSemiSyncMaster::reportReplyBinlo
if (need_copy_send_pos)
{
- strcpy(reply_file_name_, log_file_name);
+ strncpy(reply_file_name_, log_file_name, sizeof(reply_file_name_)-1);
+ reply_file_name_[sizeof(reply_file_name_)-1] = '\0';
reply_file_pos_ = log_file_pos;
reply_file_name_inited_ = true;
@@ -661,7 +662,8 @@ int ReplSemiSyncMaster::commitTrx(const
if (cmp <= 0)
{
/* This thd has a lower position, let's update the minimum info. */
- strcpy(wait_file_name_, trx_wait_binlog_name);
+ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1);
+ wait_file_name_[sizeof(wait_file_name_)-1] = '\0';
wait_file_pos_ = trx_wait_binlog_pos;
rpl_semi_sync_master_wait_pos_backtraverse++;
@@ -672,7 +674,8 @@ int ReplSemiSyncMaster::commitTrx(const
}
else
{
- strcpy(wait_file_name_, trx_wait_binlog_name);
+ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1);
+ wait_file_name_[sizeof(wait_file_name_)-1] = '\0';
wait_file_pos_ = trx_wait_binlog_pos;
wait_file_name_inited_ = true;
mysql-5.5.31/sql/rpl_handler.cc:306:fixed_size_dest You might overrun the 512 byte fixed-size string "log_info->log_file" by copying "log_file + dirname_length(log_file)" without checking the length. diff -up mysql-5.5.31/sql/rpl_handler.cc.covscan-stroverflow mysql-5.5.31/sql/rpl_handler.cc
diff -up mariadb-10.0.15/sql/rpl_handler.cc.orig mariadb-10.0.15/sql/rpl_handler.cc
--- mariadb-10.0.15/sql/rpl_handler.cc.orig 2014-11-27 15:17:28.000906123 +0100
+++ mariadb-10.0.15/sql/rpl_handler.cc 2014-11-27 15:16:17.030779377 +0100
@@ -270,7 +270,8 @@ int Binlog_storage_delegate::after_flush
my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, log_info);
}
- strcpy(log_info->log_file, log_file+dirname_length(log_file));
+ strncpy(log_info->log_file, log_file+dirname_length(log_file), sizeof(log_info->log_file)-1);
+ log_info->log_file[sizeof(log_info->log_file)-1] = '\0';
log_info->log_pos = log_pos;
int ret= 0;

View file

@ -0,0 +1,63 @@
Change the DH key length from 512 to 1024 bits to meet minimum requirements
of FIPS 140-2. (In principle we could use the larger size only when FIPS
mode is on, but it doesn't seem worth the trouble.)
The new parameter value was generated using "openssl dhparam -C 1024".
diff -up mariadb-10.0.15/vio/viosslfactories.c.orig mariadb-10.0.15/vio/viosslfactories.c
--- mariadb-10.0.15/vio/viosslfactories.c.orig 2014-11-27 15:02:22.757315487 +0100
+++ mariadb-10.0.15/vio/viosslfactories.c 2014-11-27 15:00:44.847144887 +0100
@@ -20,27 +20,32 @@
static my_bool ssl_algorithms_added = FALSE;
static my_bool ssl_error_strings_loaded= FALSE;
-static unsigned char dh512_p[]=
+static unsigned char dh1024_p[]=
{
- 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
- 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
- 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3,
- 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12,
- 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C,
- 0x47,0x74,0xE8,0x33,
+ 0xBF,0x5C,0xFA,0xD1,0xDD,0xBB,0xB3,0x0A,0x58,0x29,0x05,0xF5,
+ 0x7D,0x64,0xB2,0xE1,0xCE,0xE8,0xE0,0xE1,0x7A,0xB6,0xBC,0x5B,
+ 0x21,0x56,0xDF,0x2C,0x82,0x60,0xDC,0x31,0xCA,0x1E,0x02,0xFE,
+ 0xC4,0xE7,0x24,0x63,0x31,0xE4,0x67,0x1C,0x0B,0xFF,0x86,0x12,
+ 0x0D,0x2E,0xE6,0x35,0x0A,0x07,0x4F,0xE7,0x3F,0xDE,0xFE,0xF0,
+ 0x13,0x1C,0xA2,0x2B,0xF4,0xEE,0x2C,0x90,0x10,0x57,0x6B,0x2B,
+ 0xB9,0x1E,0x1B,0x47,0xB0,0x25,0xBF,0x45,0x86,0xDA,0x87,0x35,
+ 0x2C,0xF5,0x6A,0x41,0xA2,0x57,0xD8,0x16,0x5E,0x82,0x91,0x99,
+ 0x33,0xA0,0x8B,0x9D,0x34,0xCE,0x03,0x01,0x80,0x32,0x07,0x3B,
+ 0xF2,0x93,0xFC,0x3A,0x25,0xEC,0xB3,0xED,0x5C,0x4E,0x57,0xF2,
+ 0x3C,0x2E,0x0D,0xB1,0x59,0xA2,0x08,0x93,
};
-static unsigned char dh512_g[]={
+static unsigned char dh1024_g[]={
0x02,
};
-static DH *get_dh512(void)
+static DH *get_dh1024(void)
{
DH *dh;
if ((dh=DH_new()))
{
- dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
- dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
+ dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL);
+ dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL);
if (! dh->p || ! dh->g)
{
DH_free(dh);
@@ -284,7 +289,7 @@ new_VioSSLFd(const char *key_file, const
}
/* DH stuff */
- dh=get_dh512();
+ dh=get_dh1024();
SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh);
DH_free(dh);

View file

@ -0,0 +1,17 @@
--- mariadb-10.0.10/include/my_sys.h.p1 2014-03-30 19:56:37.000000000 +0200
+++ mariadb-10.0.10/include/my_sys.h 2014-04-07 15:30:20.627060157 +0200
@@ -209,13 +209,7 @@ extern void my_large_free(uchar *ptr);
#define my_safe_afree(ptr, size, max_alloca_sz) my_afree(ptr)
#endif /* HAVE_ALLOCA */
-#ifndef errno /* did we already get it? */
-#ifdef HAVE_ERRNO_AS_DEFINE
-#include <errno.h> /* errno is a define */
-#else
-extern int errno; /* declare errno */
-#endif
-#endif /* #ifndef errno */
+#include <errno.h> /* errno is a define */
extern char *home_dir; /* Home directory for user */
extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
extern const char *my_progname; /* program-name (printed in errors) */

View file

@ -0,0 +1,46 @@
Upstream chooses to install INFO_SRC and INFO_BIN into the docs dir, which
breaks at least two packaging commandments, so we put them into $libdir
instead. That means we have to hack the file_contents regression test
to know about this.
Recommendation they change is at http://bugs.mysql.com/bug.php?id=61425
diff -up mariadb-10.0.12/mysql-test/t/file_contents.test.file_contents mariadb-10.0.12/mysql-test/t/file_contents.test.
diff -up mariadb-10.0.12/mysql-test/t/file_contents.test.file_contents mariadb-10.0.12/mysql-test/t/file_contents.test
--- mariadb-10.0.12/mysql-test/t/file_contents.test.file_contents 2014-06-12 11:26:03.000000000 +0200
+++ mariadb-10.0.12/mysql-test/t/file_contents.test 2014-07-24 23:53:49.833176793 +0200
@@ -11,7 +11,7 @@
--perl
print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
$dir_bin = $ENV{'MYSQL_BINDIR'};
-if ($dir_bin eq '/usr/') {
+if ($dir_bin =~ '.*/usr/$') {
# RPM package
$dir_docs = $dir_bin;
$dir_docs =~ s|/lib|/share/doc|;
@@ -22,7 +22,7 @@ if ($dir_bin eq '/usr/') {
# RedHat: version number in directory name
$dir_docs = glob "$dir_docs/MySQL-server*";
}
-} elsif ($dir_bin eq '/usr') {
+} elsif ($dir_bin =~ '.*/usr$') {
# RPM build during development
$dir_docs = "$dir_bin/share/doc";
if(-d "$dir_docs/packages") {
@@ -32,6 +32,15 @@ if ($dir_bin eq '/usr/') {
# RedHat/Debian: version number in directory name
$dir_docs = glob "$dir_docs/mariadb-server-*";
$dir_docs = glob "$dir_docs/MySQL-server*" unless -d $dir_docs;
+
+ # All the above is entirely wacko, because these files are not docs;
+ # they should be kept in libdir instead. mtr does not provide a nice
+ # way to find libdir though, so we have to kluge it like this:
+ if (-d "$dir_bin/lib64/mysql") {
+ $dir_docs = "$dir_bin/lib64/mysql";
+ } else {
+ $dir_docs = "$dir_bin/lib/mysql";
+ }
}
# Slackware
$dir_docs = glob "$dir_bin/doc/mariadb-[0-9]*" unless -d $dir_docs;

View file

@ -0,0 +1,38 @@
Use configured value instead of hardcoded path
diff -up mariadb-10.0.13/scripts/mysql_install_db.pl.in.pbasedir mariadb-10.0.13/scripts/mysql_install_db.pl.in
--- mariadb-10.0.13/scripts/mysql_install_db.pl.in.pbasedir 2014-09-04 12:50:24.061979080 +0200
+++ mariadb-10.0.13/scripts/mysql_install_db.pl.in 2014-09-04 12:51:22.929045559 +0200
@@ -318,7 +318,7 @@ elsif ( $opt->{basedir} )
find_in_basedir($opt,"file","mysqld-nt",
"bin"); # ,"sql"
$pkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql",
- "share","share/mysql"); # ,"scripts"
+ "share","@INSTALL_MYSQLSHAREDIR@"); # ,"scripts"
$scriptdir = "$opt->{basedir}/scripts";
}
else
diff -up mariadb-10.0.13/scripts/mysql_install_db.sh.pbasedir mariadb-10.0.13/scripts/mysql_install_db.sh
--- mariadb-10.0.13/scripts/mysql_install_db.sh.pbasedir 2014-09-04 12:51:59.005086301 +0200
+++ mariadb-10.0.13/scripts/mysql_install_db.sh 2014-09-04 12:54:02.794222597 +0200
@@ -280,16 +280,16 @@ then
cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
exit 1
fi
- langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
+ langdir=`find_in_basedir --dir errmsg.sys share/english @INSTALL_MYSQLSHAREDIR@/english`
if test -z "$langdir"
then
- cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
+ cannot_find_file errmsg.sys $basedir/share/english $basedir/@INSTALL_MYSQLSHAREDIR@/english
exit 1
fi
- pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
+ pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share @INSTALL_MYSQLSHAREDIR@`
if test -z "$pkgdatadir"
then
- cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
+ cannot_find_file fill_help_tables.sql $basedir/share $basedir/@INSTALL_MYSQLSHAREDIR@
exit 1
fi
scriptdir="$basedir/scripts"

View file

@ -0,0 +1,56 @@
Improve the documentation that will be installed in the mysql-test RPM.
diff -up mariadb-10.0.10/mysql-test/README.p3 mariadb-10.0.10/mysql-test/README
--- mariadb-10.0.10/mysql-test/README.p3 2014-04-07 16:05:51.402631548 +0200
+++ mariadb-10.0.10/mysql-test/README 2014-04-07 16:06:06.137637991 +0200
@@ -1,15 +1,28 @@
-This directory contains a test suite for the MySQL daemon. To run
-the currently existing test cases, simply execute ./mysql-test-run in
-this directory. It will fire up the newly built mysqld and test it.
-
-Note that you do not have to have to do "make install", and you could
-actually have a co-existing MySQL installation. The tests will not
-conflict with it. To run the test suite in a source directory, you
-must do make first.
-
-All tests must pass. If one or more of them fail on your system, please
-read the following manual section for instructions on how to report the
-problem:
+This directory contains a test suite for the MariaDB daemon. To run
+the currently existing test cases, execute ./mysql-test-run in
+this directory.
+
+For use in Red Hat distributions, you should run the script as user mysql,
+who is created with nologin shell however, so the best bet is something like
+ $ su -
+ # cd /usr/share/mysql-test
+ # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=rh-skipped-tests.list"
+
+This will use the installed mysql executables, but will run a private copy
+of the server process (using data files within /usr/share/mysql-test),
+so you need not start the mysqld service beforehand.
+
+The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are
+known to fail on one or more Red-Hat-supported platforms. You can omit it
+if you want to check whether such failures occur for you. Documentation
+about the reasons for omitting such tests can be found in the file
+rh-skipped-tests.list.
+
+To clean up afterwards, remove the created "var" subdirectory, eg
+ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var"
+
+If one or more tests fail on your system, please read the following manual
+section for instructions on how to report the problem:
http://kb.askmonty.org/v/reporting-bugs
@@ -26,7 +39,8 @@ other relevant options.
With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
-tests cannot run with an external server.
+tests cannot run with an external server (because they need to control the
+options with which the server is started).
You can create your own test cases. To create a test case, create a new
file in the t subdirectory using a text editor. The file should have a .test

View file

@ -0,0 +1,71 @@
Adjust the mysql-log-rotate script in several ways:
* Use the correct log file pathname for Red Hat installations.
* Enable creation of the log file by logrotate (needed since
/var/log/ isn't writable by mysql user); and set the same 640
permissions we normally use.
* Comment out the actual rotation commands, so that user must edit
the file to enable rotation. This is unfortunate, but the fact
that the script will probably fail without manual configuration
(to set a root password) means that we can't really have it turned
on by default. Fortunately, in most configurations the log file
is low-volume and so rotation is not critical functionality.
See discussions at RH bugs 799735, 547007
diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/support-files/mysql-log-rotate.sh
--- mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 2014-03-30 19:56:53.000000000 +0200
+++ mariadb-10.0.10/support-files/mysql-log-rotate.sh 2014-04-07 16:30:11.264618655 +0200
@@ -1,9 +1,9 @@
# This logname can be set in /etc/my.cnf
-# by setting the variable "err-log"
-# in the [safe_mysqld] section as follows:
+# by setting the variable "log-error"
+# in the [mysqld_safe] section as follows:
#
-# [safe_mysqld]
-# err-log=@localstatedir@/mysqld.log
+# [mysqld_safe]
+# log-error=@LOG_LOCATION@
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
@@ -18,19 +18,21 @@
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !
-@localstatedir@/mysqld.log {
- # create 600 mysql mysql
- notifempty
- daily
- rotate 3
- missingok
- compress
- postrotate
- # just if mysqld is really running
- if test -x @bindir@/mysqladmin && \
- @bindir@/mysqladmin ping &>/dev/null
- then
- @bindir@/mysqladmin flush-logs
- fi
- endscript
-}
+# Then, un-comment the following lines to enable rotation of mysql's log file:
+
+#@LOG_LOCATION@ {
+# create 640 mysql mysql
+# notifempty
+# daily
+# rotate 3
+# missingok
+# compress
+# postrotate
+# # just if mysqld is really running
+# if test -x @bindir@/mysqladmin && \
+# @bindir@/mysqladmin ping &>/dev/null
+# then
+# @bindir@/mysqladmin flush-logs
+# fi
+# endscript
+#}

View file

@ -0,0 +1,41 @@
Support s390/s390x in performance schema's cycle-counting functions.
Filed upstream at http://bugs.mysql.com/bug.php?id=59953
diff -up mariadb-10.0.10/include/my_rdtsc.h.p4 mariadb-10.0.10/include/my_rdtsc.h
--- mariadb-10.0.10/include/my_rdtsc.h.p4 2014-03-30 19:56:36.000000000 +0200
+++ mariadb-10.0.10/include/my_rdtsc.h 2014-04-07 16:13:55.227792169 +0200
@@ -125,6 +125,7 @@ C_MODE_END
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27
+#define MY_TIMER_ROUTINE_ASM_S390 28
#endif
diff -up mariadb-10.0.10/mysys/my_rdtsc.c.p4 mariadb-10.0.10/mysys/my_rdtsc.c
--- mariadb-10.0.10/mysys/my_rdtsc.c.p4 2014-03-30 19:56:36.000000000 +0200
+++ mariadb-10.0.10/mysys/my_rdtsc.c 2014-04-07 16:15:48.114901576 +0200
@@ -224,6 +224,13 @@ ulonglong my_timer_cycles(void)
clock_gettime(CLOCK_SGI_CYCLE, &tp);
return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec;
}
+#elif defined(__GNUC__) && defined(__s390__)
+ /* covers both s390 and s390x */
+ {
+ ulonglong result;
+ __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
+ return result;
+ }
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
/* gethrtime may appear as either cycle or nanosecond counter */
return (ulonglong) gethrtime();
@@ -533,6 +540,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
#elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE)
mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE;
+#elif defined(__GNUC__) && defined(__s390__)
+ mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
#else

View file

@ -0,0 +1,135 @@
diff -rup mariadb-10.0.15-orig/scripts/mysqld_safe.sh mariadb-10.0.15/scripts/mysqld_safe.sh
--- mariadb-10.0.15-orig/scripts/mysqld_safe.sh 2014-12-04 19:43:46.199488213 +0100
+++ mariadb-10.0.15/scripts/mysqld_safe.sh 2014-12-04 19:51:33.461984234 +0100
@@ -11,6 +11,12 @@
# mysql.server works by first doing a cd to the base directory and from there
# executing mysqld_safe
+# we want start daemon only inside "scl enable" invocation
+if ! scl_enabled @SCL_NAME@ ; then
+ echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation"
+ exit 1
+fi
+
# Initialize script globals
KILL_MYSQLD=1;
MYSQLD=
diff -rup mariadb-10.0.15-orig/scripts/mysql.init.in mariadb-10.0.15/scripts/mysql.init.in
--- mariadb-10.0.15-orig/scripts/mysql.init.in 2014-12-04 19:43:46.310488382 +0100
+++ mariadb-10.0.15/scripts/mysql.init.in 2014-12-04 20:00:42.273120004 +0100
@@ -145,6 +145,18 @@ condrestart(){
[ -e $lockfile ] && restart || :
}
+# We have to re-enable SCL environment, because /sbin/service
+# clears almost all environment variables.
+# Since X_SCLS is cleared as well, we lose information about other
+# collections enabled.
+source @SCL_SCRIPTS@/service-environment
+source scl_source enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED
+
+# we want start daemon only inside "scl enable" invocation
+if ! scl_enabled @SCL_NAME@ ; then
+ echo "Collection @SCL_NAME@ has to be listed in @SCL_SCRIPTS@/service-environment"
+ exit 1
+fi
# See how we were called.
case "$1" in
diff -rup mariadb-10.0.15-orig/scripts/mysql_install_db.sh mariadb-10.0.15/scripts/mysql_install_db.sh
--- mariadb-10.0.15-orig/scripts/mysql_install_db.sh 2014-12-04 19:43:46.308488379 +0100
+++ mariadb-10.0.15/scripts/mysql_install_db.sh 2014-12-04 19:57:02.056065525 +0100
@@ -19,6 +19,12 @@
#
# All unrecognized arguments to this script are passed to mysqld.
+# we want start daemon only inside "scl enable" invocation
+if ! scl_enabled @SCL_NAME@ ; then
+ echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation"
+ exit 1
+fi
+
basedir=""
builddir=""
ldata="@localstatedir@"
@@ -435,16 +441,16 @@ else
echo "The problem could be conflicting information in an external"
echo "my.cnf files. You can ignore these by doing:"
echo
- echo " shell> $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf"
+ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf'"
echo
echo "You can also try to start the mysqld daemon with:"
echo
- echo " shell> $mysqld --skip-grant --general-log &"
+ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $mysqld --skip-grant --general-log &'"
echo
echo "and use the command line tool $bindir/mysql"
echo "to connect to the mysql database and look at the grant tables:"
echo
- echo " shell> $bindir/mysql -u root mysql"
+ echo " shell> scl enable @SCL_NAME@ -- $bindir/mysql -u root mysql"
echo " mysql> show tables;"
echo
echo "Try 'mysqld --help' if you have problems with paths. Using"
@@ -474,19 +480,15 @@ fi
# the screen.
if test "$cross_bootstrap" -eq 0 && test -z "$srcdir"
then
- s_echo
- s_echo "To start mysqld at boot time you have to copy"
- s_echo "support-files/mysql.server to the right place for your system"
-
echo
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
echo "To do so, start the server, then issue the following commands:"
echo
- echo "'$bindir/mysqladmin' -u root password 'new-password'"
- echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
+ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root password 'new-password'"
+ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root -h $hostname password 'new-password'"
echo
echo "Alternatively you can run:"
- echo "'$bindir/mysql_secure_installation'"
+ echo "scl enable @SCL_NAME@ -- '$bindir/mysql_secure_installation'"
echo
echo "which will also give you the option of removing the test"
echo "databases and anonymous user created by default. This is"
@@ -502,7 +504,8 @@ then
echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'"
echo
echo "You can test the MariaDB daemon with mysql-test-run.pl"
- echo "cd '$basedir/mysql-test' ; perl mysql-test-run.pl"
+ echo "after installing @SCL_NAME@-mariadb-test package."
+ echo "See @prefix@/share/mysql-test/README for instructions."
fi
echo
diff -rup mariadb-10.0.15-orig/scripts/mysql.service.in mariadb-10.0.15/scripts/mysql.service.in
--- mariadb-10.0.15-orig/scripts/mysql.service.in 2014-12-04 19:43:46.310488382 +0100
+++ mariadb-10.0.15/scripts/mysql.service.in 2014-12-04 19:49:28.626953351 +0100
@@ -32,13 +32,19 @@ Type=simple
User=mysql
Group=mysql
-ExecStartPre=@libexecdir@/mysql-check-socket
-ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
+# Load collections set to enabled for this service
+EnvironmentFile=@SCL_SCRIPTS@/service-environment
+
+# We want to start server only inside "scl enable" invocation
+ExecStartPre=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@
+
+ExecStartPre=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket
+ExecStartPre=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
-ExecStart=@bindir@/mysqld_safe --basedir=@prefix@
-ExecStartPost=@libexecdir@/mysql-wait-ready $MAINPID
-ExecStartPost=@libexecdir@/mysql-check-upgrade
+ExecStart=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @bindir@/mysqld_safe --basedir=@prefix@
+ExecStartPost=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-wait-ready $MAINPID
+ExecStartPost=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300

View file

@ -0,0 +1,48 @@
diff -up mariadb-10.0.15/scripts/CMakeLists.txt.systemd mariadb-10.0.15/scripts/CMakeLists.txt
--- mariadb-10.0.15/scripts/CMakeLists.txt.systemd 2014-11-27 15:06:24.670736998 +0100
+++ mariadb-10.0.15/scripts/CMakeLists.txt 2014-11-27 15:04:26.252530666 +0100
@@ -374,6 +374,32 @@ ELSE()
COMPONENT ${${file}_COMPONENT}
)
ENDFOREACH()
+
+ # files for systemd
+ SET(SYSTEMD_SCRIPTS
+ mysql.tmpfiles.d
+ mysql.service
+ mysql-prepare-db-dir
+ mysql-wait-ready
+ mysql-check-socket
+ mysql-check-upgrade
+ mysql-scripts-common
+ mysql_config_multilib
+ mysql.init
+ my.cnf
+ )
+ FOREACH(file ${SYSTEMD_SCRIPTS})
+ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
+ ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
+ ELSE()
+ MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file}.in in "
+ "${CMAKE_CURRENT_SOURCE_DIR}" )
+ ENDIF()
+ ENDFOREACH()
ENDIF()
# Install libgcc as mylibgcc.a
diff -up mariadb-10.0.15/support-files/CMakeLists.txt.cmakescripts mariadb-10.0.15/support-files/CMakeLists.txt
--- mariadb-10.0.15/support-files/CMakeLists.txt.cmakescripts 2014-11-27 15:07:13.203821563 +0100
+++ mariadb-10.0.15/support-files/CMakeLists.txt 2014-11-27 15:04:26.252530666 +0100
@@ -112,6 +112,8 @@ IF(UNIX)
COMPONENT SharedLibraries)
INSTALL(FILES rpm/mysql-clients.cnf DESTINATION ${INSTALL_SYSCONF2DIR}
COMPONENT Client)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rpm/server.cnf
+ ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY )
INSTALL(FILES rpm/server.cnf DESTINATION ${INSTALL_SYSCONF2DIR}
COMPONENT IniFiles)
ENDIF()

View file

@ -0,0 +1,30 @@
Don't test EDH-RSA-DES-CBC-SHA cipher, it seems to be removed from openssl
which now makes mariadb/mysql FTBFS because openssl_1 test fails
Related: #1044565
diff -up mariadb-10.0.15/mysql-test/r/openssl_1.result.orig mariadb-10.0.15/mysql-test/r/openssl_1.result
--- mariadb-10.0.15/mysql-test/r/openssl_1.result.orig 2014-11-27 15:25:32.582771542 +0100
+++ mariadb-10.0.15/mysql-test/r/openssl_1.result 2014-11-27 15:22:46.353474672 +0100
@@ -198,8 +198,6 @@ Ssl_cipher DHE-RSA-AES256-SHA
Variable_name Value
Ssl_cipher EDH-RSA-DES-CBC3-SHA
Variable_name Value
-Ssl_cipher EDH-RSA-DES-CBC-SHA
-Variable_name Value
Ssl_cipher RC4-SHA
select 'is still running; no cipher request crashed the server' as result from dual;
result
diff -up mariadb-10.0.15/mysql-test/t/openssl_1.test.orig mariadb-10.0.15/mysql-test/t/openssl_1.test
--- mariadb-10.0.15/mysql-test/t/openssl_1.test.orig 2014-11-27 15:25:16.637743066 +0100
+++ mariadb-10.0.15/mysql-test/t/openssl_1.test 2014-11-27 15:22:46.354474674 +0100
@@ -222,7 +222,7 @@ DROP TABLE t1;
# Common ciphers to openssl and yassl
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=DHE-RSA-AES256-SHA
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA
---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA
+#--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA
--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA
--disable_query_log
--disable_result_log

View file

@ -0,0 +1,22 @@
These issues were found by Coverity static analysis tool, for more info
see messages by particular fixes (messages belong to 5.1.61).
Filed upstream at http://bugs.mysql.com/bug.php?id=64631
Error: BUFFER_SIZE_WARNING:
/builddir/build/BUILD/mysql-5.1.61/sql/sql_prepare.cc:2749: buffer_size_warning: Calling strncpy with a maximum size argument of 512 bytes on destination array "this->stmt->last_error" of size 512 bytes might leave the destination string unterminated.
diff -up mariadb-10.0.10/sql/sql_prepare.cc.p8 mariadb-10.0.10/sql/sql_prepare.cc
--- mariadb-10.0.10/sql/sql_prepare.cc.p8 2014-03-30 19:56:42.000000000 +0200
+++ mariadb-10.0.10/sql/sql_prepare.cc 2014-04-07 18:43:33.901074770 +0200
@@ -3021,7 +3021,7 @@ void mysql_stmt_get_longdata(THD *thd, c
{
stmt->state= Query_arena::STMT_ERROR;
stmt->last_errno= thd->get_stmt_da()->sql_errno();
- strncpy(stmt->last_error, thd->get_stmt_da()->message(), MYSQL_ERRMSG_SIZE);
+ strncpy(stmt->last_error, thd->get_stmt_da()->message(), sizeof(stmt->last_error)-1);
}
thd->set_stmt_da(save_stmt_da);

View file

@ -0,0 +1,30 @@
Remove overly optimistic definition of strmov() as stpcpy().
mysql uses this macro with overlapping source and destination strings,
which is verboten per spec, and fails on some Red Hat platforms.
Deleting the definition is sufficient to make it fall back to a
byte-at-a-time copy loop, which should consistently give the
expected behavior.
Note: the particular case that prompted this patch is reported and fixed
at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's
ability to detect this type of error is low, and I also see little evidence
of any real performance gain from optimizing these calls. So I'm keeping
this patch.
diff -up mariadb-10.0.15/include/m_string.h.orig mariadb-10.0.15/include/m_string.h
--- mariadb-10.0.15/include/m_string.h.orig 2014-11-27 14:40:32.622032698 +0100
+++ mariadb-10.0.15/include/m_string.h 2014-11-27 14:38:56.211864712 +0100
@@ -73,12 +73,6 @@ extern void *(*my_str_malloc)(size_t);
extern void *(*my_str_realloc)(void *, size_t);
extern void (*my_str_free)(void *);
-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
-#define strmov(A,B) __builtin_stpcpy((A),(B))
-#elif defined(HAVE_STPCPY)
-#define strmov(A,B) stpcpy((A),(B))
-#endif
-
/* Declared in int2str() */
extern const char _dig_vec_upper[];
extern const char _dig_vec_lower[];

25
SOURCES/my.cnf.in Normal file
View file

@ -0,0 +1,25 @@
[mysqld]
datadir=@MYSQL_DATADIR@
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld/mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
# Settings for particular implementations like MariaDB are defined
# in appropriate sections; for MariaDB server in [mariadb] section in
# @INSTALL_SYSCONF2DIR@/server.cnf (part of mariadb-server).
# It doesn't matter that we set these settings only for [mysqld] here,
# because they will be read and used in mysqld_safe as well.
log-error=@LOG_LOCATION@
pid-file=@PID_FILE_DIR@/@DAEMON_NAME@.pid
[mysqld_safe]
#
# include all files from the config directory
#
!includedir @INSTALL_SYSCONF2DIR@

33
SOURCES/my_config.h Normal file
View file

@ -0,0 +1,33 @@
/*
* Kluge to support multilib installation of both 32- and 64-bit RPMS:
* we need to arrange that header files that appear in both RPMs are
* identical. Hence, this file is architecture-independent and calls
* in an arch-dependent file that will appear in just one RPM.
*
* To avoid breaking arches not explicitly supported by Red Hat, we
* use this indirection file *only* on known multilib arches.
*
* Note: this may well fail if user tries to use gcc's -I- option.
* But that option is deprecated anyway.
*/
#if defined(__x86_64__)
#include "my_config_x86_64.h"
#elif defined(__i386__)
#include "my_config_i386.h"
#elif defined(__ppc64__) || defined(__powerpc64__)
#include "my_config_ppc64.h"
#elif defined(__ppc__) || defined(__powerpc__)
#include "my_config_ppc.h"
#elif defined(__s390x__)
#include "my_config_s390x.h"
#elif defined(__s390__)
#include "my_config_s390.h"
#elif defined(__sparc__) && defined(__arch64__)
#include "my_config_sparc64.h"
#elif defined(__sparc__)
#include "my_config_sparc.h"
#elif defined(__arm__)
#include "my_config_arm.h"
#elif defined(__aarch64__)
#include "my_config_aarch64.h"
#endif

View file

@ -0,0 +1,39 @@
#!/bin/sh
# We check if there is already a process using the socket file,
# since otherwise the systemd service file could report false
# positive result when starting and mysqld_safe could remove
# a socket file, which is actually being used by a different daemon.
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
if test -e "$socketfile" ; then
echo "Socket file $socketfile exists." >&2
# no write permissions
if ! test -w "$socketfile" ; then
echo "Not enough permission to write to the socket file $socketfile, which is suspicious." >&2
echo "Please, remove $socketfile manually to start the service." >&2
exit 1
fi
# not a socket file
if ! test -S "$socketfile" ; then
echo "The file $socketfile is not a socket file, which is suspicious." >&2
echo "Please, remove $socketfile manually to start the service." >&2
exit 1
fi
# some process uses the socket file
if fuser "$socketfile" &>/dev/null ; then
socketpid=$(fuser "$socketfile" 2>/dev/null)
echo "Is another MySQL daemon already running with the same unix socket?" >&2
echo "Please, stop the process $socketpid or remove $socketfile manually to start the service." >&2
exit 1
fi
# socket file is a garbage
echo "No process is using $socketfile, which means it is a garbage, so it will be removed automatically." >&2
fi
exit 0

View file

@ -0,0 +1,39 @@
#!/bin/sh
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
upgrade_info_file="$datadir/mysql_upgrade_info"
version=0
# get version as integer from mysql_upgrade_info file
if [ -f "$upgrade_info_file" ] && [ -r "$upgrade_info_file" ] ; then
version_major=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\1/')
version_minor=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\2/')
if [[ $version_major =~ ^[0-9]+$ ]] && [[ $version_minor =~ ^[0-9]+$ ]] ; then
version=$((version_major*100+version_minor))
fi
fi
# compute current version as integer
thisversion=$((@MAJOR_VERSION@*100+@MINOR_VERSION@))
# provide warning in cases we should run mysql_upgrade
if [ $version -ne $thisversion ] ; then
# give extra warning if some version seems to be skipped
if [ $version -gt 0 ] && [ $version -lt 505 ] ; then
echo "The datadir located at $datadir seems to be older than of a version 5.5. Please, mind that as a general rule, to upgrade from one release series to another, go to the next series rather than skipping a series." >&2
fi
cat <<EOF >&2
The datadir located at $datadir needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps:
1. Back-up your data before running 'mysql_upgrade'
2. Start the database daemon using 'systemctl start @DAEMON_NAME@.service'
3. Run 'mysql_upgrade' with a database user that has sufficient privileges
Read more about 'mysql_upgrade' usage at:
https://mariadb.com/kb/en/mariadb/documentation/sql-commands/table-commands/mysql_upgrade/
EOF
fi
exit 0

View file

@ -0,0 +1,26 @@
/* simple test program to see if we can link the embedded server library */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "mysql.h"
MYSQL *mysql;
static char *server_options[] = \
{ "mysql_test", "--defaults-file=my.cnf", NULL };
int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
static char *server_groups[] = { "libmysqld_server",
"libmysqld_client", NULL };
int main(int argc, char **argv)
{
mysql_library_init(num_elements, server_options, server_groups);
mysql = mysql_init(NULL);
mysql_close(mysql);
mysql_library_end();
return 0;
}

View file

@ -0,0 +1,89 @@
#!/bin/sh
# This script creates the mysql data directory during first service start.
# In subsequent starts, it does nothing much.
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
# If two args given first is user, second is group
# otherwise the arg is the systemd service file
if [ "$#" -eq 2 ]
then
myuser="$1"
mygroup="$2"
else
# Absorb configuration settings from the specified systemd service file,
# or the default service if not specified
SERVICE_NAME="$1"
if [ x"$SERVICE_NAME" = x ]
then
SERVICE_NAME=@DAEMON_NAME@.service
fi
myuser=`systemctl show -p User "${SERVICE_NAME}" |
sed 's/^User=//'`
if [ x"$myuser" = x ]
then
myuser=mysql
fi
mygroup=`systemctl show -p Group "${SERVICE_NAME}" |
sed 's/^Group=//'`
if [ x"$mygroup" = x ]
then
mygroup=mysql
fi
fi
# Set up the errlogfile with appropriate permissions
touch "$errlogfile"
ret=$?
# Provide some advice if the log file cannot be touched
if [ $ret -ne 0 ] ; then
errlogdir=$(dirname $errlogfile)
if ! [ -d "$errlogdir" ] ; then
echo "The directory $errlogdir does not exist."
elif [ -f "$errlogfile" ] ; then
echo "The log file $errlogfile cannot be touched, please, fix its permissions."
else
echo "The log file $errlogfile could not be created."
fi
echo "The daemon will be run under $myuser:$mygroup"
exit 1
fi
chown "$myuser:$mygroup" "$errlogfile"
chmod 0640 "$errlogfile"
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
# Make the data directory
if [ ! -d "$datadir/mysql" ] ; then
# First, make sure $datadir is there with correct permissions
# (note: if it's not, and we're not root, this'll fail ...)
if [ ! -e "$datadir" -a ! -h "$datadir" ]
then
mkdir -p "$datadir" || exit 1
fi
chown "$myuser:$mygroup" "$datadir"
chmod 0755 "$datadir"
[ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
# Now create the database
echo "Initializing @NICE_PROJECT_NAME@ database"
@bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser"
ret=$?
if [ $ret -ne 0 ] ; then
echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2
echo "Perhaps @sysconfdir@/my.cnf is misconfigured." >&2
# Clean up any partially-created database files
if [ ! -e "$datadir/mysql/user.frm" ] ; then
rm -rf "$datadir"/*
fi
exit $ret
fi
# upgrade does not need to be run on a fresh datadir
echo "@VERSION@-MariaDB" >"$datadir/mysql_upgrade_info"
# In case we're running as root, make sure files are owned properly
chown -R "$myuser:$mygroup" "$datadir"
fi
exit 0

View file

@ -0,0 +1,58 @@
#!/bin/sh
# Some useful functions used in other MySQL helper scripts
# This scripts defines variables datadir, errlogfile, socketfile
export LC_ALL=C
# extract value of a MySQL option from config files
# Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ]
# result is returned in $result
# We use my_print_defaults which prints all options from multiple files,
# with the more specific ones later; hence take the last match.
get_mysql_option(){
if [ $# -ne 3 ] ; then
echo "get_mysql_option requires 3 arguments: section option default_value"
return
fi
sections="$1"
option_name="$2"
default_value="$3"
result=`@bindir@/my_print_defaults $sections | sed -n "s/^--${option_name}=//p" | tail -n 1`
if [ -z "$result" ]; then
# not found, use default
result="${default_value}"
fi
}
# Defaults here had better match what mysqld_safe will default to
# The option values are generally defined on three important places
# on the default installation:
# 1) default values are hardcoded in the code of mysqld daemon or
# mysqld_safe script
# 2) configurable values are defined in @sysconfdir@/my.cnf
# 3) default values for helper scripts are specified bellow
# So, in case values are defined in my.cnf, we need to get that value.
# In case they are not defined in my.cnf, we need to get the same value
# in the daemon, as in the helper scripts. Thus, default values here
# must correspond with values defined in mysqld_safe script and source
# code itself.
server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ mariadb mariadb-@MAJOR_VERSION@.@MINOR_VERSION@ client-server"
get_mysql_option "$server_sections" datadir "@MYSQL_DATADIR@"
datadir="$result"
# if there is log_error in the my.cnf, my_print_defaults still
# returns log-error
# log-error might be defined in mysqld_safe and mysqld sections,
# the former has bigger priority
get_mysql_option "$server_sections" log-error "$datadir/`hostname`.err"
errlogfile="$result"
get_mysql_option "$server_sections" socket "@MYSQL_UNIX_ADDR@"
socketfile="$result"
get_mysql_option "$server_sections" pid-file "$datadir/`hostname`.pid"
pidfile="$result"

View file

@ -0,0 +1,45 @@
#!/bin/sh
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
# This script waits for mysqld to be ready to accept connections
# (which can be many seconds or even minutes after launch, if there's
# a lot of crash-recovery work to do).
# Running this as ExecStartPost is useful so that services declared as
# "After mysqld" won't be started until the database is really ready.
if [ $# -ne 1 ] ; then
echo "You need to pass daemon pid as an argument for this script."
exit 20
fi
# Service file passes us the daemon's PID (actually, mysqld_safe's PID)
daemon_pid="$1"
# Wait for the server to come up or for the mysqld process to disappear
ret=0
while /bin/true; do
# Check process still exists
if ! [ -d "/proc/${daemon_pid}" ] ; then
ret=1
break
fi
RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
mret=$?
if [ $mret -eq 0 ] ; then
break
fi
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
# anything else suggests a configuration error
if [ $mret -ne 1 -a $mret -ne 11 ]; then
echo "Cannot check for @NICE_PROJECT_NAME@ Daemon startup because of mysqladmin failure." >&2
ret=$mret
break
fi
# "Access denied" also means the server is alive
echo "$RESPONSE" | grep -q "Access denied for user" && break
sleep 1
done
exit $ret

177
SOURCES/mysql.init.in Normal file
View file

@ -0,0 +1,177 @@
#!/bin/sh
#
# @DAEMON_NAME@ This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description: MySQL database server.
# processname: mysqld
# config: @sysconfdir@/my.cnf
# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NAME@.pid
### BEGIN INIT INFO
# Provides: mysqld
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
# Required-Stop: $local_fs $remote_fs $network $named $syslog $time
# Short-Description: start and stop MySQL server
# Description: MySQL database server
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
exec="@bindir@/mysqld_safe"
prog="@DAEMON_NAME@"
# Set timeouts here so they can be overridden from /etc/sysconfig/@DAEMON_NAME@
STARTTIMEOUT=300
STOPTIMEOUT=60
# User and group the daemon will run under
MYUSER=mysql
MYGROUP=mysql
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
# get options from my.cnf
source "@libexecdir@/mysql-scripts-common"
start(){
[ -x $exec ] || exit 5
# check to see if it's already running
MYSQLDRUNNING=0
if [ -f "$pidfile" ]; then
MYSQLPID=`cat "$pidfile" 2>/dev/null`
if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then
MYSQLDRUNNING=1
fi
fi
RESPONSE=`@bindir@/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then
# already running, do nothing
action $"Starting $prog: " /bin/true
ret=0
elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user"
then
# already running, do nothing
action $"Starting $prog: " /bin/true
ret=0
else
@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP || return 4
@libexecdir@/mysql-check-socket || return 1
# Pass all the options determined above, to ensure consistent behavior.
# In many cases mysqld_safe would arrive at the same conclusions anyway
# but we need to be sure. (An exception is that we don't force the
# log-error setting, since this script doesn't really depend on that,
# and some users might prefer to configure logging to syslog.)
# Note: set --basedir to prevent probes that might trigger SELinux
# alarms, per bug #547485
$exec --datadir="$datadir" --socket="$socketfile" \
--pid-file="$pidfile" \
--basedir=@prefix@ --user=$MYUSER >/dev/null 2>&1 &
safe_pid=$!
# Wait until the daemon is up
@libexecdir@/mysql-wait-ready "$safe_pid"
ret=$?
if [ $ret -eq 0 ]; then
action $"Starting $prog: " /bin/true
chmod o+r $pidfile >/dev/null 2>&1
touch $lockfile
else
action $"Starting $prog: " /bin/false
fi
fi
return $ret
}
stop(){
if [ ! -f "$pidfile" ]; then
# not running; per LSB standards this is "ok"
action $"Stopping $prog: " /bin/true
return 0
fi
MYSQLPID=`cat "$pidfile" 2>/dev/null`
if [ -n "$MYSQLPID" ]; then
if ! [ -d "/proc/$MYSQLPID" ] ; then
# process doesn't run anymore
action $"Stopping $prog: " /bin/true
return 0
fi
/bin/kill "$MYSQLPID" >/dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
TIMEOUT="$STOPTIMEOUT"
while [ $TIMEOUT -gt 0 ]; do
/bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break
sleep 1
let TIMEOUT=${TIMEOUT}-1
done
if [ $TIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to stop MySQL Daemon."
ret=1
action $"Stopping $prog: " /bin/false
else
rm -f $lockfile
rm -f "$socketfile"
action $"Stopping $prog: " /bin/true
fi
else
# kill command failed, probably insufficient permissions
action $"Stopping $prog: " /bin/false
ret=4
fi
else
# failed to read pidfile, probably insufficient permissions
action $"Stopping $prog: " /bin/false
ret=4
fi
return $ret
}
restart(){
stop
start
}
condrestart(){
[ -e $lockfile ] && restart || :
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p "$pidfile" $prog
;;
restart)
restart
;;
condrestart|try-restart)
condrestart
;;
reload)
exit 3
;;
force-reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

50
SOURCES/mysql.service.in Normal file
View file

@ -0,0 +1,50 @@
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service",
# containing
# .include /usr/lib/systemd/system/@DAEMON_NAME@.service
# ...make your changes here...
# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file @DAEMON_NAME@.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# For example, if you want to increase mysql's open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
# Note: /usr/lib/... is recommended in the .include line though /lib/...
# still works.
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
[Unit]
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
After=syslog.target
After=network.target
[Service]
Type=simple
User=mysql
Group=mysql
ExecStartPre=@libexecdir@/mysql-check-socket
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=@bindir@/mysqld_safe --basedir=@prefix@
ExecStartPost=@libexecdir@/mysql-wait-ready $MAINPID
ExecStartPost=@libexecdir@/mysql-check-upgrade
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1 @@
d @PID_FILE_DIR@ 0755 mysql mysql -

View file

@ -0,0 +1,26 @@
#! /bin/sh
#
# Wrapper script for mysql_config to support multilib
#
# This command respects setarch
bits=$(rpm --eval %__isa_bits)
case $bits in
32|64) status=known ;;
*) status=unknown ;;
esac
if [ "$status" = "unknown" ] ; then
echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits"
exit 1
fi
if [ -x @bindir@/mysql_config-$bits ] ; then
@bindir@/mysql_config-$bits "$@"
else
echo "$0: error: needed binary: @bindir@/mysql_config-$bits is missing"
exit 1
fi

View file

@ -0,0 +1,12 @@
# Disable perfschema.func_file_io and perfschema.func_mutex, which fail
# because cycle counter returns 0 every time on ARM architectures.
# This is caused by missing hardware performance counter support on ARM.
# Discussion about fixing that can be found in RH bug #741325.
perfschema.func_file_io : rhbz#773116 cycle counter does not work on arm
perfschema.func_mutex : rhbz#773116 cycle counter does not work on arm
connect.bin : rhbz#1096787 (pass on aarch64)
main.key_cache : rhbz#1096787 (pass on aarch64)
perfschema.setup_objects : rhbz#1096787

View file

@ -0,0 +1,13 @@
# These tests fail with MariaDB 10:
main.func_str : rhbz#1096787
main.openssl_1 : rhbz#1096787
main.ssl : rhbz#1096787
main.ssl_compress : rhbz#1096787
main.ssl_crl_clients : rhbz#1096787
main.ssl_8k_key : rhbz#1096787
perfschema.nesting : rhbz#1096787
perfschema.socket_summary_by_event_name_func : rhbz#1096787
perfschema.socket_summary_by_instance_func : rhbz#1096787
vcol.vcol_supported_sql_funcs_innodb : rhbz#1096787
vcol.vcol_supported_sql_funcs_myisam : rhbz#1096787

View file

@ -0,0 +1 @@
main.openssl_1 : rhbz#1096787

View file

@ -0,0 +1,24 @@
connect.alter : rhbz#1096787
connect.bin : rhbz#1096787
connect.dbf : rhbz#1096787
connect.index : rhbz#1096787
connect.mrr : rhbz#1149647#c6
connect.part_file : rhbz#1149647
connect.part_table : rhbz#1149647
connect.updelx : rhbz#1149647
connect.updelx2 : rhbz#1149647#c6
main.gis-precise : rhbz#1096787
main.statistics : rhbz#1096787
multi_source.skip_counter : rhbz#1096787
rpl.rpl_auto_increment : rhbz#1096787
rpl.rpl_gtid_basic : rhbz#1096787
rpl.rpl_gtid_master_promote : rhbz#1096787
rpl.rpl_gtid_stop_start : rhbz#1096787
rpl.rpl_gtid_until : rhbz#1096787
rpl.rpl_mixed_binlog_max_cache_size : rhbz#1096787
rpl.rpl_rotate_logs : rhbz#1096787
rpl.rpl_skip_replication : rhbz#1096787
rpl.rpl_slave_skip : rhbz#1096787
rpl.rpl_stm_max_relay_size : rhbz#1096787
sys_vars.max_relay_log_size_basic : rhbz#1096787
sys_vars.sql_slave_skip_counter_basic : rhbz#1096787

View file

@ -0,0 +1,6 @@
main.gis-precise : rhbz#1096787
main.mysqlslap : rhbz#1096787
rpl.rpl_insert : rhbz#1096787
connect.part_file : rhbz#1149647
connect.part_table : rhbz#1149647
connect.updelx : rhbz#1149647

View file

@ -0,0 +1,2 @@
main.key_cache : rhbz#1149647

1594
SPECS/mariadb.spec Normal file

File diff suppressed because it is too large Load diff