Skip to content

Commit

Permalink
Merge remote-tracking branch 'mysql/5.5' into 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Apr 11, 2017
2 parents 5c57948 + 6fa5e08 commit 663068c
Show file tree
Hide file tree
Showing 41 changed files with 379 additions and 151 deletions.
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion client/client_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,3 @@ enum options_client
Name of the performance schema database.
*/
#define PERFORMANCE_SCHEMA_DB_NAME "performance_schema"

2 changes: 1 addition & 1 deletion client/mysql.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions client/mysql_upgrade.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -1095,4 +1095,3 @@ int main(int argc, char **argv)
my_end(my_end_arg);
exit(0);
}

2 changes: 1 addition & 1 deletion client/mysqladmin.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlcheck.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]))
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlimport.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlshow.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/mysqlslap.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/mysqltest.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/welcome_copyright_notice.h
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion mysql-test/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 4 additions & 7 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3188,13 +3188,10 @@ ($)
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
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/events_2.result
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/loaddata.result
Original file line number Diff line number Diff line change
Expand Up @@ -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 '\\'
Expand Down
14 changes: 8 additions & 6 deletions mysql-test/r/log_tables-big.result
Original file line number Diff line number Diff line change
@@ -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;
63 changes: 63 additions & 0 deletions mysql-test/r/mysqldump.result
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/r/symlink.result
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion mysql-test/t/events_2.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/loaddata.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 ','
Expand Down
16 changes: 10 additions & 6 deletions mysql-test/t/log_tables-big.test
Original file line number Diff line number Diff line change
Expand Up @@ -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,,);

Expand All @@ -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;
Loading

0 comments on commit 663068c

Please sign in to comment.