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
cvicentiu committed Jan 16, 2017
2 parents ebb8c9f + 66744f4 commit 8e15768
Show file tree
Hide file tree
Showing 180 changed files with 10,539 additions and 2,460 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ extra/jemalloc/build/
extra/jemalloc/tmp/
extra/my_print_defaults
extra/mysql_waitpid
extra/mysqld_safe_helper
extra/perror
extra/replace
extra/resolve_stack_dump
Expand Down Expand Up @@ -217,6 +218,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
6 changes: 4 additions & 2 deletions client/mysqladmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1564,8 +1564,10 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)

if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'"))
{
my_printf_error(0, "query failed; error: '%s'", error_flags,
mysql_error(mysql));
my_printf_error(mysql_errno(mysql),
"The query to get the server's pid file failed,"
" error: '%s'. Continuing.", error_flags,
mysql_error(mysql));
}
result = mysql_store_result(mysql);
if (result)
Expand Down
1 change: 1 addition & 0 deletions debian/mariadb-server-10.1.files.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ usr/bin/mysql_zap
usr/bin/mysqlbinlog
usr/bin/mysqld_multi
usr/bin/mysqld_safe
usr/bin/mysqld_safe_helper
usr/bin/mysqlhotcopy
usr/bin/perror
usr/bin/replace
Expand Down
3 changes: 3 additions & 0 deletions extra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@ IF(UNIX)

MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client)
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()
77 changes: 77 additions & 0 deletions extra/mysqld_safe_helper.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#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;
}
4 changes: 4 additions & 0 deletions include/my_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,12 @@ extern void *my_memmem(const void *haystack, size_t haystacklen,

#ifdef _WIN32
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
#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

extern int check_if_legal_filename(const char *path);
Expand Down
72 changes: 68 additions & 4 deletions man/mysql_secure_installation.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'\" 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
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -71,9 +71,8 @@ test
database, which by default can be accessed by anonymous users\&.
.RE
.PP
Invoke
\fBmysql_secure_installation\fR
without arguments:
can be invoked without arguments:
.sp
.if n \{\
.RS 4
Expand All @@ -86,10 +85,75 @@ shell> \fBmysql_secure_installation\fR
.\}
.PP
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"
.br
.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
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
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/extra/rpl_tests/rpl_special_charset.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# then set default's client character set(latin1) as client's character set.
###############################################################################
--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));
INSERT INTO t1 VALUES (0xFFFF);
--sync_slave_with_master
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/r/create.result
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,13 @@ end|
create table t1 as select f1();
ERROR 42S02: Table 'test.t1' doesn't exist
drop function f1;
#
# MDEV-10274 Bundling insert with create statement
# for table with unsigned Decimal primary key issues warning 1194
#
create table t1(ID decimal(2,1) unsigned NOT NULL, PRIMARY KEY (ID))engine=memory
select 2.1 ID;
drop table t1;
End of 5.5 tests
create table t1;
ERROR 42000: A table must have at least 1 column
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 @@ -4576,6 +4576,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
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_ucs2_def.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call mtr.add_suppression("Cannot use ucs2 as character_set_client");
call mtr.add_suppression("'ucs2' can not be used as client character set");
show variables like 'collation_server';
Variable_name Value
collation_server ucs2_unicode_ci
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_ucs2_query_cache.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call mtr.add_suppression("Cannot use ucs2 as character_set_client");
call mtr.add_suppression("'ucs2' can not be used as client character set");
#
# Start 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 @@ -1584,6 +1584,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
2 changes: 1 addition & 1 deletion mysql-test/r/ctype_utf16_def.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
call mtr.add_suppression("Cannot use utf16 as character_set_client");
call mtr.add_suppression("'utf16' can not be used as client character set");
SHOW VARIABLES LIKE 'collation_server';
Variable_name Value
collation_server utf16_general_ci
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 @@ -1668,6 +1668,16 @@ c
Warnings:
Warning 1300 Invalid utf32 character string: '\xFF\xFF\x00\x00'
#
# 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
13 changes: 13 additions & 0 deletions mysql-test/r/events_slowlog.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set @event_scheduler_save= @@global.event_scheduler;
set @slow_query_log_save= @@global.slow_query_log;
set global event_scheduler= on;
set global slow_query_log= on;
set global long_query_time=0.2;
create table t1 (i int);
insert into t1 values (0);
create event ev on schedule at CURRENT_TIMESTAMP + INTERVAL 1 second do update t1 set i=1+sleep(0.5);
FOUND /update t1 set i=1/ in mysqld-slow.log
drop table t1;
set global event_scheduler= @event_scheduler_save;
set global slow_query_log= @slow_query_log_save;
set global long_query_time= @@session.long_query_time;
6 changes: 6 additions & 0 deletions mysql-test/r/func_time.result
Original file line number Diff line number Diff line change
Expand Up @@ -2765,6 +2765,12 @@ id date1 date2 DATE_ADD(a.date1,INTERVAL -10 DAY) TO_DAYS(a.date1)-10
18 2010-10-13 2010-10-03 2010-10-03 734413
DROP TABLE t1;
#
# MDEV-10524 Assertion `arg1_int >= 0' failed in Item_func_additive_op::result_precision()
#
SELECT 1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2;
1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2
3
#
# Start of 10.0 tests
#
#
Expand Down
29 changes: 29 additions & 0 deletions mysql-test/r/index_merge_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -799,3 +799,32 @@ a b c
9 d d
DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;
#
# MDEV-10927: Crash When Using sort_union Optimization
#
set @tmp_optimizer_switch=@@optimizer_switch;
SET optimizer_switch='index_merge_sort_intersection=on';
SET SESSION sort_buffer_size = 1024;
create table t1 (
pk int(11) NOT NULL AUTO_INCREMENT,
col1 int(11) NOT NULL,
col2 int(11) NOT NULL,
col3 int(11) NOT NULL,
key2 int(11) NOT NULL,
col4 int(11) NOT NULL,
key1 int(11) NOT NULL,
PRIMARY KEY (pk),
KEY key1 (key1),
KEY key2 (key2)
) ENGINE=InnoDB AUTO_INCREMENT=12860259 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
create table t2(a int);
insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t3(a int);
insert into t3 select A.a + B.a* 10 + C.a * 100 + D.a*1000 from t2 A, t2 B, t2 C, t2 D;
insert into t1 (key1, key2, col1,col2,col3,col4)
select a,a, a,a,a,a from t3;
SELECT sum(col1) FROM t1 FORCE INDEX (key1,key2) WHERE (key1 between 10 and 8191+10) or (key2= 5);
sum(col1)
33632261
drop table t1,t2,t3;
set optimizer_switch=@tmp_optimizer_switch;
8 changes: 8 additions & 0 deletions mysql-test/r/information_schema_part.result
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,11 @@ select create_options from information_schema.tables where table_schema="test";
create_options
partitioned
drop table t1;
#
# MDEV-11353 - Identical logical conditions
#
CREATE TABLE t1(a INT) CHECKSUM=1 SELECT 1;
SELECT CHECKSUM FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
CHECKSUM
3036305396
DROP TABLE t1;
Loading

0 comments on commit 8e15768

Please sign in to comment.