Commit 9bcaaabc authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Imported Upstream version 10.1.21

parent b371a50f
...@@ -48,6 +48,7 @@ extra/jemalloc/build/ ...@@ -48,6 +48,7 @@ extra/jemalloc/build/
extra/jemalloc/tmp/ extra/jemalloc/tmp/
extra/my_print_defaults extra/my_print_defaults
extra/mysql_waitpid extra/mysql_waitpid
extra/mysqld_safe_helper
extra/perror extra/perror
extra/replace extra/replace
extra/resolve_stack_dump extra/resolve_stack_dump
...@@ -217,6 +218,7 @@ support-files/mysql.spec ...@@ -217,6 +218,7 @@ support-files/mysql.spec
support-files/mysqld_multi.server support-files/mysqld_multi.server
support-files/wsrep.cnf support-files/wsrep.cnf
support-files/wsrep_notify support-files/wsrep_notify
support-files/policy/selinux/mysqld-safe.pp
tags tags
tests/async_queries tests/async_queries
tests/bug25714 tests/bug25714
......
...@@ -283,7 +283,7 @@ ENDIF() ...@@ -283,7 +283,7 @@ ENDIF()
# Set commonly used variables # Set commonly used variables
IF(WIN32) IF(WIN32)
SET(DEFAULT_MYSQL_HOME "C:/MariaDB${MYSQL_BASE_VERSION}") SET(DEFAULT_MYSQL_HOME "C:/Program Files/MariaDB ${MYSQL_BASE_VERSION}")
SET(SHAREDIR share) SET(SHAREDIR share)
ELSE() ELSE()
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX}) SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})
......
commit: c13b5011629b5ff7b969d648265002e4d1ba94c2 commit: f7d030489d2980c9deb733925515099ec256f6d2
date: 2016-12-14 19:20:17 +0000 date: 2017-01-17 20:17:35 +0100
build-date: 2016-12-14 20:26:15 +0100 build-date: 2017-01-17 20:38:38 +0100
short: c13b501 short: f7d0304
branch: HEAD branch: HEAD
MariaDB source 10.1.20 MariaDB source 10.1.21
MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=1 MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=20 MYSQL_VERSION_PATCH=21
...@@ -1564,8 +1564,10 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile) ...@@ -1564,8 +1564,10 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'")) if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'"))
{ {
my_printf_error(0, "query failed; error: '%s'", error_flags, my_printf_error(mysql_errno(mysql),
mysql_error(mysql)); "The query to get the server's pid file failed,"
" error: '%s'. Continuing.", error_flags,
mysql_error(mysql));
} }
result = mysql_store_result(mysql); result = mysql_store_result(mysql);
if (result) if (result)
......
...@@ -5800,6 +5800,7 @@ void do_connect(struct st_command *command) ...@@ -5800,6 +5800,7 @@ void do_connect(struct st_command *command)
my_bool con_shm __attribute__ ((unused))= 0; my_bool con_shm __attribute__ ((unused))= 0;
int read_timeout= 0; int read_timeout= 0;
int write_timeout= 0; int write_timeout= 0;
int connect_timeout= 0;
struct st_connection* con_slot; struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name; static DYNAMIC_STRING ds_connection_name;
...@@ -5906,6 +5907,11 @@ void do_connect(struct st_command *command) ...@@ -5906,6 +5907,11 @@ void do_connect(struct st_command *command)
{ {
write_timeout= atoi(con_options + sizeof("write_timeout=")-1); write_timeout= atoi(con_options + sizeof("write_timeout=")-1);
} }
else if (strncasecmp(con_options, "connect_timeout=",
sizeof("connect_timeout=")-1) == 0)
{
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
}
else else
die("Illegal option to connect: %.*s", die("Illegal option to connect: %.*s",
(int) (end - con_options), con_options); (int) (end - con_options), con_options);
...@@ -5990,6 +5996,12 @@ void do_connect(struct st_command *command) ...@@ -5990,6 +5996,12 @@ void do_connect(struct st_command *command)
(char*)&write_timeout); (char*)&write_timeout);
} }
if (connect_timeout)
{
mysql_options(con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
(char*)&connect_timeout);
}
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
if (con_shm) if (con_shm)
{ {
......
...@@ -46,6 +46,7 @@ usr/bin/mysql_zap ...@@ -46,6 +46,7 @@ usr/bin/mysql_zap
usr/bin/mysqlbinlog usr/bin/mysqlbinlog
usr/bin/mysqld_multi usr/bin/mysqld_multi
usr/bin/mysqld_safe usr/bin/mysqld_safe
usr/bin/mysqld_safe_helper
usr/bin/mysqlhotcopy usr/bin/mysqlhotcopy
usr/bin/perror usr/bin/perror
usr/bin/replace usr/bin/replace
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
## DP: http://bugs.mysql.com/bug.php?id=6901 ## DP: http://bugs.mysql.com/bug.php?id=6901
@DPATCH@ @DPATCH@
--- old/scripts/mysql_system_tables_data.sql 2008-12-04 22:59:44.000000000 +0100 --- a/scripts/mysql_system_tables_data.sql
+++ new/scripts/mysql_system_tables_data.sql 2008-12-04 23:00:07.000000000 +0100 +++ b/scripts/mysql_system_tables_data.sql
@@ -26,16 +26,6 @@ @@ -26,16 +26,6 @@
-- a plain character -- a plain character
SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname; SELECT LOWER( REPLACE((SELECT REPLACE(@@hostname,'_','\_')),'%','\%') )INTO @current_hostname;
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
- -
-- Fill "user" table with default users allowing root access -- Fill "user" table with default users allowing root access
-- from local machine if "user" table didn't exist before -- from local machine if "user" table didn't exist before
CREATE TEMPORARY TABLE tmp_user LIKE user; CREATE TEMPORARY TABLE tmp_user_nopasswd LIKE user;
@@ -43,8 +33,6 @@ INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y',' @@ -48,9 +38,6 @@ REPLACE INTO tmp_user_nopasswd VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y'
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0 FROM dual WHERE @current_hostname != 'localhost'; REPLACE INTO tmp_user_nopasswd VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0);
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N','',0); -- More secure root account using unix sucket auth.
REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','','N','N', '', 0); INSERT INTO tmp_user_socket VALUES ('localhost',IFNULL(@auth_root_socket, 'root'),'','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'unix_socket','','N', 'N','', 0);
-INSERT INTO tmp_user (host,user) VALUES ('localhost',''); --- Anonymous user with no privileges.
-INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost'; -INSERT INTO tmp_user_anonymous (host,user) VALUES ('localhost','');
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; -INSERT INTO tmp_user_anonymous (host,user) SELECT @current_hostname,'' FROM dual WHERE @current_hostname != 'localhost';
DROP TABLE tmp_user;
INSERT INTO user SELECT * FROM tmp_user_nopasswd WHERE @had_user_table=0 AND @skip_auth_root_nopasswd IS NULL;
INSERT INTO user SELECT * FROM tmp_user_socket WHERE @had_user_table=0 AND @auth_root_socket IS NOT NULL;
...@@ -102,4 +102,7 @@ IF(UNIX) ...@@ -102,4 +102,7 @@ IF(UNIX)
MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client) MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client)
TARGET_LINK_LIBRARIES(mysql_waitpid mysys) TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
MYSQL_ADD_EXECUTABLE(mysqld_safe_helper mysqld_safe_helper.c COMPONENT Server)
TARGET_LINK_LIBRARIES(mysqld_safe_helper mysys)
ENDIF() ENDIF()
#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
#include <my_pthread.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#include <stdlib.h>
#include <stdio.h>
void my_exit(int c)
{
my_end(0);
exit(c);
}
void do_usage()
{
printf("Usage:\n"
" %s <user> log <filename>\n"
" %s <user> exec <command> <args>\n",
my_progname, my_progname);
my_exit(1);
}
void do_log(const char *logfile)
{
FILE *f;
uchar buf[4096];
int size;
if (!logfile)
do_usage();
f= my_fopen(logfile, O_WRONLY|O_APPEND|O_CREAT, MYF(MY_WME));
if (!f)
my_exit(1);
while ((size= my_fread(stdin, buf, sizeof(buf), MYF(MY_WME))) > 0)
if ((int)my_fwrite(f, buf, size, MYF(MY_WME)) != size)
my_exit(1);
my_fclose(f, MYF(0));
my_exit(0);
}
void do_exec(char *args[])
{
if (!args[0])
do_usage();
my_end(0);
execvp(args[0], args);
}
int main(int argc, char *argv[])
{
struct passwd *user_info;
MY_INIT(argv[0]);
if (argc < 3)
do_usage(argv[0]);
user_info= my_check_user(argv[1], MYF(0));
if (user_info ? my_set_user(argv[1], user_info, MYF(MY_WME))
: my_errno == EINVAL)
my_exit(1);
if (strcmp(argv[2], "log") == 0)
do_log(argv[3]);
if (strcmp(argv[2], "exec") == 0)
do_exec(argv+3);
my_end(0);
return 1;
}
...@@ -668,8 +668,12 @@ extern void *my_memmem(const void *haystack, size_t haystacklen, ...@@ -668,8 +668,12 @@ extern void *my_memmem(const void *haystack, size_t haystacklen,
#ifdef _WIN32 #ifdef _WIN32
extern int my_access(const char *path, int amode); extern int my_access(const char *path, int amode);
#define my_check_user(A,B) (NULL)
#define my_set_user(A,B,C) (0)
#else #else
#define my_access access #define my_access access
struct passwd *my_check_user(const char *user, myf MyFlags);
int my_set_user(const char *user, struct passwd *user_info, myf MyFlags);
#endif #endif
extern int check_if_legal_filename(const char *path); extern int check_if_legal_filename(const char *path);
......
...@@ -434,8 +434,8 @@ static void emb_free_embedded_thd(MYSQL *mysql) ...@@ -434,8 +434,8 @@ static void emb_free_embedded_thd(MYSQL *mysql)
thread_count--; thread_count--;
thd->store_globals(); thd->store_globals();
thd->unlink(); thd->unlink();
delete thd;
mysql_mutex_unlock(&LOCK_thread_count); mysql_mutex_unlock(&LOCK_thread_count);
delete thd;
my_pthread_setspecific_ptr(THR_THD, 0); my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0; mysql->thd=0;
} }
......
'\" t '\" t
.\" .\"
.TH "\FBMYSQL_SECURE_INST" "1" "14/12/2015" "MariaDB 10\&.1" "MariaDB Database System" .TH "\FBMYSQL_SECURE_INST" "1" "3 January 2017" "MariaDB 10\&.1" "MariaDB Database System"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
...@@ -71,9 +71,8 @@ test ...@@ -71,9 +71,8 @@ test
database, which by default can be accessed by anonymous users\&. database, which by default can be accessed by anonymous users\&.
.RE .RE
.PP .PP
Invoke
\fBmysql_secure_installation\fR \fBmysql_secure_installation\fR
without arguments: can be invoked without arguments:
.sp .sp
.if n \{\ .if n \{\
.RS 4 .RS 4
...@@ -86,10 +85,75 @@ shell> \fBmysql_secure_installation\fR ...@@ -86,10 +85,75 @@ shell> \fBmysql_secure_installation\fR
.\} .\}
.PP .PP
The script will prompt you to determine which actions to perform\&. The script will prompt you to determine which actions to perform\&.
.PP
\fBmysql_secure_installation\fR
accepts some options:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: basedir option
.\" basedir option: mysql_secure_installation
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
Base directory\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: defaults-extra-file option
.\" defaults-extra-file option: mysql_secure_installation
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Additional option file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: defaults-file option
.\" defaults-file option: mysql_secure_installation
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Option file\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysql_secure_installation: no-defaults option
.\" no-defaults option: mysql_secure_installation
\fB\-\-no\-defaults\fR
.sp
Don't read any defaults file\&.
.RE
.sp
Other unrecognized options will be passed on to the server\&.
.SH "COPYRIGHT" .SH "COPYRIGHT"
.br .br
.PP .PP
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2017 MariaDB Foundation
.PP .PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP .PP
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# then set default's client character set(latin1) as client's character set. # then set default's client character set(latin1) as client's character set.
############################################################################### ###############################################################################
--source include/master-slave.inc --source include/master-slave.inc
call mtr.add_suppression("Cannot use utf16 as character_set_client"); call mtr.add_suppression("'utf16' can not be used as client character set");
CREATE TABLE t1(i VARCHAR(20)); CREATE TABLE t1(i VARCHAR(20));
INSERT INTO t1 VALUES (0xFFFF); INSERT INTO t1 VALUES (0xFFFF);
--sync_slave_with_master --sync_slave_with_master
......
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--echo # Kill the server
--exec echo "wait" > $_expect_file_name
--shutdown_server 0
--source include/wait_until_disconnected.inc
...@@ -82,8 +82,14 @@ perl; ...@@ -82,8 +82,14 @@ perl;
} }
$ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1}; $ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1};
if ($content =~ m{$search_pattern}) { if ($content =~ m{$search_pattern}) {
die "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
if $ENV{SEARCH_ABORT} eq 'FOUND';
print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n" print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
unless defined $ENV{SEARCH_ABORT};
} else { } else {
die "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
if $ENV{SEARCH_ABORT} eq 'NOT FOUND';
print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n" print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
unless defined $ENV{SEARCH_ABORT};
} }
EOF EOF
# Include this script only after using shutdown_mysqld.inc # Include this script only after using shutdown_mysqld.inc
# where $_expect_file_name was initialized. # where $_expect_file_name was initialized.
# Write file to make mysql-test-run.pl start up the server again # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $_expect_file_name if ($restart_parameters)
{
--exec echo "restart: $restart_parameters" > $_expect_file_name
}
if (!$restart_parameters)
{
--exec echo "restart" > $_expect_file_name
}
# Turn on reconnect # Turn on reconnect
--enable_reconnect --enable_reconnect
......
...@@ -26,6 +26,10 @@ let $_slave_timeout= $slave_timeout; ...@@ -26,6 +26,10 @@ let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout) if (!$_slave_timeout)
{ {
let $_slave_timeout= 300; let $_slave_timeout= 300;
if ($VALGRIND_TEST)
{
let $_slave_timeout= 1500;
}
} }
--let $_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1) --let $_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
......
...@@ -50,6 +50,10 @@ let $_slave_timeout= $slave_timeout; ...@@ -50,6 +50,10 @@ let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout) if (!$_slave_timeout)
{ {
let $_slave_timeout= 300; let $_slave_timeout= 300;
if ($VALGRIND_TEST)
{
let $_slave_timeout= 1500;
}
} }
if ($slave_error_param == '') if ($slave_error_param == '')
......
...@@ -2086,6 +2086,21 @@ tab1 CREATE TABLE `tab1` ( ...@@ -2086,6 +2086,21 @@ tab1 CREATE TABLE `tab1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `tab1`; DROP TABLE `tab1`;
# #
# MDEV-11548 Reproducible server crash after the 2nd ALTER TABLE ADD FOREIGN KEY IF NOT EXISTS
#
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY);
CREATE TABLE t2 (id1 INT UNSIGNED NOT NULL);
ALTER TABLE t2
ADD FOREIGN KEY IF NOT EXISTS (id1)
REFERENCES t1 (id);
ALTER TABLE t2
ADD FOREIGN KEY IF NOT EXISTS (id1)
REFERENCES t1 (id);
Warnings:
Note 1061 Duplicate key name 'id1'
DROP TABLE t2;
DROP TABLE t1;
#
# Start of 10.1 tests # Start of 10.1 tests
# #
# #
......
Supports Markdown
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