summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-04-11 10:18:04 -0400
committerSergei Golubchik <serg@mariadb.org>2017-04-11 10:18:04 -0400
commit663068c6eea736a38eff9ac183326d6c7e4e239b (patch)
tree54927ab8209a73403320aac67b6172508caed7d6
parent5c579482eb2dd33c7fea80ea1ab412977606458a (diff)
parent6fa5e0814662d691be1a29bf88332348ec7c50c9 (diff)
downloadmariadb-git-663068c6eea736a38eff9ac183326d6c7e4e239b.tar.gz
Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55
-rw-r--r--CMakeLists.txt13
-rw-r--r--client/client_priv.h1
-rw-r--r--client/mysql.cc2
-rw-r--r--client/mysql_upgrade.c3
-rw-r--r--client/mysqladmin.cc2
-rw-r--r--client/mysqlcheck.c2
-rw-r--r--client/mysqldump.c5
-rw-r--r--client/mysqlimport.c2
-rw-r--r--client/mysqlshow.c2
-rw-r--r--client/mysqlslap.c2
-rw-r--r--client/mysqltest.cc2
-rw-r--r--include/welcome_copyright_notice.h6
-rw-r--r--mysql-test/disabled.def1
-rwxr-xr-xmysql-test/mysql-test-run.pl11
-rw-r--r--mysql-test/r/events_2.result4
-rw-r--r--mysql-test/r/loaddata.result2
-rw-r--r--mysql-test/r/log_tables-big.result14
-rw-r--r--mysql-test/r/mysqldump.result63
-rw-r--r--mysql-test/r/symlink.result11
-rw-r--r--mysql-test/t/events_2.test2
-rw-r--r--mysql-test/t/loaddata.test2
-rw-r--r--mysql-test/t/log_tables-big.test16
-rw-r--r--mysql-test/t/mysqldump.test50
-rw-r--r--mysql-test/t/symlink.test16
-rw-r--r--mysql-test/valgrind.supp11
-rw-r--r--packaging/rpm-oel/mysql.init34
-rw-r--r--regex/regcomp.c24
-rw-r--r--scripts/mysql_secure_installation.sh67
-rw-r--r--scripts/mysqld_safe.sh1
-rw-r--r--sql/item_strfunc.cc21
-rw-r--r--sql/item_xmlfunc.cc7
-rw-r--r--sql/sp.cc6
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_const.h1
-rw-r--r--sql/sql_load.cc78
-rw-r--r--sql/sql_parse.cc4
-rw-r--r--sql/sql_table.cc15
-rw-r--r--storage/innobase/srv/srv0srv.c7
-rw-r--r--storage/innobase/trx/trx0roll.c4
-rw-r--r--support-files/CMakeLists.txt4
-rw-r--r--support-files/mysql.server.sh10
41 files changed, 379 insertions, 151 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52fa188347e..6ab17ebf64c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
-# Copyright (c) 2006, 2014, Oracle and/or its affiliates.
-# Copyright (c) 2008, 2014, Monty Program Ab
+# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
+# Copyright (c) 2008, 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
@@ -239,12 +239,9 @@ IF (WITH_ASAN)
ENDIF()
ENDIF()
-
-OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
-IF(ENABLE_DEBUG_SYNC)
- SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
-ENDIF()
+# Always enable debug sync for debug builds.
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
IF (ENABLE_GCOV AND NOT WIN32 AND NOT APPLE)
diff --git a/client/client_priv.h b/client/client_priv.h
index d89ca89c405..b5c647fbd0c 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -114,4 +114,3 @@ enum options_client
Name of the performance schema database.
*/
#define PERFORMANCE_SCHEMA_DB_NAME "performance_schema"
-
diff --git a/client/mysql.cc b/client/mysql.cc
index 9b1999f2c38..57cb0a918a7 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 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
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index eaa10245a94..836f2c1686b 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 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
@@ -1095,4 +1095,3 @@ end:
my_end(my_end_arg);
exit(0);
}
-
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 1f0018edba1..105e195c269 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, Monty Program Ab.
+ Copyright (c) 2010, 2017, Monty Program Ab.
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
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index a07fc773726..8b938580679 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2011, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 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
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 6e9d8946a0f..2e3270a2fed 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 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
@@ -2049,7 +2049,6 @@ static void print_comment(FILE *sql_file, my_bool is_error, const char *format,
print_xml_comment(sql_file, strlen(comment_buff), comment_buff);
}
-
/*
create_delimiter
Generate a new (null-terminated) string that does not exist in query
@@ -2391,7 +2390,7 @@ static uint dump_routines_for_db(char *db)
query_buff);
print_comment(sql_file, 1,
"-- does %s have permissions on mysql.proc?\n\n",
- current_user);
+ fix_for_comment(current_user));
maybe_die(EX_MYSQLERR,"%s has insufficent privileges to %s!", current_user, query_buff);
}
else if (strlen(row[2]))
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 850a851b4aa..9fd96965213 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB
+ Copyright (c) 2011, 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
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 4349c063ee8..8bfbd87aca6 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 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
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 4f6fc7d45cb..a9746916411 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 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
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index d9fa9bc0bef..5327bb7717b 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, Monty Program Ab.
+ Copyright (c) 2009, 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
diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h
index e9891856221..cd7cd6692be 100644
--- a/include/welcome_copyright_notice.h
+++ b/include/welcome_copyright_notice.h
@@ -1,5 +1,5 @@
-/* Copyright (c) 2011, 2016, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB
+/* Copyright (c) 2011, 2017, Oracle and/or its affiliates.
+ Copyright (c) 2011, 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
@@ -17,7 +17,7 @@
#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_
-#define COPYRIGHT_NOTICE_CURRENT_YEAR "2016"
+#define COPYRIGHT_NOTICE_CURRENT_YEAR "2017"
/*
This define specifies copyright notice which is displayed by every MySQL
diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def
index 310890605ff..c7fa62ff7dd 100644
--- a/mysql-test/disabled.def
+++ b/mysql-test/disabled.def
@@ -12,7 +12,6 @@
tablespace : disabled in MariaDB (no TABLESPACE table attribute)
events_time_zone : Test is not predictable as it depends on precise timing.
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
-log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
file_contents : MDEV-6526 these files are not installed anymore
lowercase_fs_on : lower_case_table_names=0 is not an error until 10.1
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 4229ceedb4d..02ca2fc4a83 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3188,13 +3188,10 @@ sub mysql_server_start($) {
if (! $opt_start_dirty) # If dirty, keep possibly grown system db
{
# Copy datadir from installed system db
- for my $path ( "$opt_vardir", "$opt_vardir/..") {
- my $install_db= "$path/install.db";
- copytree($install_db, $datadir)
- if -d $install_db;
- }
- mtr_error("Failed to copy system db to '$datadir'")
- unless -d $datadir;
+ my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/..";
+ my $install_db= "$path/install.db";
+ copytree($install_db, $datadir) if -d $install_db;
+ mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir;
}
}
else
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index 17eee91f918..31a501d48a6 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -1,10 +1,10 @@
drop database if exists events_test;
create database events_test;
use events_test;
-create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
+create event e_26 on schedule at '2037-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
-events_test e_26 set @a = 5 root@localhost 2027-01-01 00:00:00 DROP
+events_test e_26 set @a = 5 root@localhost 2037-01-01 00:00:00 DROP
drop event e_26;
create event e_26 on schedule at NULL disable do set @a = 5;
ERROR HY000: Incorrect AT value: 'NULL'
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index ce26abea66d..0421c591aff 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -316,7 +316,7 @@ FIELDS ESCAPED BY '\\'
TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n' (c0, c2);
-ERROR HY000: Invalid column reference (v2.c0) in LOAD DATA
+ERROR HY000: Column 'c0' is not updatable
LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v3
FIELDS ESCAPED BY '\\'
diff --git a/mysql-test/r/log_tables-big.result b/mysql-test/r/log_tables-big.result
index 9b81127c825..1e189a7726f 100644
--- a/mysql-test/r/log_tables-big.result
+++ b/mysql-test/r/log_tables-big.result
@@ -1,29 +1,31 @@
+set @@global.log_output = 'TABLE';
set session long_query_time=10;
select get_lock('bug27638', 1);
get_lock('bug27638', 1)
1
set session long_query_time=1;
-truncate table mysql.slow_log;
select get_lock('bug27638', 2);
get_lock('bug27638', 2)
0
-select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
+select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+where sql_text = 'select get_lock(\'bug27638\', 2)';
qt sql_text
OK select get_lock('bug27638', 2)
-truncate table mysql.slow_log;
select get_lock('bug27638', 60);
get_lock('bug27638', 60)
0
-select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
+select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+where sql_text = 'select get_lock(\'bug27638\', 60)';
qt sql_text
OK select get_lock('bug27638', 60)
-truncate table mysql.slow_log;
select get_lock('bug27638', 101);
get_lock('bug27638', 101)
0
-select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
+select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+where sql_text = 'select get_lock(\'bug27638\', 101)';
qt sql_text
OK select get_lock('bug27638', 101)
select release_lock('bug27638');
release_lock('bug27638')
1
+set @@global.log_output=default;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index b205b81880e..68de653742c 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -5308,6 +5308,69 @@ a
DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db_20772273;
+#
+# Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY
+#
+CREATE DATABASE bug25717383;
+use bug25717383;
+CREATE TABLE `tab
+one` (a int);
+CREATE VIEW `view
+one` as SELECT * FROM `tab
+one`;
+CREATE PROCEDURE `proc
+one`() SELECT * from `tab
+one`;
+CREATE TEMPORARY TABLE `temp
+one` (id INT);
+CREATE TRIGGER `trig
+one` BEFORE INSERT ON `tab
+one` FOR EACH ROW SET NEW.a = 1;
+CREATE EVENT `event
+one` ON SCHEDULE AT '2030-01-01 00:00:00' DO SET @a=5;
+SHOW TABLES FROM bug25717383;
+Tables_in_bug25717383
+tab
+one
+view
+one
+SHOW TRIGGERS FROM bug25717383;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trig
+one INSERT tab
+one SET NEW.a = 1 BEFORE NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+SHOW EVENTS FROM bug25717383;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+bug25717383 event
+one root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci latin1_swedish_ci
+SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE'
+ ORDER BY ROUTINE_NAME;
+ROUTINE_NAME
+proc
+one
+SHOW TABLES FROM bug25717383;
+Tables_in_bug25717383
+tab
+one
+view
+one
+SHOW TRIGGERS FROM bug25717383;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+trig
+one INSERT tab
+one SET NEW.a = 1 BEFORE NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+SHOW EVENTS FROM bug25717383;
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+bug25717383 event
+one root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL ENABLED 1 utf8 utf8_general_ci latin1_swedish_ci
+SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE'
+ ORDER BY ROUTINE_NAME;
+ROUTINE_NAME
+proc
+one
+DROP DATABASE bug25717383;
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 20736aec47f..22b64cc346c 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -213,3 +213,14 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop tables t1, t2;
+#
+# Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE
+# WITH DATA DIRECTORY
+#
+# Make sure we have no current database
+CREATE DATABASE x;
+USE x;
+DROP DATABASE x;
+CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
+DATA DIRECTORY "MYSQLTEST_VARDIR/tmp";
+DROP TABLE test.t1;
diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test
index 5443f76d1a1..bc906e37457 100644
--- a/mysql-test/t/events_2.test
+++ b/mysql-test/t/events_2.test
@@ -13,7 +13,7 @@ use events_test;
# mysql.event intact checking end
#
-create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
+create event e_26 on schedule at '2037-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
drop event e_26;
--error ER_WRONG_VALUE
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 1bc7eb139b9..8f8ff3520a2 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -294,7 +294,7 @@ SELECT * FROM v2;
DELETE FROM t1;
--echo
---error ER_LOAD_DATA_INVALID_COLUMN
+--error ER_NONUPDATEABLE_COLUMN
LOAD DATA INFILE '../../std_data/bug35469.dat' INTO TABLE v2
FIELDS ESCAPED BY '\\'
TERMINATED BY ','
diff --git a/mysql-test/t/log_tables-big.test b/mysql-test/t/log_tables-big.test
index 8c956fa6f55..8936a163d73 100644
--- a/mysql-test/t/log_tables-big.test
+++ b/mysql-test/t/log_tables-big.test
@@ -7,6 +7,8 @@
# check that CSV engine was compiled in
--source include/have_csv.inc
+set @@global.log_output = 'TABLE';
+
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
@@ -18,18 +20,20 @@ set session long_query_time=10;
select get_lock('bug27638', 1);
connection con2;
set session long_query_time=1;
-truncate table mysql.slow_log;
select get_lock('bug27638', 2);
-select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
-truncate table mysql.slow_log;
+select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+ where sql_text = 'select get_lock(\'bug27638\', 2)';
select get_lock('bug27638', 60);
-select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
-truncate table mysql.slow_log;
+select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+ where sql_text = 'select get_lock(\'bug27638\', 60)';
select get_lock('bug27638', 101);
-select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
+select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+ where sql_text = 'select get_lock(\'bug27638\', 101)';
connection con1;
select release_lock('bug27638');
connection default;
disconnect con1;
disconnect con2;
+
+set @@global.log_output=default;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 7b517a7ce59..39ca5b3c58e 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2480,6 +2480,56 @@ DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db_20772273;
+--echo #
+--echo # Bug #25717383: MYSQLDUMP MAY EXECUTE ANY ARBITRARY QUERY
+--echo #
+
+
+CREATE DATABASE bug25717383;
+use bug25717383;
+
+CREATE TABLE `tab
+one` (a int);
+CREATE VIEW `view
+one` as SELECT * FROM `tab
+one`;
+
+CREATE PROCEDURE `proc
+one`() SELECT * from `tab
+one`;
+
+CREATE TEMPORARY TABLE `temp
+one` (id INT);
+
+CREATE TRIGGER `trig
+one` BEFORE INSERT ON `tab
+one` FOR EACH ROW SET NEW.a = 1;
+
+CREATE EVENT `event
+one` ON SCHEDULE AT '2030-01-01 00:00:00' DO SET @a=5;
+
+SHOW TABLES FROM bug25717383;
+SHOW TRIGGERS FROM bug25717383;
+--replace_column 6 #
+SHOW EVENTS FROM bug25717383;
+
+SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES
+ WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE'
+ ORDER BY ROUTINE_NAME;
+
+--exec $MYSQL_DUMP --triggers --events --routines --add-drop-database --databases bug25717383 > $MYSQLTEST_VARDIR/tmp/bug25717383.sql
+
+SHOW TABLES FROM bug25717383;
+SHOW TRIGGERS FROM bug25717383;
+--replace_column 6 #
+SHOW EVENTS FROM bug25717383;
+
+SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES
+ WHERE ROUTINE_SCHEMA='bug25717383' AND ROUTINE_TYPE= 'PROCEDURE'
+ ORDER BY ROUTINE_NAME;
+
+DROP DATABASE bug25717383;
+
#
# MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server
#
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 20585dd9ab7..7638061a8aa 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -298,3 +298,19 @@ show create table t1;
create table t2 like t1;
show create table t2;
drop tables t1, t2;
+
+--echo #
+--echo # Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE
+--echo # WITH DATA DIRECTORY
+--echo #
+
+--echo # Make sure we have no current database
+CREATE DATABASE x;
+USE x;
+DROP DATABASE x;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
+DATA DIRECTORY "$MYSQLTEST_VARDIR/tmp";
+
+DROP TABLE test.t1;
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 4448f2a069a..71e6836365e 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1,5 +1,5 @@
# Copyright (c) 2005, 2015, Oracle and/or its affiliates.
-# Copyright (c) 2008, 2016, MariaDB
+# Copyright (c) 2008, 2017, MariaDB
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -525,6 +525,15 @@
fun:dl_open_worker
}
+{
+ libc pthread_exit 9
+ Memcheck:Leak
+ fun:malloc
+ fun:_dl_close_worker
+ fun:_dl_close
+ fun:_dl_catch_error
+}
+
#
# This is seen internally in the system libraries on 64-bit RHAS3.
#
diff --git a/packaging/rpm-oel/mysql.init b/packaging/rpm-oel/mysql.init
index 79c8a8daa7d..56dee65888f 100644
--- a/packaging/rpm-oel/mysql.init
+++ b/packaging/rpm-oel/mysql.init
@@ -23,31 +23,37 @@ prog="mysqld"
STARTTIMEOUT=120
STOPTIMEOUT=60
+# Set in /etc/sysconfig/mysqld, will be passed to mysqld_safe
+MYSQLD_OPTS=
+
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
-# extract value of a MySQL option from config files
-# Usage: get_mysql_option SECTION VARNAME DEFAULT
-# result is returned in $result
+# Extract value of a MySQL option from config files
+# Usage: get_mysql_option OPTION DEFAULT SECTION1 SECTION2 SECTIONN
+# 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(){
- result=`/usr/bin/my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1`
- if [ -z "$result" ]; then
- # not found, use default
- result="$3"
- fi
+get_mysql_option () {
+ option=$1
+ default=$2
+ shift 2
+ result=$(/usr/bin/my_print_defaults "$@" | sed -n "s/^--${option}=//p" | tail -n 1)
+ if [ -z "$result" ]; then
+ # not found, use default
+ result="${default}"
+ fi
}
-get_mysql_option mysqld datadir "/var/lib/mysql"
+get_mysql_option datadir "/var/lib/mysql" mysqld
datadir="$result"
-get_mysql_option mysqld socket "$datadir/mysql.sock"
+get_mysql_option socket "$datadir/mysql.sock" mysqld
socketfile="$result"
-get_mysql_option mysqld_safe log-error "/var/log/mysqld.log"
+get_mysql_option log-error "/var/log/mysqld.log" mysqld mysqld_safe
errlogfile="$result"
-get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid"
+get_mysql_option pid-file "/var/run/mysqld/mysqld.pid" mysqld mysqld_safe
mypidfile="$result"
case $socketfile in
@@ -100,7 +106,7 @@ start(){
# 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" \
+ $exec $MYSQLD_OPTS --datadir="$datadir" --socket="$socketfile" \
--pid-file="$mypidfile" \
--basedir=/usr --user=mysql >/dev/null 2>&1 &
safe_pid=$!
diff --git a/regex/regcomp.c b/regex/regcomp.c
index b1074a1d79c..13275237d2a 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -3,7 +3,7 @@
This file was modified by Oracle on 2015-05-18 for 32-bit compatibility.
- Modifications copyright (c) 2015, Oracle and/or its affiliates. All rights
+ Modifications copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights
reserved. */
#include <my_global.h>
@@ -551,6 +551,8 @@ int starordinary; /* is a leading * an ordinary character? */
assert(OP(p->strip[p->pbegin[i]]) == OLPAREN);
assert(OP(p->strip[p->pend[i]]) == ORPAREN);
(void) dupl(p, p->pbegin[i]+1, p->pend[i]);
+ if (p->error != 0)
+ break; /* purecov: inspected */
EMIT(O_BACK, i);
} else
SETERROR(REG_ESUBREG);
@@ -1031,6 +1033,8 @@ int to; /* to this number of times (maybe RE_INFINITY) */
AHEAD(THERE()); /* ...so fix it */
ASTERN(O_CH, THERETHERE());
copy = dupl(p, start+1, finish+1);
+ if (p->error != 0)
+ return; /* purecov: inspected */
assert(copy == finish+4);
repeat(p, copy, 1, to-1);
break;
@@ -1040,10 +1044,14 @@ int to; /* to this number of times (maybe RE_INFINITY) */
break;
case REP(N, N): /* as xx{m-1,n-1} */
copy = dupl(p, start, finish);
+ if (p->error != 0)
+ return;
repeat(p, copy, from-1, to-1);
break;
case REP(N, INF): /* as xx{n-1,INF} */
copy = dupl(p, start, finish);
+ if (p->error != 0)
+ return; /* purecov: inspected */
repeat(p, copy, from-1, to);
break;
default: /* "can't happen" */
@@ -1366,6 +1374,9 @@ sopno finish; /* to this less one */
if (len == 0)
return(ret);
enlarge(p, p->ssize + len); /* this many unexpected additions */
+ if (p->error != 0)
+ return(p->error);
+
assert(p->ssize >= p->slen + len);
(void) memcpy((char *)(p->strip + p->slen),
(char *)(p->strip + start), (size_t)len*sizeof(sop));
@@ -1438,7 +1449,7 @@ sopno pos;
}
}
{
- int length=(HERE()-pos-1)*sizeof(sop);
+ size_t length=(HERE()-pos-1)*sizeof(sop);
bmove_upp((uchar *) &p->strip[pos+1]+length,
(uchar *) &p->strip[pos]+length,
length);
@@ -1482,6 +1493,15 @@ register sopno size;
if (p->ssize >= size)
return;
+ DBUG_EXECUTE_IF("bug24449090_simulate_oom",
+ {
+ free(p->strip);
+ p->strip= NULL;
+ p->ssize= 0;
+ SETERROR(REG_ESPACE);
+ return;
+ });
+
sp = (sop *)realloc(p->strip, size*sizeof(sop));
if (sp == NULL) {
SETERROR(REG_ESPACE);
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index 7fb8b73ef8f..f7559c5683b 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2002, 2012, Oracle and/or its affiliates.
+# Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -196,6 +196,20 @@ set_echo_compat() {
esac
}
+validate_reply () {
+ ret=0
+ if [ -z "$1" ]; then
+ reply=y
+ return $ret
+ fi
+ case $1 in
+ y|Y|yes|Yes|YES) reply=y ;;
+ n|N|no|No|NO) reply=n ;;
+ *) ret=1 ;;
+ esac
+ return $ret
+}
+
prepare() {
touch $config $command
chmod 600 $config $command
@@ -400,15 +414,18 @@ echo "Setting the root password ensures that nobody can log into the MariaDB"
echo "root user without the proper authorisation."
echo
-if [ $hadpass -eq 0 ]; then
- echo $echo_n "Set root password? [Y/n] $echo_c"
-else
- echo "You already have a root password set, so you can safely answer 'n'."
- echo
- echo $echo_n "Change the root password? [Y/n] $echo_c"
-fi
+while true ; do
+ if [ $hadpass -eq 0 ]; then
+ echo $echo_n "Set root password? [Y/n] $echo_c"
+ else
+ echo "You already have a root password set, so you can safely answer 'n'."
+ echo
+ echo $echo_n "Change the root password? [Y/n] $echo_c"
+ fi
+ read reply
+ validate_reply $reply && break
+done
-read reply
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -432,9 +449,11 @@ echo "go a bit smoother. You should remove them before moving into a"
echo "production environment."
echo
-echo $echo_n "Remove anonymous users? [Y/n] $echo_c"
-
-read reply
+while true ; do
+ echo $echo_n "Remove anonymous users? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -450,9 +469,11 @@ echo
echo "Normally, root should only be allowed to connect from 'localhost'. This"
echo "ensures that someone cannot guess at the root password from the network."
echo
-
-echo $echo_n "Disallow root login remotely? [Y/n] $echo_c"
-read reply
+while true ; do
+ echo $echo_n "Disallow root login remotely? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -470,8 +491,12 @@ echo "access. This is also intended only for testing, and should be removed"
echo "before moving into a production environment."
echo
-echo $echo_n "Remove test database and access to it? [Y/n] $echo_c"
-read reply
+while true ; do
+ echo $echo_n "Remove test database and access to it? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
+
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -488,8 +513,12 @@ echo "Reloading the privilege tables will ensure that all changes made so far"
echo "will take effect immediately."
echo
-echo $echo_n "Reload privilege tables now? [Y/n] $echo_c"
-read reply
+while true ; do
+ echo $echo_n "Reload privilege tables now? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
+
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index a93a18c729c..b644184b1e1 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -950,4 +950,3 @@ do
done
log_notice "mysqld from pid file $pid_file ended"
-
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index ec9580bfabd..756ab5152ca 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab.
+ Copyright (c) 2000, 2017, Oracle and/or its affiliates.
+ Copyright (c) 2009, 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
@@ -3449,6 +3449,7 @@ String *Item_func_quote::val_str(String *str)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
+ ulong max_allowed_packet= current_thd->variables.max_allowed_packet;
char *from, *to, *end, *start;
String *arg= args[0]->val_str(str);
uint arg_length, new_length;
@@ -3467,11 +3468,14 @@ String *Item_func_quote::val_str(String *str)
new_length= arg_length + 2; /* for beginning and ending ' signs */
for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++)
new_length+= get_esc_bit(escmask, (uchar) *from);
+ if (new_length > max_allowed_packet)
+ goto toolong;
}
else
{
new_length= (arg_length * 2) + /* For string characters */
(2 * collation.collation->mbmaxlen); /* For quotes */
+ set_if_smaller(new_length, max_allowed_packet);
}
if (tmp_value.alloc(new_length))
@@ -3487,7 +3491,7 @@ String *Item_func_quote::val_str(String *str)
/* Put leading quote */
if ((mblen= cs->cset->wc_mb(cs, '\'', (uchar *) to, to_end)) <= 0)
- goto null;
+ goto toolong;
to+= mblen;
for (start= (char*) arg->ptr(), end= start + arg_length; start < end; )
@@ -3507,17 +3511,17 @@ String *Item_func_quote::val_str(String *str)
if (escape)
{
if ((mblen= cs->cset->wc_mb(cs, '\\', (uchar*) to, to_end)) <= 0)
- goto null;
+ goto toolong;
to+= mblen;
}
if ((mblen= cs->cset->wc_mb(cs, wc, (uchar*) to, to_end)) <= 0)
- goto null;
+ goto toolong;
to+= mblen;
}
/* Put trailing quote */
if ((mblen= cs->cset->wc_mb(cs, '\'', (uchar *) to, to_end)) <= 0)
- goto null;
+ goto toolong;
to+= mblen;
new_length= to - tmp_value.ptr();
goto ret;
@@ -3561,6 +3565,11 @@ ret:
null_value= 0;
return &tmp_value;
+toolong:
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_ALLOWED_PACKET_OVERFLOWED,
+ ER_THD(current_thd, ER_WARN_ALLOWED_PACKET_OVERFLOWED),
+ func_name(), max_allowed_packet);
null:
null_value= 1;
return 0;
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 064038a06fe..a49b5749f88 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2005, 2013, Oracle and/or its affiliates.
+/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2009, 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
@@ -2706,9 +2707,9 @@ int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len)
node.parent= data->parent; // Set parent for the new node to old parent
data->parent= numnodes; // Remember current node as new parent
- DBUG_ASSERT(data->level <= MAX_LEVEL);
+ DBUG_ASSERT(data->level < MAX_LEVEL);
data->pos[data->level]= numnodes;
- if (data->level < MAX_LEVEL)
+ if (data->level < MAX_LEVEL - 1)
node.level= data->level++;
else
return MY_XML_ERROR;
diff --git a/sql/sp.cc b/sql/sp.cc
index e9340608646..c12dcc76f27 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2002, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2015, MariaDB
+ Copyright (c) 2002, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2009, 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
@@ -375,7 +375,7 @@ void Proc_table_intact::report_error(uint code, const char *fmt, ...)
my_vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
- if (code)
+ if (code == ER_COL_COUNT_DOESNT_MATCH_CORRUPTED)
my_message(code, buf, MYF(0));
else
my_error(ER_CANNOT_LOAD_FROM_TABLE, MYF(0), "proc");
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 93af4d3bb4d..46eabb41a74 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2016, MariaDB
+ Copyright (c) 2008, 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
diff --git a/sql/sql_const.h b/sql/sql_const.h
index 3c127a03826..abe2a496045 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -65,6 +65,7 @@
#define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1))
#define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \
RAND_TABLE_BIT)
+#define CONNECT_STRING_MAXLEN 65535 /* stored in 2 bytes in .frm */
#define MAX_FIELDS 4096 /* Limit in the .frm file */
#define MAX_PARTITIONS 1024
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 4723c2b643d..dcbd9f180d1 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -979,7 +979,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
{
uint length;
uchar *pos;
- Item *real_item;
+ Item_field *real_item;
if (read_info.read_field())
break;
@@ -991,16 +991,26 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
pos=read_info.row_start;
length=(uint) (read_info.row_end-pos);
- real_item= item->real_item();
+ real_item= item->filed_for_view_update();
if ((!read_info.enclosed &&
(enclosed_length && length == 4 &&
!memcmp(pos, STRING_WITH_LEN("NULL")))) ||
(length == 1 && read_info.found_null))
{
- if (real_item->type() == Item::FIELD_ITEM)
+ if (item->type() == Item::STRING_ITEM)
{
- Field *field= ((Item_field *)real_item)->field;
+ ((Item_user_var_as_out_param *)item)->set_null_value(
+ read_info.read_charset);
+ }
+ else if (!real_item)
+ {
+ my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), item->name);
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ Field *field= real_item->field;
if (field->reset())
{
my_error(ER_WARN_NULL_TO_NOTNULL, MYF(0), field->field_name,
@@ -1017,39 +1027,29 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
ER_WARN_NULL_TO_NOTNULL, 1);
}
}
- else if (item->type() == Item::STRING_ITEM)
- {
- ((Item_user_var_as_out_param *)item)->set_null_value(
- read_info.read_charset);
- }
- else
- {
- my_error(ER_LOAD_DATA_INVALID_COLUMN, MYF(0), item->full_name());
- DBUG_RETURN(1);
- }
continue;
}
- if (real_item->type() == Item::FIELD_ITEM)
- {
- Field *field= ((Item_field *)real_item)->field;
- field->set_notnull();
- read_info.row_end[0]=0; // Safe to change end marker
- if (field == table->next_number_field)
- table->auto_increment_field_not_null= TRUE;
- field->store((char*) pos, length, read_info.read_charset);
- }
- else if (item->type() == Item::STRING_ITEM)
+ if (item->type() == Item::STRING_ITEM)
{
((Item_user_var_as_out_param *)item)->set_value((char*) pos, length,
read_info.read_charset);
}
- else
+ else if (!real_item)
{
- my_error(ER_LOAD_DATA_INVALID_COLUMN, MYF(0), item->full_name());
+ my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), item->name);
DBUG_RETURN(1);
}
+ else
+ {
+ Field *field= real_item->field;
+ field->set_notnull();
+ read_info.row_end[0]=0; // Safe to change end marker
+ if (field == table->next_number_field)
+ table->auto_increment_field_not_null= TRUE;
+ field->store((char*) pos, length, read_info.read_charset);
+ }
}
if (thd->is_error())
@@ -1069,10 +1069,20 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
break;
for (; item ; item= it++)
{
- Item *real_item= item->real_item();
- if (real_item->type() == Item::FIELD_ITEM)
+ Item_field *real_item= item->filed_for_view_update();
+ if (item->type() == Item::STRING_ITEM)
+ {
+ ((Item_user_var_as_out_param *)item)->set_null_value(
+ read_info.read_charset);
+ }
+ else if (!real_item)
{
- Field *field= ((Item_field *)real_item)->field;
+ my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), item->name);
+ DBUG_RETURN(1);
+ }
+ else
+ {
+ Field *field= real_item->field;
if (field->reset())
{
my_error(ER_WARN_NULL_TO_NOTNULL, MYF(0),field->field_name,
@@ -1093,16 +1103,6 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
ER(ER_WARN_TOO_FEW_RECORDS),
thd->warning_info->current_row_for_warning());
}
- else if (item->type() == Item::STRING_ITEM)
- {
- ((Item_user_var_as_out_param *)item)->set_null_value(
- read_info.read_charset);
- }
- else
- {
- my_error(ER_LOAD_DATA_INVALID_COLUMN, MYF(0), item->full_name());
- DBUG_RETURN(1);
- }
}
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index c3170d04304..5e2962b53c3 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2015, MariaDB
+/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
+ Copyright (c) 2008, 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
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 43e146f1f1d..6ab39d7f8c6 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2904,6 +2904,21 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
uint total_uneven_bit_length= 0;
DBUG_ENTER("mysql_prepare_create_table");
+ LEX_STRING* connect_string = &create_info->connect_string;
+ if (connect_string->length != 0 &&
+ connect_string->length > CONNECT_STRING_MAXLEN &&
+ (system_charset_info->cset->charpos(system_charset_info,
+ connect_string->str,
+ (connect_string->str +
+ connect_string->length),
+ CONNECT_STRING_MAXLEN)
+ < connect_string->length))
+ {
+ my_error(ER_WRONG_STRING_LENGTH, MYF(0),
+ connect_string->str, "CONNECTION", CONNECT_STRING_MAXLEN);
+ DBUG_RETURN(TRUE);
+ }
+
select_field_pos= alter_info->create_list.elements - select_field_count;
null_fields=blob_columns=0;
create_info->varchar= 0;
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 1cd21ac5a19..d5b0208382f 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
@@ -2787,6 +2787,7 @@ srv_master_thread(
ulint i;
ib_time_t last_print_time;
+ my_thread_init();
#ifdef UNIV_DEBUG_THREAD_CREATION
fprintf(stderr, "Master thread starts, id %lu\n",
os_thread_pf(os_thread_get_curr_id()));
@@ -3242,6 +3243,7 @@ suspend_thread:
os_event_wait(slot->event);
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
+ my_thread_end();
os_thread_exit(NULL);
}
@@ -3265,6 +3267,7 @@ srv_purge_thread(
ulint retries = 0;
ulint n_total_purged = ULINT_UNDEFINED;
+ my_thread_init();
ut_a(srv_n_purge_threads == 1);
#ifdef UNIV_PFS_THREAD
@@ -3349,6 +3352,8 @@ srv_purge_thread(
os_thread_pf(os_thread_get_curr_id()));
#endif /* UNIV_DEBUG_THREAD_CREATION */
+ my_thread_end();
+
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit. */
os_thread_exit(NULL);
diff --git a/storage/innobase/trx/trx0roll.c b/storage/innobase/trx/trx0roll.c
index 877a478e50a..638e06191bc 100644
--- a/storage/innobase/trx/trx0roll.c
+++ b/storage/innobase/trx/trx0roll.c
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 2017, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -610,12 +611,15 @@ trx_rollback_or_clean_all_recovered(
/*!< in: a dummy parameter required by
os_thread_create */
{
+ my_thread_init();
+
#ifdef UNIV_PFS_THREAD
pfs_register_thread(trx_rollback_clean_thread_key);
#endif /* UNIV_PFS_THREAD */
trx_rollback_or_clean_recovered(TRUE);
+ my_thread_end();
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit. */
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 67a7b508e33..5e9fd081a09 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -1,5 +1,5 @@
-# Copyright (c) 2006, 2014, Oracle and/or its affiliates.
-# Copyright (c) 2012, 2014, SkySQL Ab.
+# Copyright (c) 2006, 2016, Oracle and/or its affiliates.
+# Copyright (c) 2012, 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
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index a4034dec385..7a6154a1af5 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -157,8 +157,7 @@ parse_server_arguments() {
# Get arguments from the my.cnf file,
# the only group, which is read from now on is [mysqld]
-if test -x $bindir/my_print_defaults
-then
+if test -x "$bindir/my_print_defaults"; then
print_defaults="$bindir/my_print_defaults"
else
# Try to find basedir in /etc/my.cnf
@@ -176,11 +175,6 @@ else
print_defaults="$d/bin/my_print_defaults"
break
fi
- if test -x "$d/bin/mysql_print_defaults"
- then
- print_defaults="$d/bin/mysql_print_defaults"
- break
- fi
done
fi
@@ -381,7 +375,7 @@ case "$mode" in
fi
else
# Try to find appropriate mysqld process
- mysqld_pid=`pidof $libexecdir/mysqld`
+ mysqld_pid=`pgrep $libexecdir/mysqld`
# test if multiple pids exist
pid_count=`echo $mysqld_pid | wc -w`