From 5cb6382a6cd5cbdd31e257fb78705079a4d49504 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 29 Aug 2017 15:42:38 +0530 Subject: [PATCH 01/19] Raise version number after cloning 5.5.58 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2905c37cc09..87b72051a84 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=58 +MYSQL_VERSION_PATCH=59 MYSQL_VERSION_EXTRA= From 9ae160af7647139a321203fa02c4122744e2ba63 Mon Sep 17 00:00:00 2001 From: Aakanksha Verma Date: Thu, 31 Aug 2017 15:44:42 +0530 Subject: [PATCH 02/19] --- sql/ha_partition.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 414f9d52536..17596fb924c 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2751,7 +2751,15 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) name_buffer_ptr= m_name_buffer_ptr; m_start_key.length= 0; m_rec0= table->record[0]; - m_rec_length= table_share->reclength; + legacy_db_type db_type = ha_legacy_type(m_part_info->default_engine_type); + if (db_type == DB_TYPE_HEAP) + { + m_rec_length= table_share->rec_buff_length; + } else { + m_rec_length= table_share->reclength; + } + DBUG_ASSERT(db_type != DB_TYPE_UNKNOWN); + if (!m_part_ids_sorted_by_num_of_records) { if (!(m_part_ids_sorted_by_num_of_records= From ad00de40772614e79ef8f14647d37a7d356cff5c Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Wed, 6 Sep 2017 06:45:50 +0530 Subject: [PATCH 03/19] Bug #26704451: INCORRECT BEHAVIOR WITH USE OF CERTAIN CHARSETS AND SHA2 Missed pushing to 5.5. --- sql/item_strfunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index ed02f668060..e2a2ee1b6d8 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -266,9 +266,9 @@ String *Item_func_sha2::val_str_ascii(String *str) size_t input_len; uint digest_length= 0; + input_string= args[0]->val_str(str); str->set_charset(&my_charset_bin); - input_string= args[0]->val_str(str); if (input_string == NULL) { null_value= TRUE; From 91e9770f729738b26ee31ed93094ab8cf7177771 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Wed, 6 Sep 2017 17:48:42 +0530 Subject: [PATCH 04/19] Bug#26747305 - HOSTNAME: COMMAND NOT FOUND WHILE STARTING CONTAINER WITH 5.5 DOCKER IMAGE - Add hostname package for docker rpm builds. --- packaging/rpm-docker/mysql.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/rpm-docker/mysql.spec.in b/packaging/rpm-docker/mysql.spec.in index cc4e7bc541e..56e79b7992b 100644 --- a/packaging/rpm-docker/mysql.spec.in +++ b/packaging/rpm-docker/mysql.spec.in @@ -82,6 +82,7 @@ documentation and the manual for more information. %package -n mysql-%{product_suffix}-server-minimal Summary: A very fast and reliable SQL database server Group: Applications/Databases +Requires: hostname Requires: shadow-utils Provides: mysql-server = %{version}-%{release} Provides: mysql-server%{?_isa} = %{version}-%{release} From 14176f71472c08bcfb613c25b305e2c0b1d786cb Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 7 Sep 2017 16:11:15 +0530 Subject: [PATCH 05/19] Bug#26742748 - 8.0 DOCKER IMAGE RPM GENERATES 5.7 DOC URL IN /ETC/MY.CNF --- packaging/rpm-docker/my.cnf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/rpm-docker/my.cnf b/packaging/rpm-docker/my.cnf index c1c03c1c668..4e3cce3e250 100644 --- a/packaging/rpm-docker/my.cnf +++ b/packaging/rpm-docker/my.cnf @@ -1,5 +1,5 @@ # For advice on how to change settings please see -# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html +# http://dev.mysql.com/doc/refman/5.5/en/server-configuration-defaults.html [mysqld] # From 43632f4cd5f3fc7aaa9a0aa757081725f120c488 Mon Sep 17 00:00:00 2001 From: Anushree Prakash B Date: Fri, 8 Sep 2017 18:29:07 +0530 Subject: [PATCH 06/19] Bug#26372491 - RCE THROUGH THE MISHANDLE OF BACKSLASH DESCRIPTION: =========== The bug is related to incorrect parsing of SQL queries when typed in on the CLI. The incorrect parsing can result in unexpected results. ANALYSIS: ======== The scenarios mainly happens for identifier names with a typical combination of backslashes and backticks. The incorrect parsing can either result in executing additional queries or can result in query truncation. This can impact mysqldump as well. FIX: === The fix makes sure that such identifier names are correctly parsed and a proper query is sent to the server for execution. --- client/mysql.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index d09499c120a..715d74f18b2 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2119,7 +2119,10 @@ static bool add_line(String &buffer,char *line,char *in_string, if (*in_string || inchar == 'N') // \N is short for NULL { // Don't allow commands in string *out++='\\'; - *out++= (char) inchar; + if ((inchar == '`') && (*in_string == inchar)) + pos--; + else + *out++= (char) inchar; continue; } if ((com=find_command(NullS,(char) inchar))) From d52edb75bbe392fc24f317dabbe4e69245ae993d Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 8 Sep 2017 16:47:44 +0200 Subject: [PATCH 07/19] Bug#23072792 MYSQL_GROUP_SUFFIX DOES NOT WORK Reintroduce environment variable MYSQL_GROUP_SUFFIX to be used as --default-group-suffix value if not already set. The environment variable was accidentally renamed to DEFAULT_GROUP_SUFFIX_ENV in MySQL server 5.5. --- mysys/default.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index 6fe00af087e..75274f25edf 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 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 @@ -234,7 +234,7 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, (char **) &my_defaults_group_suffix); if (! my_defaults_group_suffix) - my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV)); + my_defaults_group_suffix= getenv("MYSQL_GROUP_SUFFIX"); if (forced_extra_defaults && !defaults_already_read) { From cf3fe5a2df36794428aad511c6e7f0985b72ced7 Mon Sep 17 00:00:00 2001 From: "mysql-builder@oracle.com" <> Date: Wed, 13 Sep 2017 12:14:06 +0530 Subject: [PATCH 08/19] From aa6e69db10a991e5c3ca213a8c3a60350c1462c2 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 9 Oct 2017 16:24:11 +0200 Subject: [PATCH 09/19] Backport patch for Bug#16877045 5.6-CLUSTER-7.3 WIN32 SQL_YACC.CC BUILD PROBLEM Building with ninja shows the problem: cmake .. -G Ninja ninja ninja: error: dependency cycle: sql/GenServerSource -> sql/CMakeFiles/GenServerSource -> sql/sql_builtin.cc -> cmake_order_depends_target_sq sql/GenServerSource Bug#16877045 5.6-CLUSTER-7.3 WIN32 SQL_YACC.CC BUILD PROBLEM - Somewhat circular dependency caused by the configured files sql_builtin.cc being included as part of the files to generate in sql/ - Move sql_builtin.cc out of GEN_SOURCES variable. - Create new variable CONF_SOURCES to be used for configured files. --- mysql-test/CMakeLists.txt | 4 ++-- sql/CMakeLists.txt | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index d12e594a1ff..e704481d6a3 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 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 @@ -92,7 +92,7 @@ ENDIF() IF(WITH_EMBEDDED_SERVER) SET(TEST_EMBEDDED ${MTR_FORCE} --comment=embedded --timer --embedded-server - --skip-rpl --skip-ndbcluster $(EXP)) + --skip-rpl --skip-ndbcluster ${EXP}) ELSE() SET(TEST_EMBEDDED echo "Can not test embedded, not compiled in") ENDIF() diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index b0a44b9a1d4..531561ac36d 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 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 @@ -22,14 +22,16 @@ ${SSL_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/sql ) +SET(CONF_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc +) SET(GEN_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc -${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h ) -SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1) +SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} ${CONF_SOURCES} PROPERTIES GENERATED 1) ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER) IF(SSL_DEFINES) @@ -78,6 +80,7 @@ SET (SQL_SOURCE transaction.cc sys_vars.cc sql_truncate.cc datadict.cc sql_reload.cc ${GEN_SOURCES} + ${CONF_SOURCES} ${MYSYS_LIBWRAP_SOURCE}) # These files have unused result errors, so we skip Werror From 84c32cdbe746fdabc33988fc17b1f11b08fd22e0 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Thu, 19 Oct 2017 10:19:36 +0530 Subject: [PATCH 10/19] Bug #26867652: INCORRECT BEHAVIOR WITH PREPARE STATEMENT AND PARAM IN ORDER BY Issue: ------ This issue can occur when the ORDER BY list refers to a column that contains a parameter in the select list. Solution: --------- In JOIN::update_depend_map and get_sort_by_table, the ORDER BY list's used_tables isn't checked for parameters. This can result in incorrect behavior. This is a partial backport of Roy's --- sql/sql_select.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 80d4b87e916..eb38d8be382 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 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 @@ -7430,7 +7430,8 @@ static void update_depend_map(JOIN *join, ORDER *order) { table_map depend_map; order->item[0]->update_used_tables(); - order->depend_map=depend_map=order->item[0]->used_tables(); + order->depend_map=depend_map= + order->item[0]->used_tables() & ~PARAM_TABLE_BIT; order->used= 0; // Not item_sum(), RAND() and no reference to table outside of sub select if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT)) @@ -15583,6 +15584,7 @@ get_sort_by_table(ORDER *a,ORDER *b,TABLE_LIST *tables) DBUG_RETURN(0); map|=a->item[0]->used_tables(); } + map&= ~PARAM_TABLE_BIT; if (!map || (map & (RAND_TABLE_BIT | OUTER_REF_TABLE_BIT))) DBUG_RETURN(0); From a542209b9e70e28e88ba60d2e4441a8c2d3e746c Mon Sep 17 00:00:00 2001 From: Karthik Kamath Date: Mon, 23 Oct 2017 10:56:20 +0530 Subject: [PATCH 11/19] BUG#26529369: CREATE INDEX WITH LONG COMMENT CAUSE UNEXPECTED ERROR ANALYSIS: ========= Creating many indexes with large amount of index information causes a server exit. FIX: ==== A appropriate error is reported when the cumulative index information length exceeds the 2 byte range (i.e 65535). --- sql/unireg.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sql/unireg.cc b/sql/unireg.cc index d77a6b06275..788046cfae4 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 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 @@ -283,6 +283,25 @@ bool mysql_create_frm(THD *thd, const char *file_name, keybuff=(uchar*) my_malloc(key_buff_length, MYF(0)); key_info_length= pack_keys(keybuff, keys, key_info, data_offset); + /* key_info_length is currently stored in 2 bytes */ + if (key_info_length > 65535U) + { + char *real_table_name= (char*) table; + List_iterator it(create_fields); + Create_field *field; + while ((field=it++)) + { + if (field->field && field->field->table && + (real_table_name= field->field->table->s->table_name.str)) + break; + } + my_printf_error(ER_UNKNOWN_ERROR, + "Index information size for the table %s.%s exceeds the " + "maximum limit (Max: 2 bytes). Please recreate indexes " + "accordingly.", MYF(0), db, real_table_name); + goto err; + } + /* Ensure that there are no forms in this newly created form file. Even if the form file exists, create_frm must truncate it to From bd1fe2613a920d3c193f2d72d84ac8d954e4f3f6 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Thu, 26 Oct 2017 18:07:36 +0530 Subject: [PATCH 12/19] Bug #26880757: MYISAM_USE_MMAP=1 ON WINDOWS FREQUENTLY DOES NOT UPDATE FILE ON DISK Description:- When the server variable, "myisam_use_mmap" is enabled, MyISAM tables on windows are not updating the file on disk even when the server variable "flush" is set to 1. This is inturn making the table corrupted when encountering a power failure. Analysis:- When the server variable "myisam_use_mmap" is set, files of MyISAM tables will be memory mapped using the OS APIs mmap()/munmap()/msync() on Unix and CreateFileMapping() /UnmapViewOfFile()/FlushViewOfFile() on Windows. msync() and FlushViewOfFile() is responsible for flushing the changes made to the in-core copy of a file that was mapped into memory using mmap()/CreateFileMapping() back to the file system. FLUSH is determined by the OS unless explicitly called using msync()/FlushViewOfFile(). When the server variables "myisam_use_mmap" and "flush" are enabled, MyISAM is only flushing the files from file system cache to disc using "mysql_file_sync()" and not the memory mapped file from memory to FS cache using "my_msync()". ["my_msync()" inturn calls msync() on Unix and FlushViewOfFile() on Windows. Fix:- As part of the fix, if server variable "myisam_use_mmap" is enabled along with "flush", "my_msync()" is invoked to flush the data in memory to file system cache and followed by "mysql_file_sync()" which will flush the data from file system cache to disk. --- storage/myisam/mi_locking.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index 98c2a6c7549..4a33e838fb9 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 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 @@ -103,6 +103,8 @@ int mi_lock_database(MI_INFO *info, int lock_type) share->changed=0; if (myisam_flush) { + if (share->file_map) + my_msync(info->dfile, share->file_map, share->mmaped_length, MS_SYNC); if (mysql_file_sync(share->kfile, MYF(0))) error= my_errno; if (mysql_file_sync(info->dfile, MYF(0))) @@ -450,6 +452,8 @@ int _mi_writeinfo(register MI_INFO *info, uint operation) #ifdef _WIN32 if (myisam_flush) { + if (share->file_map) + my_msync(info->dfile, share->file_map, share->mmaped_length, MS_SYNC); mysql_file_sync(share->kfile, 0); mysql_file_sync(info->dfile, 0); } From 79c0c202da5414abbbe4a0342c289e384c055b88 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Fri, 3 Nov 2017 12:21:26 +0100 Subject: [PATCH 13/19] Bug #27021754 MYSQLTEST MAN PAGES WILL BE REMOVED, PACKAGING MUST BE PREPARED Removed relevant man pages from file lists for RPM and DEB RPM: added conditional removal of them, so it works both before and after man pages are actually removed DEB: added to exclude list (5.6+) --- packaging/rpm-oel/mysql.spec.in | 19 ++++++++++++------- packaging/rpm-sles/mysql.spec.in | 21 ++++++++++++--------- support-files/mysql.spec.sh | 17 ++++++++++------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in index 7ef294ffa84..7aa8cdb5640 100644 --- a/packaging/rpm-oel/mysql.spec.in +++ b/packaging/rpm-oel/mysql.spec.in @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 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 @@ -609,6 +609,14 @@ rm -rf %{buildroot}%{_bindir}/mysql_embedded rm -rf %{buildroot}%{_bindir}/mysql_setpermission rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1* +# Remove obsoleted man pages +rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1 +rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1 +rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1 +rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1 +rm -f %{buildroot}%{_mandir}/man1/mysqltest.1 +rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1 + %check %if 0%{?runselftest} pushd release @@ -697,7 +705,6 @@ fi %attr(644, root, root) %{_mandir}/man1/mysqlhotcopy.1* %attr(644, root, root) %{_mandir}/man1/mysqlman.1* %attr(644, root, root) %{_mandir}/man1/mysql.server.1* -%attr(644, root, root) %{_mandir}/man1/mysqltest.1* %attr(644, root, root) %{_mandir}/man1/mysql_tzinfo_to_sql.1* %attr(644, root, root) %{_mandir}/man1/mysql_zap.1* %attr(644, root, root) %{_mandir}/man1/mysqlbug.1* @@ -889,11 +896,6 @@ fi %attr(755, root, root) %{_bindir}/mysql_client_test %attr(755, root, root) %{_bindir}/mysql_client_test_embedded %attr(755, root, root) %{_bindir}/mysqltest_embedded -%attr(644, root, root) %{_mandir}/man1/mysql_client_test.1* -%attr(644, root, root) %{_mandir}/man1/mysql-stress-test.pl.1* -%attr(644, root, root) %{_mandir}/man1/mysql-test-run.pl.1* -%attr(644, root, root) %{_mandir}/man1/mysql_client_test_embedded.1* -%attr(644, root, root) %{_mandir}/man1/mysqltest_embedded.1* %files bench %defattr(-, root, root, -) @@ -918,6 +920,9 @@ fi %endif %changelog +* Tue Oct 31 2017 Bjorn Munch - 5.5.59-1 +- Remove obsoleted mysqltest man pages + * Mon Sep 26 2016 Balasubramanian Kandasamy - 5.5.53-1 - Include mysql-files directory diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in index 1b5f1806321..5d0d1a55214 100644 --- a/packaging/rpm-sles/mysql.spec.in +++ b/packaging/rpm-sles/mysql.spec.in @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 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 @@ -446,6 +446,14 @@ rm -rf %{buildroot}%{_bindir}/mysql_embedded rm -rf %{buildroot}%{_bindir}/mysql_setpermission rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1* +# Remove obsoleted man pages +rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1 +rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1 +rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1 +rm -f %{buildroot}%{_mandir}/man1/mysql_client_test_embedded.1 +rm -f %{buildroot}%{_mandir}/man1/mysqltest.1 +rm -f %{buildroot}%{_mandir}/man1/mysqltest_embedded.1 + # rcmysql symlink install -d %{buildroot}%{_sbindir} ln -sf %{_initrddir}/mysql %{buildroot}%{_sbindir}/rcmysql @@ -525,7 +533,6 @@ fi %attr(644, root, root) %{_mandir}/man1/mysqlhotcopy.1* %attr(644, root, root) %{_mandir}/man1/mysqlman.1* %attr(644, root, root) %{_mandir}/man1/mysql.server.1* -%attr(644, root, root) %{_mandir}/man1/mysqltest.1* %attr(644, root, root) %{_mandir}/man1/mysql_tzinfo_to_sql.1* %attr(644, root, root) %{_mandir}/man1/mysql_zap.1* %attr(644, root, root) %{_mandir}/man1/mysqlbug.1* @@ -715,13 +722,6 @@ fi %attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so -%attr(644, root, root) %{_mandir}/man1/mysql_client_test.1* -%attr(644, root, root) %{_mandir}/man1/mysql-stress-test.pl.1* -%attr(644, root, root) %{_mandir}/man1/mysql-test-run.pl.1* -%attr(644, root, root) %{_mandir}/man1/mysql_client_test_embedded.1* -%attr(644, root, root) %{_mandir}/man1/mysqltest.1* -%attr(644, root, root) %{_mandir}/man1/mysqltest_embedded.1* - %files bench %defattr(-, root, root, -) %doc %{?license_files_server} @@ -742,6 +742,9 @@ fi %attr(755, root, root) %{_libdir}/mysql/libmysqld.so %changelog +* Tue Oct 31 2017 Bjorn Munch - 5.5.59-1 +- Remove obsoleted mysqltest man pages + * Mon Sep 26 2016 Balasubramanian Kandasamy - 5.5.53-1 - Include mysql-files directory diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 211ed4f3888..4060284ce9d 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 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 @@ -621,6 +621,12 @@ install -m 644 "%{malloc_lib_source}" \ # Remove man pages we explicitly do not want to package, avoids 'unpackaged # files' warning. # This has become obsolete: rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1* +rm -f $RBR%{_mandir}/man1/mysql-stress-test.pl.1 +rm -f $RBR%{_mandir}/man1/mysql-test-run.pl.1 +rm -f $RBR%{_mandir}/man1/mysql_client_test.1 +rm -f $RBR%{_mandir}/man1/mysql_client_test_embedded.1 +rm -f $RBR%{_mandir}/man1/mysqltest.1 +rm -f $RBR%{_mandir}/man1/mysqltest_embedded.1 ############################################################################## # Post processing actions, i.e. when installed @@ -1091,7 +1097,6 @@ echo "=====" >> $STATUS_HISTORY %doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1* %doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1* %doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1* @@ -1209,11 +1214,6 @@ echo "=====" >> $STATUS_HISTORY %attr(755, root, root) %{_bindir}/mysql_client_test %attr(755, root, root) %{_bindir}/mysql_client_test_embedded %attr(755, root, root) %{_bindir}/mysqltest_embedded -%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1* -%doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1* # ---------------------------------------------------------------------------- %files -n MySQL-embedded%{product_suffix} @@ -1228,6 +1228,9 @@ echo "=====" >> $STATUS_HISTORY # merging BK trees) ############################################################################## %changelog +* Tue Oct 31 2017 Bjorn Munch +- Remove obsoleted mysqltest man pages + * Mon Sep 26 2016 Balasubramanian Kandasamy - Include mysql-files directory From 0ee067229c784df83c8e1d85b232b6252c323b82 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 9 Nov 2017 08:36:59 +0100 Subject: [PATCH 14/19] Bug#26022865 BUILD FOR WINDOWS-S12-64BIT,ADVANCED IS FAILING ON PB2 MYSQL-5.6 Remove cmake code for signing executables. Automatic signing has always failed anyways. It should be done manually as part of the release process. --- .../build_configurations/mysql_release.cmake | 7 --- cmake/install_macros.cmake | 60 +------------------ 2 files changed, 1 insertion(+), 66 deletions(-) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 7d54e2aec77..58808943124 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -100,13 +100,6 @@ IF(NOT COMPILATION_COMMENT) SET(COMPILATION_COMMENT "MySQL Community Server (GPL)") ENDIF() -IF(WIN32) - IF(NOT CMAKE_USING_VC_FREE_TOOLS) - # Sign executables with authenticode certificate - SET(SIGNCODE 1 CACHE BOOL "") - ENDIF() -ENDIF() - IF(UNIX) SET(WITH_EXTRA_CHARSETS all CACHE STRING "") IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING") diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index be243a42924..5475dbe2686 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 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 @@ -151,60 +151,6 @@ IF(UNIX) ENDIF() ENDMACRO() -IF(WIN32) - OPTION(SIGNCODE "Sign executables and dlls with digital certificate" OFF) - MARK_AS_ADVANCED(SIGNCODE) - IF(SIGNCODE) - SET(SIGNTOOL_PARAMETERS - /a /t http://timestamp.verisign.com/scripts/timstamp.dll - CACHE STRING "parameters for signtool (list)") - FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool) - IF(NOT SIGNTOOL_EXECUTABLE) - MESSAGE(FATAL_ERROR - "signtool is not found. Signing executables not possible") - ENDIF() - IF(NOT DEFINED SIGNCODE_ENABLED) - FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/testsign.c "int main(){return 0;}") - MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/testsign) - TRY_COMPILE(RESULT ${CMAKE_CURRENT_BINARY_DIR}/testsign ${CMAKE_CURRENT_BINARY_DIR}/testsign.c - COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/testsign.exe - ) - - EXECUTE_PROCESS(COMMAND - ${SIGNTOOL_EXECUTABLE} sign ${SIGNTOOL_PARAMETERS} ${CMAKE_CURRENT_BINARY_DIR}/testsign.exe - RESULT_VARIABLE ERR ERROR_QUIET OUTPUT_QUIET - ) - IF(ERR EQUAL 0) - SET(SIGNCODE_ENABLED 1 CACHE INTERNAL "Can sign executables") - ELSE() - MESSAGE(STATUS "Disable authenticode signing for executables") - SET(SIGNCODE_ENABLED 0 CACHE INTERNAL "Invalid or missing certificate") - ENDIF() - ENDIF() - MARK_AS_ADVANCED(SIGNTOOL_EXECUTABLE SIGNTOOL_PARAMETERS) - ENDIF() -ENDIF() - -MACRO(SIGN_TARGET target) - GET_TARGET_PROPERTY(target_type ${target} TYPE) - IF(target_type AND NOT target_type MATCHES "STATIC") - GET_TARGET_PROPERTY(target_location ${target} LOCATION) - IF(CMAKE_GENERATOR MATCHES "Visual Studio") - STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" - target_location ${target_location}) - ENDIF() - INSTALL(CODE - "EXECUTE_PROCESS(COMMAND - ${SIGNTOOL_EXECUTABLE} sign ${SIGNTOOL_PARAMETERS} ${target_location} - RESULT_VARIABLE ERR) - IF(NOT \${ERR} EQUAL 0) - MESSAGE(FATAL_ERROR \"Error signing ${target_location}\") - ENDIF() - ") - ENDIF() -ENDMACRO() - - # Installs targets, also installs pdbs on Windows. # # @@ -225,10 +171,6 @@ FUNCTION(MYSQL_INSTALL_TARGETS) FOREACH(target ${TARGETS}) - # If signing is required, sign executables before installing - IF(SIGNCODE AND SIGNCODE_ENABLED) - SIGN_TARGET(${target}) - ENDIF() # Install man pages on Unix IF(UNIX) GET_TARGET_PROPERTY(target_location ${target} LOCATION) From 12333385c1f38ca5a5667ca708b3008980251d7e Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 9 Nov 2017 08:45:45 +0100 Subject: [PATCH 15/19] dos2unix cmake/mysql_add_executable.cmake --- cmake/mysql_add_executable.cmake | 96 ++++++++++++++++---------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index b1e1d3129e6..bcbbe7d4931 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -1,48 +1,48 @@ -# Copyright (c) 2009, 2010, 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 Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -# Add executable plus some additional MySQL specific stuff -# Usage (same as for standard CMake's ADD_EXECUTABLE) -# -# MYSQL_ADD_EXECUTABLE(target source1...sourceN) -# -# MySQL specifics: -# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory -# On Windows : -# - add version resource -# - instruct CPack to do autenticode signing if SIGNCODE is set - -INCLUDE(cmake_parse_arguments) - -FUNCTION (MYSQL_ADD_EXECUTABLE) - # Pass-through arguments for ADD_EXECUTABLE - MYSQL_PARSE_ARGUMENTS(ARG - "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" - "" - ${ARGN} - ) - LIST(GET ARG_DEFAULT_ARGS 0 target) - LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) - - SET(sources ${ARG_DEFAULT_ARGS}) - ADD_VERSION_INFO(${target} EXECUTABLE sources) - ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) - # tell CPack where to install - IF(NOT ARG_EXCLUDE_FROM_ALL) - IF(NOT ARG_DESTINATION) - SET(ARG_DESTINATION ${INSTALL_BINDIR}) +# Copyright (c) 2009, 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 Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Add executable plus some additional MySQL specific stuff +# Usage (same as for standard CMake's ADD_EXECUTABLE) +# +# MYSQL_ADD_EXECUTABLE(target source1...sourceN) +# +# MySQL specifics: +# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory +# On Windows : +# - add version resource +# - instruct CPack to do autenticode signing if SIGNCODE is set + +INCLUDE(cmake_parse_arguments) + +FUNCTION (MYSQL_ADD_EXECUTABLE) + # Pass-through arguments for ADD_EXECUTABLE + MYSQL_PARSE_ARGUMENTS(ARG + "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" + "" + ${ARGN} + ) + LIST(GET ARG_DEFAULT_ARGS 0 target) + LIST(REMOVE_AT ARG_DEFAULT_ARGS 0) + + SET(sources ${ARG_DEFAULT_ARGS}) + ADD_VERSION_INFO(${target} EXECUTABLE sources) + ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources}) + # tell CPack where to install + IF(NOT ARG_EXCLUDE_FROM_ALL) + IF(NOT ARG_DESTINATION) + SET(ARG_DESTINATION ${INSTALL_BINDIR}) ENDIF() IF(ARG_COMPONENT) SET(COMP COMPONENT ${ARG_COMPONENT}) @@ -50,7 +50,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT}) ELSE() SET(COMP COMPONENT Client) - ENDIF() - MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) - ENDIF() + ENDIF() + MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) + ENDIF() ENDFUNCTION() From 02c12999f9c8621619f61b10deaba36c0df4dbb7 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 13 Nov 2017 19:45:57 +0530 Subject: [PATCH 16/19] Bug#27072155 - DEFAULT PLUGIN_DIR SHOULD BE DIFFERENT FOR DEBUG BUILD - Update the default plugin directory for debug builds --- packaging/rpm-oel/mysql.spec.in | 2 +- packaging/rpm-sles/mysql.spec.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in index 7aa8cdb5640..755f922026e 100644 --- a/packaging/rpm-oel/mysql.spec.in +++ b/packaging/rpm-oel/mysql.spec.in @@ -505,7 +505,7 @@ mkdir debug -DCMAKE_C_FLAGS="$optflags" \ -DCMAKE_CXX_FLAGS="$optflags" \ -DINSTALL_LIBDIR="%{_lib}/mysql" \ - -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin/debug" \ -DINSTALL_SQLBENCHDIR=share \ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ -DFEATURE_SET="%{feature_set}" \ diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in index 5d0d1a55214..d5a3ba8deff 100644 --- a/packaging/rpm-sles/mysql.spec.in +++ b/packaging/rpm-sles/mysql.spec.in @@ -367,7 +367,7 @@ mkdir debug -DCMAKE_C_FLAGS="$optflags" \ -DCMAKE_CXX_FLAGS="$optflags" \ -DINSTALL_LIBDIR="%{_lib}/mysql" \ - -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin/debug" \ -DINSTALL_SQLBENCHDIR=share \ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ -DFEATURE_SET="%{feature_set}" \ From f06443ce5f9ca8a65b60b595b2095f76d8f65206 Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Thu, 16 Nov 2017 09:31:12 +0530 Subject: [PATCH 17/19] Bug #26881946: INCORRECT BEHAVIOR WITH "VALUES" Issue: ------ VALUES doesn't have a type() function and is considered a Item_field. Solution for 5.7: ----------------- Add a new type() function for Item_values_insert. On 8.0 and trunk it was fixed by Mithun's Bug#19601973. Solution for 5.6: ----------------- Additionally Bug#17458914 is backported. This will address the problem of using VALUES() in INSERT ... ON DUPLICATE KEY UPDATE. Create a field object only if it is in the UPDATE clause, else return a NULL item. This will also address the problems mentioned in Bug#14789787 and Bug#16756402. Solution for 5.5: ----------------- As mentioned above Bug#17458914 is backported. Additionally Bug#14786324 is also backported. When VALUES() is detected outside its meaningful place, it should be treated as NULL and is thus replaced with a Field_null object, with the same name as the original field. Fields with type NULL are generally not handled well inside the server (e.g Innodb will not accept them and it is impossible to create them in regular tables). So create a new const NULL item instead. --- mysql-test/r/insert_update.result | 6 +++--- sql/item.cc | 27 ++++++++++++++------------- sql/item.h | 2 ++ sql/sql_insert.cc | 8 +++++++- sql/sql_lex.cc | 5 +++-- sql/sql_lex.h | 4 +++- 6 files changed, 32 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index a285810b78b..31e7b253267 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -60,12 +60,12 @@ explain extended SELECT *, VALUES(a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,values(`test`.`t1`.`a`) AS `VALUES(a)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,NULL AS `VALUES(a)` from `test`.`t1` explain extended select * from t1 where values(a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where values(`test`.`t1`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 0 DROP TABLE t1; create table t1(a int primary key, b int); insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); diff --git a/sql/item.cc b/sql/item.cc index 6f1fdaae398..a37a61453e8 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -7120,7 +7120,7 @@ Item *Item_default_value::transform(Item_transformer transformer, uchar *args) bool Item_insert_value::eq(const Item *item, bool binary_cmp) const { return item->type() == INSERT_VALUE_ITEM && - ((Item_default_value *)item)->arg->eq(arg, binary_cmp); + ((Item_insert_value *)item)->arg->eq(arg, binary_cmp); } @@ -7149,11 +7149,12 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) Item_field *field_arg= (Item_field *)arg; - if (field_arg->field->table->insert_values) + if (field_arg->field->table->insert_values && + thd->lex->in_update_value_clause) { Field *def_field= (Field*) sql_alloc(field_arg->field->size_of()); if (!def_field) - return TRUE; + return true; memcpy(def_field, field_arg->field, field_arg->field->size_of()); def_field->move_field_offset((my_ptrdiff_t) (def_field->table->insert_values - @@ -7162,17 +7163,17 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) } else { - Field *tmp_field= field_arg->field; - /* charset doesn't matter here, it's to avoid sigsegv only */ - tmp_field= new Field_null(0, 0, Field::NONE, field_arg->field->field_name, - &my_charset_bin); - if (tmp_field) - { - tmp_field->init(field_arg->field->table); - set_field(tmp_field); - } + // VALUES() is used out-of-scope - its value is always NULL + Query_arena backup; + Query_arena *const arena= thd->activate_stmt_arena_if_needed(&backup); + Item *const item= new Item_null(this->name); + if (arena) + thd->restore_active_arena(arena, &backup); + if (!item) + return TRUE; + *items= item; } - return FALSE; + return false; } void Item_insert_value::print(String *str, enum_query_type query_type) diff --git a/sql/item.h b/sql/item.h index 9f4e1d24424..3556a58ff82 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3150,6 +3150,8 @@ public: :Item_field(context_arg, (const char *)NULL, (const char *)NULL, (const char *)NULL), arg(a) {} + + enum Type type() const { return INSERT_VALUE_ITEM; } bool eq(const Item *item, bool binary_cmp) const; bool fix_fields(THD *, Item **); virtual void print(String *str, enum_query_type query_type); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index dc7cb698476..5d1905bf4ba 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 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 @@ -1393,9 +1393,12 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, thd->abort_on_warning= saved_abort_on_warning; } + thd->lex->in_update_value_clause= true; if (!res) res= setup_fields(thd, 0, update_values, MARK_COLUMNS_READ, 0, 0); + thd->lex->in_update_value_clause= false; + if (!res && duplic == DUP_UPDATE) { select_lex->no_wrap_view_item= TRUE; @@ -3263,8 +3266,11 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table_list->next_name_resolution_table= ctx_state.get_first_name_resolution_table(); + thd->lex->in_update_value_clause= true; res= res || setup_fields(thd, 0, *info.update_values, MARK_COLUMNS_READ, 0, 0); + + thd->lex->in_update_value_clause= false; if (!res) { /* diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 50cdabe341a..f7e9fd8570d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 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 @@ -2376,7 +2376,8 @@ void Query_tables_list::destroy_query_tables_list() */ LEX::LEX() - :result(0), option_type(OPT_DEFAULT), is_lex_started(0) + :result(0), option_type(OPT_DEFAULT), is_lex_started(0), + in_update_value_clause(false) { my_init_dynamic_array2(&plugins, sizeof(plugin_ref), diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 867997feb39..3c950ebe117 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 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 @@ -2491,6 +2491,8 @@ struct LEX: public Query_tables_list bool escape_used; bool is_lex_started; /* If lex_start() did run. For debugging. */ + /// Set to true while resolving values in ON DUPLICATE KEY UPDATE clause + bool in_update_value_clause; /* The set of those tables whose fields are referenced in all subqueries From 63a540c8c3e93b7f15aec6260c0a85f1cd07f6dc Mon Sep 17 00:00:00 2001 From: Aditya A Date: Fri, 17 Nov 2017 14:46:09 +0530 Subject: [PATCH 18/19] Bug #24296076 INNODB REPORTS WARNING WHILE INNODB_UNDO_LOG_TRUNCATE IS ENABLED PROBLEM ------- This warning message is printed when trx_sys->rseg_history_len is greater than some arbitrary magic number (2000000). By seeing the reproducing scenario where we keep a read view open and do a lot of transactions on table which increases the hitsory length it is entirely possible that trx_sys->rseg_history_len can exceed 2000000. So this is not a bug due to corruption of history length.The warning message was just added to test some scenario and not removed. FIX --- 1.Print this warning message only for debug versions. 2.Modified the warning message with more detailed information. 3.Don't crash even in debug versions. [#rb 17929 Reviewed by jimmy and satya] --- storage/innobase/trx/trx0purge.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c index 0b3f389964b..ae384943c04 100644 --- a/storage/innobase/trx/trx0purge.c +++ b/storage/innobase/trx/trx0purge.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 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 @@ -721,6 +721,7 @@ trx_purge_rseg_get_next_history_log( mutex_exit(&(rseg->mutex)); mtr_commit(&mtr); +#ifdef UNIV_DEBUG mutex_enter(&kernel_mutex); /* Add debug code to track history list corruption reported @@ -734,18 +735,20 @@ trx_purge_rseg_get_next_history_log( if (trx_sys->rseg_history_len > 2000000) { ut_print_timestamp(stderr); fprintf(stderr, - " InnoDB: Warning: purge reached the" + " InnoDB: Warning: purge reached the" " head of the history list,\n" "InnoDB: but its length is still" - " reported as %lu! Make a detailed bug\n" - "InnoDB: report, and submit it" - " to http://bugs.mysql.com\n", + " reported as %lu!." + " This can happen becasue a long" + " running transaction is withholding" + " purging of undo logs or a read" + " view is open. Please try to commit" + " the long running transaction.", (ulong) trx_sys->rseg_history_len); - ut_ad(0); } mutex_exit(&kernel_mutex); - +#endif return; } From 946d9e4db4896992400cabbd0d1db9a0a10cbfd1 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Mon, 27 Nov 2017 14:51:04 +0530 Subject: [PATCH 19/19] Updated copyright year in user visible text --- README | 2 +- include/welcome_copyright_notice.h | 2 +- packaging/WiX/custom_ui.wxs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 2a3230ac685..37358f0886c 100644 --- a/README +++ b/README @@ -5,7 +5,7 @@ For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. MySQL is brought to you by Oracle. -Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. License information can be found in the COPYING file. diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index 0c17b5e650c..2b304d57f91 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -16,7 +16,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2017" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2018" /* This define specifies copyright notice which is displayed by every MySQL diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs index 9475de92722..a0dba4b6d3b 100644 --- a/packaging/WiX/custom_ui.wxs +++ b/packaging/WiX/custom_ui.wxs @@ -30,7 +30,7 @@ - +