From ddb24be133cdd6d95914a638eb35a544fde3a2b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Aug 2014 13:04:23 +0200 Subject: [PATCH 001/201] Raise version number after cloning 5.5.40 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ae997143dac..8d4846bdd50 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=40 +MYSQL_VERSION_PATCH=41 MYSQL_VERSION_EXTRA= From 2f8bd757cd02888d1bf14802fdb046f0e9b1a5c4 Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Mon, 25 Aug 2014 16:25:07 +0200 Subject: [PATCH 002/201] Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE ADD FOREIGN KEY Problem: We maintain two rb trees in each dict_table_t. The foreign_rbt must be in sync with foreign_list. The referenced_rbt must be in sync with referenced_list. There is one function which checks this consistency and it failed, resulting in an assert failure. The root cause of the problem was identified that the search order was lost in the referenced_rbt. This is because while renaming the table, we didn't not refresh this referenced_rbt. Solution: When a foreign key is renamed, we must delete and re-insert into both foreign_rbt and referenced_rbt. rb#6412 approved by Jimmy. --- mysql-test/suite/innodb/r/foreign-keys.result | 16 ++++++++++++ mysql-test/suite/innodb/t/foreign-keys.test | 26 +++++++++++++++++++ storage/innobase/dict/dict0dict.c | 10 +++++++ 3 files changed, 52 insertions(+) create mode 100644 mysql-test/suite/innodb/r/foreign-keys.result create mode 100644 mysql-test/suite/innodb/t/foreign-keys.test diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result new file mode 100644 index 00000000000..be8d27b152c --- /dev/null +++ b/mysql-test/suite/innodb/r/foreign-keys.result @@ -0,0 +1,16 @@ +# +# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE +# ADD FOREIGN KEY +# +CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT, +PRIMARY KEY (`department_id`)) engine=innodb; +CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT, +`title_reporter_fk` INT, PRIMARY KEY (`title_id`)); +CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)); +ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES +`people` (`people_id`); +ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people` +(`people_id`); +ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people` +(`people_id`); +drop table title, department, people; diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test new file mode 100644 index 00000000000..45642cf28a7 --- /dev/null +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -0,0 +1,26 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # +--echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE +--echo # ADD FOREIGN KEY +--echo # + +CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT, +PRIMARY KEY (`department_id`)) engine=innodb; + +CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT, +`title_reporter_fk` INT, PRIMARY KEY (`title_id`)); + +CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)); + +ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES +`people` (`people_id`); + +ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people` +(`people_id`); + +ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people` +(`people_id`); + +drop table title, department, people; diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index e225966afe6..0e4691658d5 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -1123,6 +1123,11 @@ dict_table_rename_in_cache( /* The id will be changed. So remove old one */ rbt_delete(foreign->foreign_table->foreign_rbt, foreign->id); + if (foreign->referenced_table) { + rbt_delete(foreign->referenced_table->referenced_rbt, + foreign->id); + } + if (ut_strlen(foreign->foreign_table_name) < ut_strlen(table->name)) { /* Allocate a longer name buffer; @@ -1273,6 +1278,11 @@ dict_table_rename_in_cache( rbt_insert(foreign->foreign_table->foreign_rbt, foreign->id, &foreign); + if (foreign->referenced_table) { + rbt_insert(foreign->referenced_table->referenced_rbt, + foreign->id, &foreign); + } + foreign = UT_LIST_GET_NEXT(foreign_list, foreign); } From f13cf9319e808da66c9d46bc4973a599c1d5c718 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Aug 2014 11:37:01 +0530 Subject: [PATCH 003/201] From db32c38c67fe02e9ac10a918275810539140c645 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 26 Aug 2014 11:40:54 +0200 Subject: [PATCH 004/201] Rename enterprise repo packages to commercial --- packaging/rpm-oel/mysql.spec.in | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in index e6fc6cd634d..d8cf49fe993 100644 --- a/packaging/rpm-oel/mysql.spec.in +++ b/packaging/rpm-oel/mysql.spec.in @@ -156,8 +156,8 @@ Requires: net-tools Provides: MySQL-server-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-server-advanced < %{version}-%{release} Obsoletes: mysql-community-server < %{version}-%{release} -Requires: mysql-enterprise-client%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-client%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else Provides: MySQL-server%{?_isa} = %{version}-%{release} Requires: mysql-community-client%{?_isa} = %{version}-%{release} @@ -209,7 +209,7 @@ Group: Applications/Databases Provides: MySQL-client-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-client-advanced < %{version}-%{release} Obsoletes: mysql-community-client < %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} %else Provides: MySQL-client%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release} @@ -248,7 +248,7 @@ Group: Applications/Databases Provides: MySQL-test-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-test-advanced < %{version}-%{release} Obsoletes: mysql-community-test < %{version}-%{release} -Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-server%{?_isa} = %{version}-%{release} %else Provides: MySQL-test%{?_isa} = %{version}-%{release} Requires: mysql-community-server%{?_isa} = %{version}-%{release} @@ -270,7 +270,7 @@ Summary: MySQL benchmark suite Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-bench < %{version}-%{release} -Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-server%{?_isa} = %{version}-%{release} %else Requires: mysql-community-server%{?_isa} = %{version}-%{release} %endif @@ -291,7 +291,7 @@ Group: Applications/Databases Provides: MySQL-devel-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-devel-advanced < %{version}-%{release} Obsoletes: mysql-community-devel < %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} %else Provides: MySQL-devel%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release} @@ -313,7 +313,7 @@ Group: Applications/Databases Provides: MySQL-shared-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-shared-advanced < %{version}-%{release} Obsoletes: mysql-community-libs < %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else Provides: MySQL-shared%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release} @@ -339,7 +339,7 @@ Provides: mysql-libs-compat%{?_isa} = %{version}-%{release} Provides: MySQL-shared-compat-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-shared-compat-advanced < %{version}-%{release} Obsoletes: mysql-community-libs-compat < %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} %else Provides: MySQL-shared-compat%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release} @@ -361,7 +361,7 @@ Group: Applications/Databases Provides: MySQL-embedded-advanced%{?_isa} = %{version}-%{release} Obsoletes: MySQL-embedded-advanced < %{version}-%{release} Obsoletes: mysql-community-embedded < %{version}-%{release} -Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-common%{?_isa} = %{version}-%{release} %else Provides: MySQL-embedded%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release} @@ -389,8 +389,8 @@ Summary: Development header files and libraries for MySQL as an embeddabl Group: Applications/Databases %if 0%{?commercial} Obsoletes: mysql-community-embedded-devel < %{version}-%{release} -Requires: mysql-enterprise-devel%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-embedded%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release} %else Requires: mysql-community-devel%{?_isa} = %{version}-%{release} Requires: mysql-community-embedded%{?_isa} = %{version}-%{release} @@ -409,9 +409,9 @@ the embedded version of the MySQL server. Summary: Convenience package for easy upgrades of MySQL package set Group: Applications/Databases %if 0%{?commercial} -Requires: mysql-enterprise-client%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} -Requires: mysql-enterprise-libs-compat%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-client%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release} +Requires: mysql-commercial-libs-compat%{?_isa} = %{version}-%{release} %else Requires: mysql-community-client%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release} From de71240ed3c01e433e70dd9f685b14e5ed715130 Mon Sep 17 00:00:00 2001 From: Murthy Narkedimilli Date: Wed, 27 Aug 2014 16:06:50 +0200 Subject: [PATCH 005/201] Changing the copyright headers a bit to be complaint with the standards --- storage/myisam/ftbench/ft-test-run.sh | 2 +- tests/fork_big.pl | 2 +- tests/fork_big2.pl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/myisam/ftbench/ft-test-run.sh b/storage/myisam/ftbench/ft-test-run.sh index 17b13d73d47..08e03474dac 100755 --- a/storage/myisam/ftbench/ft-test-run.sh +++ b/storage/myisam/ftbench/ft-test-run.sh @@ -2,7 +2,7 @@ # Copyright (c) 2003, 2005, 2006 MySQL AB # Use is subject to license terms - +# # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; version 2 diff --git a/tests/fork_big.pl b/tests/fork_big.pl index b866b899f8d..6e78e779d11 100755 --- a/tests/fork_big.pl +++ b/tests/fork_big.pl @@ -2,7 +2,7 @@ # Copyright (c) 2001, 2006 MySQL AB # Use is subject to license terms - +# # 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. diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl index a042f18ef2e..269358de401 100644 --- a/tests/fork_big2.pl +++ b/tests/fork_big2.pl @@ -2,7 +2,7 @@ # Copyright (c) 2002, 2003, 2005, 2006 MySQL AB # Use is subject to license terms - +# # 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. From 341ca222cff6181205df9123ac4a85bbcf293809 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Thu, 28 Aug 2014 12:16:53 +0400 Subject: [PATCH 006/201] Update copyright text. --- libmysqld/lib_sql.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 0e77ddc923c..7c8e9d3426a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -2,6 +2,9 @@ * Copyright (c) 2000 * SWsoft company * + * Modifications copyright (c) 2001, 2013. Oracle and/or its affiliates. + * All rights reserved. + * * This material is provided "as is", with absolutely no warranty expressed * or implied. Any use is at your own risk. * From 2b33138d002b628820509cf308bbd828e334688c Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Thu, 28 Aug 2014 14:29:54 +0530 Subject: [PATCH 007/201] Bug#19145712 USER AFTER FREE / DOUBLE FREE ISSUE Problem: A corrupted header length in FORMAT_DESCRIPTION_LOG_EVENT can cause server to crash. Analysis: FORMAT_DESCRIPTION_EVENT will be considered invalid if header len is too small (i.e. below OLD_HEADER_LEN). Format_description_log_event:: Format_description_log_event(...) { ... if ((common_header_len=buf[ST_COMMON_HEADER_LEN_OFFSET]) < OLD_HEADER_LEN) DBUG_VOID_RETURN; /* sanity check */ ... post_header_len= my_memdup(...) } In that case Format_description_log_event constructor will return early, without allocating any memory for post_header_len. Thence this variable is left uninitialized and making server to crash when server is trying to free the uninitialized value. Fix: When Format_description_log_event constructor returns early, assign NULL to post_header_len. --- sql/log_event.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/log_event.cc b/sql/log_event.cc index 4f55d08933e..71ca722ffd6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4087,7 +4087,11 @@ Format_description_log_event(const char* buf, DBUG_ENTER("Format_description_log_event::Format_description_log_event(char*,...)"); buf+= LOG_EVENT_MINIMAL_HEADER_LEN; if ((common_header_len=buf[ST_COMMON_HEADER_LEN_OFFSET]) < OLD_HEADER_LEN) + { + /* this makes is_valid() return false. */ + post_header_len= NULL; DBUG_VOID_RETURN; /* sanity check */ + } number_of_event_types= event_len-(LOG_EVENT_MINIMAL_HEADER_LEN+ST_COMMON_HEADER_LEN_OFFSET+1); DBUG_PRINT("info", ("common_header_len=%d number_of_event_types=%d", From 863bcdfd89df5f62d1e31f8f8e23f1c8d885ef6e Mon Sep 17 00:00:00 2001 From: Sayantan Dutta Date: Tue, 2 Sep 2014 15:12:55 +0530 Subject: [PATCH 008/201] Bug #19361402 - ADD --MANUAL-LLDB OPTION TO MYSQL-TEST-RUN.PL, contributed --- mysql-test/mysql-test-run.pl | 42 +++++++++++++++++++++++++++++++++--- scripts/mysqlaccess.conf | 0 2 files changed, 39 insertions(+), 3 deletions(-) mode change 100644 => 100755 scripts/mysqlaccess.conf diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e236d3ce267..636f3d88c62 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -232,6 +232,7 @@ our $opt_ddd; our $opt_client_ddd; my $opt_boot_ddd; our $opt_manual_gdb; +our $opt_manual_lldb; our $opt_manual_dbx; our $opt_manual_ddd; our $opt_manual_debug; @@ -1086,6 +1087,7 @@ sub command_line_setup { 'gdb' => \$opt_gdb, 'client-gdb' => \$opt_client_gdb, 'manual-gdb' => \$opt_manual_gdb, + 'manual-lldb' => \$opt_manual_lldb, 'boot-gdb' => \$opt_boot_gdb, 'manual-debug' => \$opt_manual_debug, 'ddd' => \$opt_ddd, @@ -1536,8 +1538,9 @@ sub command_line_setup { $opt_debugger= undef; } - if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || - $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) + if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || + $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || + $opt_manual_dbx) { mtr_error("You need to use the client debug options for the", "embedded server. Ex: --client-gdb"); @@ -1564,7 +1567,7 @@ sub command_line_setup { # Check debug related options # -------------------------------------------------------------------------- if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || - $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || + $opt_manual_gdb || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { @@ -4985,6 +4988,10 @@ sub mysqld_start ($$) { { gdb_arguments(\$args, \$exe, $mysqld->name()); } + elsif ( $opt_manual_lldb ) + { + lldb_arguments(\$args, \$exe, $mysqld->name()); + } elsif ( $opt_ddd || $opt_manual_ddd ) { ddd_arguments(\$args, \$exe, $mysqld->name()); @@ -5730,6 +5737,33 @@ sub gdb_arguments { $$exe= "xterm"; } + # +# Modify the exe and args so that program is run in lldb +# +sub lldb_arguments { + my $args= shift; + my $exe= shift; + my $type= shift; + my $input= shift; + + my $lldb_init_file= "$opt_vardir/tmp/lldbinit.$type"; + unlink($lldb_init_file); + + my $str= join(" ", @$$args); + my $runline= $input ? "r $str < $input" : "r $str"; + + # write init file for mysqld or client + mtr_tofile($lldb_init_file, + "b main\n" . + $runline); + + print "\nTo start lldb for $type, type in another window:\n"; + print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; + + # Indicate the exe should not be started + $$exe= undef; + return; +} # # Modify the exe and args so that program is run in ddd @@ -6190,6 +6224,8 @@ Options for debugging the product test(s) manual-dbx Let user manually start mysqld in dbx, before running test(s) + manual-lldb Let user manually start mysqld in lldb, before running + test(s) strace-client Create strace output for mysqltest client, strace-server Create strace output for mysqltest server, max-save-core Limit the number of core files saved (to avoid filling diff --git a/scripts/mysqlaccess.conf b/scripts/mysqlaccess.conf old mode 100644 new mode 100755 From b1d88a21c2c9dec980f5d251ac72857fb4e6bf9a Mon Sep 17 00:00:00 2001 From: Sayantan Dutta Date: Wed, 3 Sep 2014 14:37:00 +0530 Subject: [PATCH 009/201] Bug #19361317 - --MANUAL-GDB EFFECTIVELY TRUNCATES OPTION FILE ARGS AT FIRST SEMICOLON --- mysql-test/mysql-test-run.pl | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 636f3d88c62..7616a1ec39d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5684,6 +5684,24 @@ sub start_mysqltest ($) { return $proc; } +sub create_debug_statement { + my $args= shift; + my $input= shift; + + # Put $args into a single string + my $str= join(" ", @$$args); + my $runline= $input ? "run $str < $input" : "run $str"; + + # add quotes to escape ; in plugin_load option + my $pos1 = index($runline, "--plugin_load="); + if ( $pos1 != -1 ) { + my $pos2 = index($runline, " ",$pos1); + substr($runline,$pos1+14,0) = "\""; + substr($runline,$pos2+1,0) = "\""; + } + + return $runline; +} # # Modify the exe and args so that program is run in gdb in xterm @@ -5699,9 +5717,7 @@ sub gdb_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - # Put $args into a single string - my $str= join(" ", @$$args); - my $runline= $input ? "run $str < $input" : "run $str"; + my $runline=create_debug_statement($args,$input); # write init file for mysqld or client mtr_tofile($gdb_init_file, @@ -5749,8 +5765,7 @@ sub lldb_arguments { my $lldb_init_file= "$opt_vardir/tmp/lldbinit.$type"; unlink($lldb_init_file); - my $str= join(" ", @$$args); - my $runline= $input ? "r $str < $input" : "r $str"; + my $runline=create_debug_statement($args,$input); # write init file for mysqld or client mtr_tofile($lldb_init_file, @@ -5779,9 +5794,7 @@ sub ddd_arguments { # Remove the old gdbinit file unlink($gdb_init_file); - # Put $args into a single string - my $str= join(" ", @$$args); - my $runline= $input ? "run $str < $input" : "run $str"; + my $runline=create_debug_statement($args,$input); # write init file for mysqld or client mtr_tofile($gdb_init_file, From c8d49a8dabd4adcb050f3f167170ba0e3814addd Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 5 Sep 2014 09:26:57 +0400 Subject: [PATCH 010/201] removed WL7219: Audit Log Filtering from mysql-5.5. --- sql/sql_audit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc index 6ccdcefe8eb..bf672b6ea48 100644 --- a/sql/sql_audit.cc +++ b/sql/sql_audit.cc @@ -353,7 +353,7 @@ int initialize_audit_plugin(st_plugin_int *plugin) return 1; } - if (plugin->plugin->init && plugin->plugin->init(plugin)) + if (plugin->plugin->init && plugin->plugin->init(NULL)) { sql_print_error("Plugin '%s' init function returned error.", plugin->name.str); From 0b28d7e048fa097280be54f9baffd202f7626bdd Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Wed, 10 Sep 2014 10:50:17 +0530 Subject: [PATCH 011/201] Bug#18790730 - CROSS-DATABASE FOREIGN KEY WITHOUT PERMISSIONS CHECK. Analysis: ---------- Issue here is, while creating or altering the InnoDB table, if the foreign key defined on the table references a parent table on which the user has no access privileges then the table is created without reporting any error. Currently the privilege level REFERENCES_ACL is unused and is not used for access evaluation while creating the table with a foreign key constraint or adding the foreign key constraint to a table. But when no privileges are granted to user then also access evaluation on parent table is ignored. Fix: --------- For DMLs, irrelevant of the fact, support does not want any changes to avoid permission checks on every operation. So, as a fix, added a function "check_fk_parent_table_access" to check whether any of the SELECT_ACL, INSERT_ACL, UDPATE_ACL, DELETE_ACL or REFERENCE_ACL privileges are granted for user at table level. If none of them is granted then error is reported. This function is called during the table creation and alter operation. --- sql/handler.h | 1 + sql/sql_parse.cc | 120 +++++++++++++++++++++++++- sql/sql_parse.h | 3 + sql/sql_table.cc | 12 +++ storage/innobase/handler/ha_innodb.cc | 2 +- 5 files changed, 136 insertions(+), 2 deletions(-) diff --git a/sql/handler.h b/sql/handler.h index 5eb2d6b440a..17306fe7dd4 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -868,6 +868,7 @@ struct handlerton #define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported #define HTON_SUPPORT_LOG_TABLES (1 << 7) //Engine supports log tables #define HTON_NO_PARTITION (1 << 8) //You can not partition these tables +#define HTON_SUPPORTS_FOREIGN_KEYS (1 << 9) //Foreign key constraint supported. class Ha_trx_info; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ea63d23d182..f52f56447f4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5251,6 +5251,121 @@ bool check_global_access(THD *thd, ulong want_access) #endif } + +/** + Checks foreign key's parent table access. + + @param thd [in] Thread handler + @param create_info [in] Create information (like MAX_ROWS, ENGINE or + temporary table flag) + @param alter_info [in] Initial list of columns and indexes for the + table to be created + + @retval + false ok. + @retval + true error or access denied. Error is sent to client in this case. +*/ +bool check_fk_parent_table_access(THD *thd, + HA_CREATE_INFO *create_info, + Alter_info *alter_info) +{ + Key *key; + List_iterator key_iterator(alter_info->key_list); + handlerton *db_type= create_info->db_type ? create_info->db_type : + ha_default_handlerton(thd); + + // Return if engine does not support Foreign key Constraint. + if (!ha_check_storage_engine_flag(db_type, HTON_SUPPORTS_FOREIGN_KEYS)) + return false; + + while ((key= key_iterator++)) + { + if (key->type == Key::FOREIGN_KEY) + { + TABLE_LIST parent_table; + bool is_qualified_table_name; + Foreign_key *fk_key= (Foreign_key *)key; + LEX_STRING db_name; + LEX_STRING table_name= { fk_key->ref_table->table.str, + fk_key->ref_table->table.length }; + const ulong privileges= (SELECT_ACL | INSERT_ACL | UPDATE_ACL | + DELETE_ACL | REFERENCES_ACL); + + // Check if tablename is valid or not. + DBUG_ASSERT(table_name.str != NULL); + if (check_table_name(table_name.str, table_name.length, false)) + { + my_error(ER_WRONG_TABLE_NAME, MYF(0), table_name.str); + return true; + } + + if (fk_key->ref_table->db.str) + { + is_qualified_table_name= true; + db_name.str= (char *) thd->memdup(fk_key->ref_table->db.str, + fk_key->ref_table->db.length+1); + db_name.length= fk_key->ref_table->db.length; + + // Check if database name is valid or not. + if (fk_key->ref_table->db.str && check_db_name(&db_name)) + { + my_error(ER_WRONG_DB_NAME, MYF(0), db_name.str); + return true; + } + } + else if (thd->lex->copy_db_to(&db_name.str, &db_name.length)) + return true; + else + is_qualified_table_name= false; + + // if lower_case_table_names is set then convert tablename to lower case. + if (lower_case_table_names) + { + table_name.str= (char *) thd->memdup(fk_key->ref_table->table.str, + fk_key->ref_table->table.length+1); + table_name.length= my_casedn_str(files_charset_info, table_name.str); + } + + parent_table.init_one_table(db_name.str, db_name.length, + table_name.str, table_name.length, + table_name.str, TL_IGNORE); + + /* + Check if user has any of the "privileges" at table level on + "parent_table". + Having privilege on any of the parent_table column is not + enough so checking whether user has any of the "privileges" + at table level only here. + */ + if (check_some_access(thd, privileges, &parent_table) || + parent_table.grant.want_privilege) + { + if (is_qualified_table_name) + { + const size_t qualified_table_name_len= NAME_LEN + 1 + NAME_LEN + 1; + char *qualified_table_name= (char *) thd->alloc(qualified_table_name_len); + + my_snprintf(qualified_table_name, qualified_table_name_len, "%s.%s", + db_name.str, table_name.str); + table_name.str= qualified_table_name; + } + + my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), + "REFERENCES", + thd->security_ctx->priv_user, + thd->security_ctx->host_or_ip, + table_name.str); + + return true; + } + } + } + + return false; +} + + /**************************************************************************** Check stack size; Send error if there isn't enough stack to continue ****************************************************************************/ @@ -7072,8 +7187,11 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, if (check_table_access(thd, SELECT_ACL, tables, FALSE, UINT_MAX, FALSE)) goto err; } - error= FALSE; + if (check_fk_parent_table_access(thd, &lex->create_info, &lex->alter_info)) + goto err; + + error= FALSE; err: DBUG_RETURN(error); } diff --git a/sql/sql_parse.h b/sql/sql_parse.h index 9a55174b0fb..f7b4d530543 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -45,6 +45,9 @@ bool delete_precheck(THD *thd, TABLE_LIST *tables); bool insert_precheck(THD *thd, TABLE_LIST *tables); bool create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); +bool check_fk_parent_table_access(THD *thd, + HA_CREATE_INFO *create_info, + Alter_info *alter_info); bool parse_sql(THD *thd, Parser_state *parser_state, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8b4873cb834..e8de6a6928a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6004,6 +6004,18 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, goto err; } + /* + If foreign key is added then check permission to access parent table. + + In function "check_fk_parent_table_access", create_info->db_type is used + to identify whether engine supports FK constraint or not. Since + create_info->db_type is set here, check to parent table access is delayed + till this point for the alter operation. + */ + if ((alter_info->flags & ALTER_FOREIGN_KEY) && + check_fk_parent_table_access(thd, create_info, alter_info)) + goto err; + /* If this is an ALTER TABLE and no explicit row type specified reuse the table's row type. diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index adedc4fa961..8f299aed213 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2251,7 +2251,7 @@ innobase_init( innobase_hton->start_consistent_snapshot=innobase_start_trx_and_assign_read_view; innobase_hton->flush_logs=innobase_flush_logs; innobase_hton->show_status=innobase_show_status; - innobase_hton->flags=HTON_NO_FLAGS; + innobase_hton->flags=HTON_SUPPORTS_FOREIGN_KEYS; innobase_hton->release_temporary_latches=innobase_release_temporary_latches; innobase_hton->alter_table_flags = innobase_alter_table_flags; From 7827fd486d24d473e74a9279cb7bc56c1a75187f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Sep 2014 09:57:34 +0530 Subject: [PATCH 012/201] From 4afd7e9ff21e5e2645dae6967fa9d83b4eed25a9 Mon Sep 17 00:00:00 2001 From: Sayantan Dutta Date: Thu, 11 Sep 2014 14:48:21 +0530 Subject: [PATCH 013/201] Bug #18964545 ADD MTR SUPPORT FOR DEBUGGING WITH LLDB --- mysql-test/mysql-test-run.pl | 61 +++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7616a1ec39d..472dc91ea69 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -223,8 +223,11 @@ our %gprof_dirs; our $glob_debugger= 0; our $opt_gdb; +our $opt_lldb; our $opt_client_gdb; +our $opt_client_lldb; my $opt_boot_gdb; +my $opt_boot_lldb; our $opt_dbx; our $opt_client_dbx; my $opt_boot_dbx; @@ -1085,10 +1088,13 @@ sub command_line_setup { 'debug-common' => \$opt_debug_common, 'debug-server' => \$opt_debug_server, 'gdb' => \$opt_gdb, + 'lldb' => \$opt_lldb, 'client-gdb' => \$opt_client_gdb, + 'client-lldb' => \$opt_client_lldb, 'manual-gdb' => \$opt_manual_gdb, 'manual-lldb' => \$opt_manual_lldb, 'boot-gdb' => \$opt_boot_gdb, + 'boot-lldb' => \$opt_boot_lldb, 'manual-debug' => \$opt_manual_debug, 'ddd' => \$opt_ddd, 'client-ddd' => \$opt_client_ddd, @@ -1518,6 +1524,13 @@ sub command_line_setup { $opt_gdb= undef; } + if ($opt_lldb) + { + mtr_warning("Silently converting --lldb to --client-lldb in embedded mode"); + $opt_client_lldb= $opt_lldb; + $opt_lldb= undef; + } + if ($opt_ddd) { mtr_warning("Silently converting --ddd to --client-ddd in embedded mode"); @@ -1538,7 +1551,7 @@ sub command_line_setup { $opt_debugger= undef; } - if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || + if ( $opt_gdb || $opt_ddd || $opt_lldb || $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) { @@ -1566,10 +1579,10 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Check debug related options # -------------------------------------------------------------------------- - if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || - $opt_manual_gdb || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || - $opt_dbx || $opt_client_dbx || $opt_manual_dbx || - $opt_debugger || $opt_client_debugger ) + if ( $opt_gdb || $opt_client_gdb || $opt_lldb || $opt_client_lldb || + $opt_ddd || $opt_client_ddd || $opt_manual_gdb || $opt_manual_gdb || + $opt_manual_ddd || $opt_manual_debug || $opt_dbx || $opt_client_dbx || + $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { # Indicate that we are using debugger $glob_debugger= 1; @@ -3328,6 +3341,10 @@ sub mysql_install_db { gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), $bootstrap_sql_file); } + if ($opt_boot_lldb) { + lldb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), + $bootstrap_sql_file); + } if ($opt_boot_dbx) { dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), $bootstrap_sql_file); @@ -4988,7 +5005,7 @@ sub mysqld_start ($$) { { gdb_arguments(\$args, \$exe, $mysqld->name()); } - elsif ( $opt_manual_lldb ) + elsif ( $opt_lldb || $opt_manual_lldb ) { lldb_arguments(\$args, \$exe, $mysqld->name()); } @@ -5659,6 +5676,10 @@ sub start_mysqltest ($) { { gdb_arguments(\$args, \$exe, "client"); } + if ( $opt_client_lldb ) + { + lldb_arguments(\$args, \$exe, "client"); + } elsif ( $opt_client_ddd ) { ddd_arguments(\$args, \$exe, "client"); @@ -5772,12 +5793,30 @@ sub lldb_arguments { "b main\n" . $runline); - print "\nTo start lldb for $type, type in another window:\n"; - print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; + if ( $opt_manual_ddd ) + { + print "\nTo start lldb for $type, type in another window:\n"; + print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; - # Indicate the exe should not be started - $$exe= undef; - return; + # Indicate the exe should not be started + $$exe= undef; + return; + } + + my $save_exe= $$exe; + $$args= []; + if ( $exe_libtool ) + { + $$exe= $exe_libtool; + mtr_add_arg($$args, "--mode=execute"); + mtr_add_arg($$args, "lldb"); + } + else + { + $$exe= "lldb"; + } + mtr_add_arg($$args, "--command=$lldb_init_file"); + mtr_add_arg($$args, "$save_exe"); } # From 43d880b7e940f5c72f03a3d588b86162bda172e4 Mon Sep 17 00:00:00 2001 From: Praveenkumar Hulakund Date: Tue, 16 Sep 2014 11:28:46 +0530 Subject: [PATCH 014/201] Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK() AND IS_USED_LOCK(). Analysis: ----------- In functions Item_func_is_free_lock::val_int() and Item_func_is_used_lock::val_int(), for the specified user lock name, pointer to its "User_level_lock" object is obtained from hash "hash_user_locks". Mutex "LOCK_user_locks" is acquired for this and released immediately. And we are accessing members of User_level_lock after releasing the mutex. If same user lock is deleted(released) from concurrent thread then accessing members results in invalid(freed) memory access issue. Deleting of user lock is also protected from the mutex "LOCK_user_locks". Since this mutex is released in "val_int" functions mentioned above, delete operation proceeds while concurrent thread tries to access its members. With the test case, valgrind reports invalid read issues in val_int functions. Fix: ----------- To fix this issue, in "val_int" function of classes "Item_func_is_free_lock" and "Item_func_is_used_lock", now releasing mutex "LOCK_user_locks" after accessing User_level_lock members. --- mysql-test/r/lock_sync.result | 51 ++++++++++++++++++++++++++++++++ mysql-test/t/lock_sync.test | 55 +++++++++++++++++++++++++++++++++++ sql/item_func.cc | 23 ++++++++++----- 3 files changed, 121 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result index 8fe94679e70..3877e70372c 100644 --- a/mysql-test/r/lock_sync.result +++ b/mysql-test/r/lock_sync.result @@ -773,3 +773,54 @@ Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function SET DEBUG_SYNC= 'RESET'; DROP VIEW v1; DROP TABLE t1; +# +# Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK() AND IS_USED_LOCK(). +# +# Verifying issue for IS_FREE_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); +GET_LOCK("lock_19070633", 600) +1 +connect con1, localhost, root,,; +# Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +# Sending: SELECT IS_FREE_LOCK("lock_19070633"); +SELECT IS_FREE_LOCK("lock_19070633"); +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +RELEASE_LOCK("lock_19070633") +1 +# Signaling connection con1 after releasing the lock. +# Without fix, accessing user level lock info in con1 would result in +# crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +# Reaping: SELECT IS_FREE_LOCK("lock_19070633"); +IS_FREE_LOCK("lock_19070633") +0 +connection default; +# Verifying issue for IS_USED_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); +GET_LOCK("lock_19070633", 600) +1 +connection con1; +# Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +# Sending: SELECT IS_USED_LOCK("lock_19070633"); +SELECT IS_USED_LOCK("lock_19070633"); +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +RELEASE_LOCK("lock_19070633") +1 +# Signaling connection con1 after releasing the lock. +# Without fix, accessing user level lock info in con1 would result in +# crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +# Reaping: SELECT IS_USED_LOCK("lock_19070633"); +IS_USED_LOCK("lock_19070633") +# +connection default; +SET DEBUG_SYNC= 'RESET'; +disconnect con1; diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test index d5ad7becd7d..bcb78b5b600 100644 --- a/mysql-test/t/lock_sync.test +++ b/mysql-test/t/lock_sync.test @@ -1136,6 +1136,61 @@ DROP TABLE t1; disconnect con1; disconnect con2; +--echo # +--echo # Bug#19070633 - POSSIBLE ACCESS TO FREED MEMORY IN IS_FREE_LOCK() AND IS_USED_LOCK(). +--echo # + +--enable_connect_log + +--echo # Verifying issue for IS_FREE_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); + +connect (con1, localhost, root,,); +--echo # Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +--echo # Sending: SELECT IS_FREE_LOCK("lock_19070633"); +send SELECT IS_FREE_LOCK("lock_19070633"); + +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +--echo # Signaling connection con1 after releasing the lock. +--echo # Without fix, accessing user level lock info in con1 would result in +--echo # crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; + +connection con1; +--echo # Reaping: SELECT IS_FREE_LOCK("lock_19070633"); +--reap + +connection default; +--echo # Verifying issue for IS_USED_LOCK() function. +SELECT GET_LOCK("lock_19070633", 600); + +connection con1; +--echo # Waiting after getting user level lock info and releasing mutex. +SET DEBUG_SYNC= 'after_getting_user_level_lock_info SIGNAL parked WAIT_FOR go'; +--echo # Sending: SELECT IS_USED_LOCK("lock_19070633"); +send SELECT IS_USED_LOCK("lock_19070633"); + +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR parked'; +SELECT RELEASE_LOCK("lock_19070633"); +--echo # Signaling connection con1 after releasing the lock. +--echo # Without fix, accessing user level lock info in con1 would result in +--echo # crash or valgrind issue invalid read is reported. +SET DEBUG_SYNC= 'now SIGNAL go'; + +connection con1; +--echo # Reaping: SELECT IS_USED_LOCK("lock_19070633"); +--replace_column 1 # +--reap + +connection default; +SET DEBUG_SYNC= 'RESET'; +disconnect con1; + +--disable_connect_log # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. diff --git a/sql/item_func.cc b/sql/item_func.cc index 3e3079f317f..96cf07550d8 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -6159,21 +6159,24 @@ longlong Item_func_is_free_lock::val_int() DBUG_ASSERT(fixed == 1); String *res=args[0]->val_str(&value); User_level_lock *ull; + longlong ret_val= 0LL; null_value=0; if (!res || !res->length()) { null_value=1; - return 0; + return ret_val; } mysql_mutex_lock(&LOCK_user_locks); ull= (User_level_lock *) my_hash_search(&hash_user_locks, (uchar*) res->ptr(), (size_t) res->length()); - mysql_mutex_unlock(&LOCK_user_locks); if (!ull || !ull->locked) - return 1; - return 0; + ret_val= 1; + mysql_mutex_unlock(&LOCK_user_locks); + DEBUG_SYNC(current_thd, "after_getting_user_level_lock_info"); + + return ret_val; } longlong Item_func_is_used_lock::val_int() @@ -6181,6 +6184,7 @@ longlong Item_func_is_used_lock::val_int() DBUG_ASSERT(fixed == 1); String *res=args[0]->val_str(&value); User_level_lock *ull; + my_thread_id thread_id= 0UL; null_value=1; if (!res || !res->length()) @@ -6189,12 +6193,15 @@ longlong Item_func_is_used_lock::val_int() mysql_mutex_lock(&LOCK_user_locks); ull= (User_level_lock *) my_hash_search(&hash_user_locks, (uchar*) res->ptr(), (size_t) res->length()); + if ((ull != NULL) && ull->locked) + { + null_value= 0; + thread_id= ull->thread_id; + } mysql_mutex_unlock(&LOCK_user_locks); - if (!ull || !ull->locked) - return 0; + DEBUG_SYNC(current_thd, "after_getting_user_level_lock_info"); - null_value=0; - return ull->thread_id; + return thread_id; } From 40f30ee6cc1062c56e2ab1ff7cf9cbf921d729f3 Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Wed, 17 Sep 2014 10:42:31 +0530 Subject: [PATCH 015/201] Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN INNODB_STRICT_MODE = 1 Problem: Creation of a table fails when innodb_strict_mode is enabled, but the same table is created without any warning when innodb_strict_mode is enabled. Solution: If creation of a table fails with an error when innodb_strict_mode is enabled, it must issue a warning when innodb_strict_mode is disabled. rb#6723 approved by Krunal. --- mysql-test/suite/innodb/r/strict_mode.result | 242 ++++++++++++++++++ mysql-test/suite/innodb/t/strict_mode.test | 246 +++++++++++++++++++ storage/innobase/dict/dict0dict.c | 21 +- storage/innobase/handler/ha_innodb.cc | 27 ++ 4 files changed, 532 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/innodb/r/strict_mode.result create mode 100644 mysql-test/suite/innodb/t/strict_mode.test diff --git a/mysql-test/suite/innodb/r/strict_mode.result b/mysql-test/suite/innodb/r/strict_mode.result new file mode 100644 index 00000000000..7a550e105e6 --- /dev/null +++ b/mysql-test/suite/innodb/r/strict_mode.result @@ -0,0 +1,242 @@ +# +# Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN +# INNODB_STRICT_MODE = 1 +# +set innodb_strict_mode = 0; +create table t1 (id int auto_increment primary key, +v varchar(32), +col1 text, +col2 text, +col3 text, +col4 text, +col5 text, +col6 text, +col7 text, +col8 text, +col9 text, +col10 text, +col11 text, +col12 text, +col13 text, +col14 text, +col15 text, +col16 text, +col17 text, +col18 text, +col19 text, +col20 text, +col21 text, +col22 text, +col23 text, +col24 text, +col25 text, +col26 text, +col27 text, +col28 text, +col29 text, +col30 text, +col31 text, +col32 text, +col33 text, +col34 text, +col35 text, +col36 text, +col37 text, +col38 text, +col39 text, +col40 text, +col41 text, +col42 text, +col43 text, +col44 text, +col45 text , +col46 text, +col47 text, +col48 text, +col49 text, +col50 text, +col51 text, +col52 text, +col53 text, +col54 text, +col55 text, +col56 text, +col57 text, +col58 text, +col59 text, +col60 text, +col61 text, +col62 text, +col63 text, +col64 text, +col65 text, +col66 text, +col67 text, +col68 text , +col69 text, +col70 text, +col71 text, +col72 text, +col73 text, +col74 text, +col75 text, +col76 text, +col77 text, +col78 text, +col79 text, +col80 text, +col81 text, +col82 text, +col83 text, +col84 text, +col85 text, +col86 text, +col87 text, +col88 text, +col89 text, +col90 text, +col91 text, +col92 text, +col93 text, +col94 text, +col95 text, +col96 text, +col97 text, +col98 text, +col99 text, +col100 text, +col101 text, +col102 text, +col103 text, +col104 text, +col105 text, +col106 text, +col107 text, +col108 text, +col109 text, +col110 text, +col111 text, +col112 text, +col113 text, +col114 text, +col115 text, +col116 text, +col117 text, +col118 text, +col119 text, +col120 text, +col121 text, +col122 text, +col123 text, +col124 text, +col125 text, +col126 text , +col127 text, +col128 text, +col129 text, +col130 text, +col131 text, +col132 text, +col133 text, +col134 text, +col135 text, +col136 text, +col137 text, +col138 text, +col139 text, +col140 text, +col141 text, +col142 text, +col143 text, +col144 text, +col145 text, +col146 text, +col147 text , +col148 text, +col149 text, +col150 text, +col151 text, +col152 text, +col153 text, +col154 text, +col155 text, +col156 text, +col157 text, +col158 text, +col159 text, +col160 text, +col161 text, +col162 text, +col163 text, +col164 text, +col165 text, +col166 text, +col167 text, +col168 text, +col169 text, +col170 text, +col171 text, +col172 text , +col173 text, +col174 text, +col175 text, +col176 text, +col177 text, +col178 text, +col179 text, +col180 text, +col181 text, +col182 text, +col183 text, +col184 text, +col185 text, +col186 text, +col187 text, +col188 text, +col189 text, +col190 text, +col191 text, +col192 text, +col193 text, +col194 text, +col195 text, +col196 text, +col197 text, +col198 text, +col199 text, +col200 text, +col201 text, +col202 text, +col203 text, +col204 text, +col205 text, +col206 text, +col207 text, +col208 text, +col209 text, +col210 text, +col211 text, +col212 text, +col213 text, +col214 text, +col215 text, +col216 text, +col217 text, +col218 text, +col219 text, +col220 text, +col221 text, +col222 text, +col223 text, +col224 text, +col225 text, +col226 text, +col227 text, +col228 text +) ENGINE=InnoDB; +Warnings: +Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +set innodb_strict_mode = 1; +alter table t1 engine=InnoDB; +ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +drop table t1; diff --git a/mysql-test/suite/innodb/t/strict_mode.test b/mysql-test/suite/innodb/t/strict_mode.test new file mode 100644 index 00000000000..86b56a09c0e --- /dev/null +++ b/mysql-test/suite/innodb/t/strict_mode.test @@ -0,0 +1,246 @@ +--source include/have_innodb.inc + +--echo # +--echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN +--echo # INNODB_STRICT_MODE = 1 +--echo # + +set innodb_strict_mode = 0; + +create table t1 (id int auto_increment primary key, +v varchar(32), +col1 text, +col2 text, +col3 text, +col4 text, +col5 text, +col6 text, +col7 text, +col8 text, +col9 text, +col10 text, +col11 text, +col12 text, +col13 text, +col14 text, +col15 text, +col16 text, +col17 text, +col18 text, +col19 text, +col20 text, +col21 text, +col22 text, +col23 text, +col24 text, +col25 text, +col26 text, +col27 text, +col28 text, +col29 text, +col30 text, +col31 text, +col32 text, +col33 text, +col34 text, +col35 text, +col36 text, +col37 text, +col38 text, +col39 text, +col40 text, +col41 text, +col42 text, +col43 text, +col44 text, +col45 text , +col46 text, +col47 text, +col48 text, +col49 text, +col50 text, +col51 text, +col52 text, +col53 text, +col54 text, +col55 text, +col56 text, +col57 text, +col58 text, +col59 text, +col60 text, +col61 text, +col62 text, +col63 text, +col64 text, +col65 text, +col66 text, +col67 text, +col68 text , +col69 text, +col70 text, +col71 text, +col72 text, +col73 text, +col74 text, +col75 text, +col76 text, +col77 text, +col78 text, +col79 text, +col80 text, +col81 text, +col82 text, +col83 text, +col84 text, +col85 text, +col86 text, +col87 text, +col88 text, +col89 text, +col90 text, +col91 text, +col92 text, +col93 text, +col94 text, +col95 text, +col96 text, +col97 text, +col98 text, +col99 text, +col100 text, +col101 text, +col102 text, +col103 text, +col104 text, +col105 text, +col106 text, +col107 text, +col108 text, +col109 text, +col110 text, +col111 text, +col112 text, +col113 text, +col114 text, +col115 text, +col116 text, +col117 text, +col118 text, +col119 text, +col120 text, +col121 text, +col122 text, +col123 text, +col124 text, +col125 text, +col126 text , +col127 text, +col128 text, +col129 text, +col130 text, +col131 text, +col132 text, +col133 text, +col134 text, +col135 text, +col136 text, +col137 text, +col138 text, +col139 text, +col140 text, +col141 text, +col142 text, +col143 text, +col144 text, +col145 text, +col146 text, +col147 text , +col148 text, +col149 text, +col150 text, +col151 text, +col152 text, +col153 text, +col154 text, +col155 text, +col156 text, +col157 text, +col158 text, +col159 text, +col160 text, +col161 text, +col162 text, +col163 text, +col164 text, +col165 text, +col166 text, +col167 text, +col168 text, +col169 text, +col170 text, +col171 text, +col172 text , +col173 text, +col174 text, +col175 text, +col176 text, +col177 text, +col178 text, +col179 text, +col180 text, +col181 text, +col182 text, +col183 text, +col184 text, +col185 text, +col186 text, +col187 text, +col188 text, +col189 text, +col190 text, +col191 text, +col192 text, +col193 text, +col194 text, +col195 text, +col196 text, +col197 text, +col198 text, +col199 text, +col200 text, +col201 text, +col202 text, +col203 text, +col204 text, +col205 text, +col206 text, +col207 text, +col208 text, +col209 text, +col210 text, +col211 text, +col212 text, +col213 text, +col214 text, +col215 text, +col216 text, +col217 text, +col218 text, +col219 text, +col220 text, +col221 text, +col222 text, +col223 text, +col224 text, +col225 text, +col226 text, +col227 text, +col228 text +) ENGINE=InnoDB; + +set innodb_strict_mode = 1; +--error ER_TOO_BIG_ROWSIZE +alter table t1 engine=InnoDB; + +drop table t1; diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 0e4691658d5..2bf774ad039 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -42,6 +42,12 @@ UNIV_INTERN dict_index_t* dict_ind_compact; UNIV_INTERN uint ibuf_debug; #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ +/********************************************************************** +Issue a warning that the row is too big. */ +void +ib_warn_row_too_big(const dict_table_t* table); + + #ifndef UNIV_HOTBACKUP #include "buf0buf.h" #include "data0type.h" @@ -1765,11 +1771,18 @@ dict_index_add_to_cache( new_index->n_fields = new_index->n_def; - if (strict && dict_index_too_big_for_tree(table, new_index)) { + if (dict_index_too_big_for_tree(table, new_index)) { + + if (strict) { too_big: - dict_mem_index_free(new_index); - dict_mem_index_free(index); - return(DB_TOO_BIG_RECORD); + dict_mem_index_free(new_index); + dict_mem_index_free(index); + return(DB_TOO_BIG_RECORD); + } else { + + ib_warn_row_too_big(table); + + } } if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 8f299aed213..28f7c95d243 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12063,3 +12063,30 @@ innobase_convert_to_filename_charset( return(strconvert(cs_from, from, cs_to, to, len, &errors)); } + + +/********************************************************************** +Issue a warning that the row is too big. */ +extern "C" +void +ib_warn_row_too_big(const dict_table_t* table) +{ + /* If prefix is true then a 768-byte prefix is stored + locally for BLOB fields. Refer to dict_table_get_format() */ + const bool prefix = ((table->flags & DICT_TF_FORMAT_MASK) + >> DICT_TF_FORMAT_SHIFT) < UNIV_FORMAT_B; + + const ulint free_space = page_get_free_space_of_empty( + table->flags & DICT_TF_COMPACT) / 2; + + THD* thd = current_thd; + + push_warning_printf( + thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW, + "Row size too large (> %lu). Changing some columns to TEXT" + " or BLOB %smay help. In current row format, BLOB prefix of" + " %d bytes is stored inline.", free_space + , prefix ? "or using ROW_FORMAT=DYNAMIC or" + " ROW_FORMAT=COMPRESSED ": "" + , prefix ? DICT_MAX_FIXED_COL_LEN : 0); +} From b8c9d93bf3ebf69243e38ce77fd9fdc256913af6 Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Thu, 18 Sep 2014 15:17:39 +0530 Subject: [PATCH 016/201] Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE CALLED FROM A FUNCTION Scenario: In a stored procedure, CREATE TABLE statement is not allowed. But an exception is provided for CREATE TEMPORARY TABLE. We can create a temporary table in a stored procedure. Let there be two stored functions f1 and f2 and two stored procedures p1 and p2. Their properties are as follows: . stored function f1() calls stored procedure p1(). . stored function f2() calls stored procedure p2(). . stored procedure p1() creates temporary table t1. . stored procedure p2() does DML on t1. Consider the following situation: 1. Autocommit mode is on. 2. select f1() 3. select f2() Step 2: In this step, t1 would be created via p1(). A table level transaction lock would have been taken. The ::external_lock() would not have been called on this table. At the end of step 2, because of autocommit mode on, this table level lock will be released. Step 3: When we execute DML on table t1 via p2() we have two problems: Problem 1: The function ha_innobase::external_lock() would have been called but since it is a select query no table level locks would have been taken. Hence the following assert will fail: ut_ad(lock_table_has(thr_get_trx(thr), index->table, LOCK_IX)); Solution: The solution would be to identify this situation and take a table level lock and use the proper lock type prebuilt->select_lock_type = LOCK_X for DML operations. Problem 2: Another problem is that in step 3, ha_innobase::open() is never called on the table t1. Solution: The solution would be to identify this situation and call re-init the handler of table t1. rb#6429 approved by Krunal. --- .../suite/innodb/r/sp_temp_table.result | 253 ++++++++++++++++++ mysql-test/suite/innodb/t/sp_temp_table.test | 103 +++++++ storage/innobase/handler/ha_innodb.cc | 25 +- storage/innobase/include/dict0dict.h | 8 + storage/innobase/include/dict0dict.ic | 12 + storage/innobase/row/row0mysql.c | 9 +- 6 files changed, 406 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/innodb/r/sp_temp_table.result create mode 100644 mysql-test/suite/innodb/t/sp_temp_table.test diff --git a/mysql-test/suite/innodb/r/sp_temp_table.result b/mysql-test/suite/innodb/r/sp_temp_table.result new file mode 100644 index 00000000000..49a2a4aa831 --- /dev/null +++ b/mysql-test/suite/innodb/r/sp_temp_table.result @@ -0,0 +1,253 @@ +# +# Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE +# CALLED FROM A FUNCTION +# +call mtr.add_suppression("MySQL is trying to drop table"); +CREATE PROCEDURE cachedata( +IN obj_id BIGINT UNSIGNED, +IN start DATETIME, +IN end DATETIME +) +cachedata:BEGIN +DECLARE cache_count BIGINT; +SET @timestamp := NOW(); +CREATE TEMPORARY TABLE IF NOT EXISTS cachedata ( +timestamp DATETIME, +object_id BIGINT UNSIGNED NOT NULL, +start DATETIME, +end DATETIME, +seqno BIGINT AUTO_INCREMENT, +value FLOAT, +PRIMARY KEY (seqno), +INDEX (timestamp), +INDEX (object_id, start, end) +) ENGINE=INNODB; +DELETE FROM cachedata WHERE +timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND); +SELECT count(*) INTO cache_count FROM cachedata WHERE +object_id = obj_id +AND start = start +AND end = end; +IF cache_count > 0 THEN LEAVE cachedata; +END IF; +INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 2345), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 2345), +(@timestamp, obj_id, start, end, 1234), +(@timestamp, obj_id, start, end, 4567), +(@timestamp, obj_id, start, end, 8901), +(@timestamp, obj_id, start, end, 2345); +END$$ +CREATE FUNCTION get_cache( +obj_id BIGINT UNSIGNED, +start DATETIME, +end DATETIME +) +RETURNS FLOAT +READS SQL DATA +BEGIN +DECLARE result FLOAT; +CALL cachedata(obj_id, start, end); +SELECT SUM(value) INTO result FROM cachedata WHERE +object_id = obj_id +AND start = start +AND end = end; +RETURN result; +END$$ +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +SELECT get_cache(1, '2014-01-01', '2014-02-01'); +get_cache(1, '2014-01-01', '2014-02-01') +95247 +select sleep(1); +sleep(1) +0 +DROP FUNCTION get_cache; +DROP PROCEDURE cachedata; diff --git a/mysql-test/suite/innodb/t/sp_temp_table.test b/mysql-test/suite/innodb/t/sp_temp_table.test new file mode 100644 index 00000000000..b2883f551b9 --- /dev/null +++ b/mysql-test/suite/innodb/t/sp_temp_table.test @@ -0,0 +1,103 @@ +--source include/have_innodb.inc +--source include/big_test.inc + +--echo # +--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE +--echo # CALLED FROM A FUNCTION +--echo # + +call mtr.add_suppression("MySQL is trying to drop table"); + +DELIMITER $$; +CREATE PROCEDURE cachedata( + IN obj_id BIGINT UNSIGNED, + IN start DATETIME, + IN end DATETIME +) + +cachedata:BEGIN + DECLARE cache_count BIGINT; + + SET @timestamp := NOW(); + + CREATE TEMPORARY TABLE IF NOT EXISTS cachedata ( + timestamp DATETIME, + object_id BIGINT UNSIGNED NOT NULL, + start DATETIME, + end DATETIME, + seqno BIGINT AUTO_INCREMENT, + value FLOAT, + PRIMARY KEY (seqno), + INDEX (timestamp), + INDEX (object_id, start, end) + ) ENGINE=INNODB; + + DELETE FROM cachedata WHERE + timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND); + + SELECT count(*) INTO cache_count FROM cachedata WHERE + object_id = obj_id + AND start = start + AND end = end; + + IF cache_count > 0 THEN LEAVE cachedata; + END IF; + + INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 2345), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 2345), + (@timestamp, obj_id, start, end, 1234), + (@timestamp, obj_id, start, end, 4567), + (@timestamp, obj_id, start, end, 8901), + (@timestamp, obj_id, start, end, 2345); + +END$$ + + +CREATE FUNCTION get_cache( + obj_id BIGINT UNSIGNED, + start DATETIME, + end DATETIME +) + RETURNS FLOAT + READS SQL DATA +BEGIN + DECLARE result FLOAT; + + CALL cachedata(obj_id, start, end); + + SELECT SUM(value) INTO result FROM cachedata WHERE + object_id = obj_id + AND start = start + AND end = end; + + RETURN result; +END$$ + +DELIMITER ;$$ + +let $i = 30; +while ($i) +{ + SELECT get_cache(1, '2014-01-01', '2014-02-01'); + select sleep(1); + dec $i; +} + +DROP FUNCTION get_cache; +DROP PROCEDURE cachedata; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 28f7c95d243..137a89dc9de 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9173,6 +9173,7 @@ ha_innobase::start_stmt( thr_lock_type lock_type) { trx_t* trx; + DBUG_ENTER("ha_innobase::start_stmt"); update_thd(thd); @@ -9195,6 +9196,28 @@ ha_innobase::start_stmt( prebuilt->hint_need_to_fetch_extra_cols = 0; reset_template(prebuilt); + if (dict_table_is_temporary(prebuilt->table) + && prebuilt->mysql_has_locked + && prebuilt->select_lock_type == LOCK_NONE) { + ulint error; + + switch (thd_sql_command(thd)) { + case SQLCOM_INSERT: + case SQLCOM_UPDATE: + case SQLCOM_DELETE: + init_table_handle_for_HANDLER(); + prebuilt->select_lock_type = LOCK_X; + error = row_lock_table_for_mysql(prebuilt, NULL, 1); + + if (error != DB_SUCCESS) { + error = convert_error_code_to_mysql( + (int) error, 0, thd); + DBUG_RETURN((int) error); + } + break; + } + } + if (!prebuilt->mysql_has_locked) { /* This handle is for a temporary table created inside this same LOCK TABLES; since MySQL does NOT call external_lock @@ -9227,7 +9250,7 @@ ha_innobase::start_stmt( innobase_register_trx(ht, thd, trx); - return(0); + DBUG_RETURN(0); } /******************************************************************//** diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 254d4e149ca..003639d55b5 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1367,6 +1367,14 @@ dict_table_init_referenced_rbt( /*===========================*/ dict_table_t* table); /*!< in: the table object whose table->referenced_rbt will be initialized */ +/********************************************************************//** +Check if it is a temporary table. +@return true if temporary table flag is set. */ +UNIV_INLINE +ibool +dict_table_is_temporary( +/*====================*/ + const dict_table_t* table); /*!< in: table to check */ #ifndef UNIV_NONINL #include "dict0dict.ic" diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index a63e1d16427..b65cae2a1d8 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1004,3 +1004,15 @@ dict_table_init_referenced_rbt( ut_a(table->referenced_rbt != NULL); return(table->referenced_rbt); } + +/********************************************************************//** +Check if it is a temporary table. +@return true if temporary table flag is set. */ +UNIV_INLINE +ibool +dict_table_is_temporary( +/*====================*/ + const dict_table_t* table) /*!< in: table to check */ +{ + return(table->flags & (DICT_TF2_TEMPORARY << DICT_TF2_SHIFT)); +} diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 8555054b86f..181ca966451 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2014, 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 @@ -3089,6 +3089,9 @@ row_drop_table_for_mysql( ulint namelen; ibool locked_dictionary = FALSE; pars_info_t* info = NULL; + DBUG_ENTER("row_drop_table_for_mysql"); + + DBUG_PRINT("row_drop_table_for_mysql", ("table: %s", name)); ut_a(name != NULL); @@ -3099,7 +3102,7 @@ row_drop_table_for_mysql( "InnoDB: Shut down mysqld and edit my.cnf so that newraw" " is replaced with raw.\n", stderr); - return(DB_ERROR); + DBUG_RETURN(DB_ERROR); } trx->op_info = "dropping table"; @@ -3504,7 +3507,7 @@ funct_exit: srv_wake_master_thread(); - return((int) err); + DBUG_RETURN((int) err); } /*********************************************************************//** From cdb8e6ed38ce641a6cb90a4a93bc5ff15f3ba9f2 Mon Sep 17 00:00:00 2001 From: Bill Qu Date: Wed, 24 Sep 2014 09:44:48 +0800 Subject: [PATCH 017/201] Bug #15868071 USING SET GLOBAL SQL_LOG_BIN SHOULD NOT BE ALLOWED Normally, SET SESSION SQL_LOG_BIN is used by DBAs to run a non-conflicting command locally only, ensuring it does not get replicated. Setting GLOBAL SQL_LOG_BIN would not require all sessions to disconnect. When SQL_LOG_BIN is changed globally, it does not immediately take effect for any sessions. It takes effect by becoming the session-level default inherited at the start of each new session, and this setting is kept and cached for the duration of that session. Setting it intentionally is unlikely to have a useful effect under any circumstance; setting it unintentionally, such as while intending to use SET [SESSION] is potentially disastrous. Accidentally using SET GLOBAL SQL_LOG_BIN will not show an immediate effect to the user, instead not having the desired session-level effect, and thus causing other potential problems with local-only maintenance being binlogged and executed on slaves; And transactions from new sessions (after SQL_LOG_BIN is changed globally) are not binlogged and replicated, which would result in irrecoverable or difficult data loss. This is the regular GLOBAL variables way to work, but in replication context it does not look right on a working server (with connected sessions) 'set global sql_log_bin' and none of that connections is affected. Unexperienced DBA after noticing that the command did "nothing" will change the session var and most probably won't unset the global var, causing new sessions to not be binlog. Setting GLOBAL SQL_LOG_BIN allows DBA to stop binlogging on all new sessions, which can be used to make a server "replication read-only" without restarting the server. But this has such big requirements, stop all existing connections, that it is more likely to make a mess, it is too risky to allow the GLOBAL variable. The statement 'SET GLOBAL SQL_LOG_BIN=N' will produce an error in 5.5, 5.6 and 5.7. Reading the GLOBAL SQL_LOG_BIN will produce a deprecation warning in 5.7. --- .../r/binlog_switch_inside_trans.result | 8 +------ mysql-test/suite/binlog/t/binlog_grant.test | 2 +- .../binlog/t/binlog_switch_inside_trans.test | 6 +---- .../suite/sys_vars/r/sql_log_bin_basic.result | 9 ++++++-- .../suite/sys_vars/t/sql_log_bin_basic.test | 6 ++++- sql/sys_vars.cc | 22 +++++++++---------- 6 files changed, 26 insertions(+), 27 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result b/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result index 48b6dfa61d9..0819d4e778f 100644 --- a/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result +++ b/mysql-test/suite/binlog/r/binlog_switch_inside_trans.result @@ -1,6 +1,5 @@ set @save_binlog_format= @@global.binlog_format; set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; -set @save_sql_log_bin= @@global.sql_log_bin; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; SELECT @@session.binlog_format; @@ -129,7 +128,7 @@ commit; begin; insert into t2 values (5); # Test that the global variable 'binlog_format' and -# 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are +# 'binlog_direct_non_transactional_updates' are # writable inside a transaction. # Current session values are ROW, FALSE, TRUE respectively. SELECT @@global.binlog_format; @@ -137,20 +136,15 @@ SELECT @@global.binlog_format; ROW set @@global.binlog_format= statement; set @@global.binlog_direct_non_transactional_updates= TRUE; -set @@global.sql_log_bin= FALSE; SELECT @@global.binlog_format; @@global.binlog_format STATEMENT SELECT @@global.binlog_direct_non_transactional_updates; @@global.binlog_direct_non_transactional_updates 1 -SELECT @@global.sql_log_bin; -@@global.sql_log_bin -0 commit; set @@global.binlog_format= @save_binlog_format; set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; -set @@global.sql_log_bin= @save_sql_log_bin; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; create table t5(a int) engine= innodb; diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test index f0367b3aa79..0c9d9a45ec9 100644 --- a/mysql-test/suite/binlog/t/binlog_grant.test +++ b/mysql-test/suite/binlog/t/binlog_grant.test @@ -15,7 +15,7 @@ show grants for mysqltest_1@localhost; connect (plain,localhost,mysqltest_1,,test); connect (root,localhost,root,,test); -# Testing setting both session and global SQL_LOG_BIN variable both as +# Testing setting session SQL_LOG_BIN variable both as # root and as plain user. --echo **** Variable SQL_LOG_BIN **** diff --git a/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test b/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test index 06c5e78bd0e..a93cd44fa17 100644 --- a/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test +++ b/mysql-test/suite/binlog/t/binlog_switch_inside_trans.test @@ -10,7 +10,6 @@ source include/have_binlog_format_row.inc; set @save_binlog_format= @@global.binlog_format; set @save_binlog_dirct= @@global.binlog_direct_non_transactional_updates; -set @save_sql_log_bin= @@global.sql_log_bin; create table t1 (a int) engine= myisam; create table t2 (a int) engine= innodb; @@ -117,21 +116,18 @@ commit; begin; insert into t2 values (5); --echo # Test that the global variable 'binlog_format' and ---echo # 'binlog_direct_non_transactional_updates' and 'sql_log_bin' are +--echo # 'binlog_direct_non_transactional_updates' are --echo # writable inside a transaction. --echo # Current session values are ROW, FALSE, TRUE respectively. SELECT @@global.binlog_format; set @@global.binlog_format= statement; set @@global.binlog_direct_non_transactional_updates= TRUE; - set @@global.sql_log_bin= FALSE; SELECT @@global.binlog_format; SELECT @@global.binlog_direct_non_transactional_updates; - SELECT @@global.sql_log_bin; commit; set @@global.binlog_format= @save_binlog_format; set @@global.binlog_direct_non_transactional_updates= @save_binlog_dirct; -set @@global.sql_log_bin= @save_sql_log_bin; create table t3(a int, b int) engine= innodb; create table t4(a int) engine= innodb; diff --git a/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result index 5e8fe4e02f7..7d9ef4f76ed 100644 --- a/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_log_bin_basic.result @@ -57,11 +57,16 @@ ERROR 42000: Variable 'sql_log_bin' can't be set to the value of ' SET @@session.sql_log_bin = NO; ERROR 42000: Variable 'sql_log_bin' can't be set to the value of 'NO' '#-------------------FN_DYNVARS_156_05----------------------------#' -SET @@global.sql_log_bin = 0; SELECT @@global.sql_log_bin; @@global.sql_log_bin -0 +1 +SET @@global.sql_log_bin = 0; +ERROR 42000: Variable 'sql_log_bin' can't be set to the value of '0' +SELECT @@global.sql_log_bin; +@@global.sql_log_bin +1 SET @@global.sql_log_bin = 1; +ERROR 42000: Variable 'sql_log_bin' can't be set to the value of '1' '#----------------------FN_DYNVARS_156_06------------------------#' SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_log_bin'; count(VARIABLE_VALUE) diff --git a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test index 153a0be0b8f..1e697e72221 100644 --- a/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test +++ b/mysql-test/suite/sys_vars/t/sql_log_bin_basic.test @@ -109,11 +109,15 @@ SET @@session.sql_log_bin = NO; --echo '#-------------------FN_DYNVARS_156_05----------------------------#' ########################################################################### -# Test if accessing global sql_log_bin gives error # +# Test if setting global sql_log_bin gives error, # +# and there is no error on reading it. # ########################################################################### +SELECT @@global.sql_log_bin; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_log_bin = 0; SELECT @@global.sql_log_bin; +--Error ER_WRONG_VALUE_FOR_VAR SET @@global.sql_log_bin = 1; --echo '#----------------------FN_DYNVARS_156_06------------------------#' diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 3cb72480341..e826624b42f 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2447,13 +2447,13 @@ static Sys_var_bit Sys_log_off( static bool fix_sql_log_bin_after_update(sys_var *self, THD *thd, enum_var_type type) { - if (type == OPT_SESSION) - { - if (thd->variables.sql_log_bin) - thd->variables.option_bits |= OPTION_BIN_LOG; - else - thd->variables.option_bits &= ~OPTION_BIN_LOG; - } + DBUG_ASSERT(type == OPT_SESSION); + + if (thd->variables.sql_log_bin) + thd->variables.option_bits |= OPTION_BIN_LOG; + else + thd->variables.option_bits &= ~OPTION_BIN_LOG; + return FALSE; } @@ -2475,7 +2475,7 @@ static bool check_sql_log_bin(sys_var *self, THD *thd, set_var *var) return TRUE; if (var->type == OPT_GLOBAL) - return FALSE; + return TRUE; /* If in a stored function/trigger, it's too late to change sql_log_bin. */ if (thd->in_sub_stmt) @@ -2494,9 +2494,9 @@ static bool check_sql_log_bin(sys_var *self, THD *thd, set_var *var) } static Sys_var_mybool Sys_log_binlog( - "sql_log_bin", "sql_log_bin", - SESSION_VAR(sql_log_bin), NO_CMD_LINE, - DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_sql_log_bin), + "sql_log_bin", "Controls whether logging to the binary log is done", + SESSION_VAR(sql_log_bin), NO_CMD_LINE, DEFAULT(TRUE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_sql_log_bin), ON_UPDATE(fix_sql_log_bin_after_update)); static Sys_var_bit Sys_sql_warnings( From f44113583caa0c439649f613fe16216e67283fc3 Mon Sep 17 00:00:00 2001 From: Sayantan Dutta Date: Fri, 26 Sep 2014 11:50:07 +0530 Subject: [PATCH 018/201] Bug #18964545 - ADD MTR SUPPORT FOR DEBUGGING WITH LLDB revert --- mysql-test/mysql-test-run.pl | 51 +++++------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 472dc91ea69..7ddde593503 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -223,11 +223,8 @@ our %gprof_dirs; our $glob_debugger= 0; our $opt_gdb; -our $opt_lldb; our $opt_client_gdb; -our $opt_client_lldb; my $opt_boot_gdb; -my $opt_boot_lldb; our $opt_dbx; our $opt_client_dbx; my $opt_boot_dbx; @@ -1088,13 +1085,10 @@ sub command_line_setup { 'debug-common' => \$opt_debug_common, 'debug-server' => \$opt_debug_server, 'gdb' => \$opt_gdb, - 'lldb' => \$opt_lldb, 'client-gdb' => \$opt_client_gdb, - 'client-lldb' => \$opt_client_lldb, 'manual-gdb' => \$opt_manual_gdb, 'manual-lldb' => \$opt_manual_lldb, 'boot-gdb' => \$opt_boot_gdb, - 'boot-lldb' => \$opt_boot_lldb, 'manual-debug' => \$opt_manual_debug, 'ddd' => \$opt_ddd, 'client-ddd' => \$opt_client_ddd, @@ -1524,13 +1518,6 @@ sub command_line_setup { $opt_gdb= undef; } - if ($opt_lldb) - { - mtr_warning("Silently converting --lldb to --client-lldb in embedded mode"); - $opt_client_lldb= $opt_lldb; - $opt_lldb= undef; - } - if ($opt_ddd) { mtr_warning("Silently converting --ddd to --client-ddd in embedded mode"); @@ -1551,7 +1538,7 @@ sub command_line_setup { $opt_debugger= undef; } - if ( $opt_gdb || $opt_ddd || $opt_lldb || $opt_manual_gdb || $opt_manual_lldb || + if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd || $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx) { @@ -1579,10 +1566,10 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Check debug related options # -------------------------------------------------------------------------- - if ( $opt_gdb || $opt_client_gdb || $opt_lldb || $opt_client_lldb || - $opt_ddd || $opt_client_ddd || $opt_manual_gdb || $opt_manual_gdb || - $opt_manual_ddd || $opt_manual_debug || $opt_dbx || $opt_client_dbx || - $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) + if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || + $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd || + $opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx || + $opt_debugger || $opt_client_debugger ) { # Indicate that we are using debugger $glob_debugger= 1; @@ -3341,10 +3328,6 @@ sub mysql_install_db { gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), $bootstrap_sql_file); } - if ($opt_boot_lldb) { - lldb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), - $bootstrap_sql_file); - } if ($opt_boot_dbx) { dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(), $bootstrap_sql_file); @@ -5005,7 +4988,7 @@ sub mysqld_start ($$) { { gdb_arguments(\$args, \$exe, $mysqld->name()); } - elsif ( $opt_lldb || $opt_manual_lldb ) + elsif ( $opt_manual_lldb ) { lldb_arguments(\$args, \$exe, $mysqld->name()); } @@ -5676,10 +5659,6 @@ sub start_mysqltest ($) { { gdb_arguments(\$args, \$exe, "client"); } - if ( $opt_client_lldb ) - { - lldb_arguments(\$args, \$exe, "client"); - } elsif ( $opt_client_ddd ) { ddd_arguments(\$args, \$exe, "client"); @@ -5793,30 +5772,12 @@ sub lldb_arguments { "b main\n" . $runline); - if ( $opt_manual_ddd ) - { print "\nTo start lldb for $type, type in another window:\n"; print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; # Indicate the exe should not be started $$exe= undef; return; - } - - my $save_exe= $$exe; - $$args= []; - if ( $exe_libtool ) - { - $$exe= $exe_libtool; - mtr_add_arg($$args, "--mode=execute"); - mtr_add_arg($$args, "lldb"); - } - else - { - $$exe= "lldb"; - } - mtr_add_arg($$args, "--command=$lldb_init_file"); - mtr_add_arg($$args, "$save_exe"); } # From 911587287fb341cdba9efbed7c66f3891f0efd63 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Mon, 29 Sep 2014 10:17:38 +0200 Subject: [PATCH 019/201] Bug#19695101 UPGRADE YASSL TO 2.3.5 --- extra/yassl/README | 9 +++++++++ extra/yassl/include/openssl/ssl.h | 2 +- extra/yassl/taocrypt/src/rsa.cpp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/extra/yassl/README b/extra/yassl/README index b18e2baeea8..30c7af4a702 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -12,6 +12,15 @@ before calling SSL_new(); *** end Note *** +yaSSL Release notes, version 2.3.5 (9/29/2014) + + This release of yaSSL fixes an RSA Padding check vulnerability reported by + Intel Security Advanced Threat Research team + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0 and note in 1.5.8. + + yaSSL Release notes, version 2.3.4 (8/15/2014) This release of yaSSL adds checking to the input_buffer class itself. diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 993822d0ab0..e678c600fed 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -35,7 +35,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.4" +#define YASSL_VERSION "2.3.5" #if defined(__cplusplus) diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp index 69c59402e48..79a8a8f1c4f 100644 --- a/extra/yassl/taocrypt/src/rsa.cpp +++ b/extra/yassl/taocrypt/src/rsa.cpp @@ -177,7 +177,7 @@ word32 RSA_BlockType1::UnPad(const byte* pkcsBlock, word32 pkcsBlockLen, // skip past the padding until we find the separator unsigned i=1; - while (i Date: Thu, 2 Oct 2014 15:58:02 +0200 Subject: [PATCH 020/201] Bug#19553099 EXPIRE_LOGS_DAYS=1 CRASH MYSQLD DURING RESTART, DBUG_SYNC(NULL, ...) - Restarting mysqld with --expire-log-days=1 triggers 'log_in_use()' to be called while current_thd is NULL. - Check current_thd before calling DEBUG_SYNC() to avoid passing NULL pointer to DEBUG_SYNC() - Wrap debug code construct inside #ifndef DBUG_OFF like in other parts of the file --- sql/sql_repl.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 343e128af7a..8bbb8c52d95 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -248,7 +248,10 @@ bool log_in_use(const char* log_name) size_t log_name_len = strlen(log_name) + 1; THD *tmp; bool result = 0; - DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count"); +#ifndef BDUG_OFF + if (current_thd) + DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count"); +#endif mysql_mutex_lock(&LOCK_thread_count); I_List_iterator it(threads); From 27938d14bb5a0313f13e99556d051f3df13d4237 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 6 Oct 2014 12:54:53 +0200 Subject: [PATCH 021/201] Create .gitignore as a copy of .bzrignore --- .gitignore | 3071 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3071 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..4012ee96751 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3071 @@ +*-t +*.Plo +*.Po +*.a +*.bb +*.bbg +*.bin +*.cdf +*.core +*.d +*.da +*.dir +*.dll +*.dylib +*.exe +*.exp +*.gcda +*.gcno +*.gcov +*.idb +*.ilk +*.la +*.lai +*.lib +*.lo +*.manifest +*.map +*.o +*.obj +*.old +*.pch +*.pdb +*.reject +*.res +*.rule +*.sbr +*.so +*.so.* +*.spec +*.user +*.vcproj +*.vcproj.cmake +*.vcxproj +*.vcxproj.filters +*/*.dir/* +Debug +MySql.sdf +Win32 +*/*_pure_*warnings +*/.deps +*/.libs/* +*/.pure +*/debug/* +*/minsizerel/* +*/release/* +RelWithDebInfo +*~ +.*.swp +./CMakeCache.txt +./MySql.ncb +./MySql.sln +./MySql.suo +./README.build-files +./cmakecache.txt +./config.h +./copy_mysql_files.bat +./fix-project-files +./mysql*.ds? +./mysql.ncb +./mysql.sln +./mysql.suo +./prepare +.DS_Store +.defs.mk +.depend +.depend.mk +.deps +.gdb_history +.gdbinit +.libs +.o +.out +.snprj/* +.vimrc +50 +=6 +BUILD/compile-pentium-maintainer +BitKeeper/etc/RESYNC_TREE +BitKeeper/etc/config +BitKeeper/etc/csets +BitKeeper/etc/csets-in +BitKeeper/etc/csets-out +BitKeeper/etc/gone +BitKeeper/etc/level +BitKeeper/etc/pushed +BitKeeper/post-commit +BitKeeper/post-commit-manual +BitKeeper/tmp/* +BitKeeper/tmp/bkr3sAHD +BitKeeper/tmp/gone +CMakeFiles +CMakeFiles/* +CTestTestfile.cmake +COPYING +COPYING.LIB +Docs/#manual.texi# +Docs/INSTALL-BINARY +Docs/Images/myaccess-odbc.txt +Docs/Images/myaccess.txt +Docs/Images/myarchitecture.txt +Docs/Images/mydll-properties.txt +Docs/Images/mydsn-example.txt +Docs/Images/mydsn-icon.txt +Docs/Images/mydsn-options.txt +Docs/Images/mydsn-setup.txt +Docs/Images/mydsn-test-fail.txt +Docs/Images/mydsn-test-success.txt +Docs/Images/mydsn-trace.txt +Docs/Images/mydsn.txt +Docs/Images/myflowchart.txt +Docs/include.texi +Docs/internals.html +Docs/internals.info +Docs/internals.pdf +Docs/internals.txt +Docs/internals_toc.html +Docs/manual.aux +Docs/manual.cp +Docs/manual.cps +Docs/manual.de.log +Docs/manual.dvi +Docs/manual.fn +Docs/manual.fns +Docs/manual.html +Docs/manual.ky +Docs/manual.log +Docs/manual.pdf +Docs/manual.pg +Docs/manual.texi.orig +Docs/manual.texi.rej +Docs/manual.toc +Docs/manual.tp +Docs/manual.txt +Docs/manual.vr +Docs/manual_a4.ps +Docs/manual_letter.ps +Docs/manual_toc.html +Docs/my_sys.doc +Docs/mysql.info +Docs/mysql.xml +Docs/safe-mysql.xml +Docs/tex.fmt +Docs/texi2dvi.out +EXCEPTIONS-CLIENT +INSTALL-SOURCE +INSTALL-WIN-SOURCE +Logs/* +MIRRORS +Makefile +Makefile.in +Makefile.in' +PENDING/* +scripts/scripts +TAGS +VC++Files/client/mysql_amd64.dsp +ac_available_languages_fragment +acinclude.m4 +aclocal.m4 +analyse.test +autom4te-2.53.cache/* +autom4te-2.53.cache/output.0 +autom4te-2.53.cache/requests +autom4te-2.53.cache/traces.0 +autom4te.cache/* +autom4te.cache/output.0 +autom4te.cache/requests +autom4te.cache/traces.0 +bdb/*.ds? +bdb/*.vcproj +bdb/README +bdb/btree/btree_auto.c +bdb/build_unix/* +bdb/build_vxworks/db.h +bdb/build_vxworks/db_int.h +bdb/build_win32/db.h +bdb/build_win32/db_archive.dsp +bdb/build_win32/db_checkpoint.dsp +bdb/build_win32/db_config.h +bdb/build_win32/db_cxx.h +bdb/build_win32/db_deadlock.dsp +bdb/build_win32/db_dll.dsp +bdb/build_win32/db_dump.dsp +bdb/build_win32/db_int.h +bdb/build_win32/db_java.dsp +bdb/build_win32/db_load.dsp +bdb/build_win32/db_perf.dsp +bdb/build_win32/db_printlog.dsp +bdb/build_win32/db_recover.dsp +bdb/build_win32/db_stat.dsp +bdb/build_win32/db_static.dsp +bdb/build_win32/db_tcl.dsp +bdb/build_win32/db_test.dsp +bdb/build_win32/db_upgrade.dsp +bdb/build_win32/db_verify.dsp +bdb/build_win32/ex_access.dsp +bdb/build_win32/ex_btrec.dsp +bdb/build_win32/ex_env.dsp +bdb/build_win32/ex_lock.dsp +bdb/build_win32/ex_mpool.dsp +bdb/build_win32/ex_tpcb.dsp +bdb/build_win32/excxx_access.dsp +bdb/build_win32/excxx_btrec.dsp +bdb/build_win32/excxx_env.dsp +bdb/build_win32/excxx_lock.dsp +bdb/build_win32/excxx_mpool.dsp +bdb/build_win32/excxx_tpcb.dsp +bdb/build_win32/include.tcl +bdb/build_win32/libdb.def +bdb/build_win32/libdb.rc +bdb/db/crdel_auto.c +bdb/db/db_auto.c +bdb/dbinc_auto/*.* +bdb/dbreg/dbreg_auto.c +bdb/dist/autom4te-2.53.cache/* +bdb/dist/autom4te-2.53.cache/output.0 +bdb/dist/autom4te-2.53.cache/requests +bdb/dist/autom4te-2.53.cache/traces.0 +bdb/dist/autom4te.cache/* +bdb/dist/autom4te.cache/output.0 +bdb/dist/autom4te.cache/requests +bdb/dist/autom4te.cache/traces.0 +bdb/dist/config.hin +bdb/dist/configure +bdb/dist/db.h +bdb/dist/db_config.h +bdb/dist/db_cxx.h +bdb/dist/db_int.h +bdb/dist/include.tcl +bdb/dist/tags +bdb/dist/template/db_server_proc +bdb/dist/template/gen_client_ret +bdb/dist/template/rec_btree +bdb/dist/template/rec_crdel +bdb/dist/template/rec_db +bdb/dist/template/rec_dbreg +bdb/dist/template/rec_fileops +bdb/dist/template/rec_hash +bdb/dist/template/rec_log +bdb/dist/template/rec_qam +bdb/dist/template/rec_txn +bdb/examples_c/ex_apprec/ex_apprec_auto.c +bdb/examples_c/ex_apprec/ex_apprec_auto.h +bdb/examples_c/ex_apprec/ex_apprec_template +bdb/examples_java +bdb/fileops/fileops_auto.c +bdb/hash/hash_auto.c +bdb/include/btree_auto.h +bdb/include/btree_ext.h +bdb/include/clib_ext.h +bdb/include/common_ext.h +bdb/include/crdel_auto.h +bdb/include/db_auto.h +bdb/include/db_ext.h +bdb/include/db_server.h +bdb/include/env_ext.h +bdb/include/gen_client_ext.h +bdb/include/gen_server_ext.h +bdb/include/hash_auto.h +bdb/include/hash_ext.h +bdb/include/lock_ext.h +bdb/include/log_auto.h +bdb/include/log_ext.h +bdb/include/mp_ext.h +bdb/include/mutex_ext.h +bdb/include/os_ext.h +bdb/include/qam_auto.h +bdb/include/qam_ext.h +bdb/include/rpc_client_ext.h +bdb/include/rpc_server_ext.h +bdb/include/tcl_ext.h +bdb/include/txn_auto.h +bdb/include/txn_ext.h +bdb/include/xa_ext.h +bdb/java/src/com/sleepycat/db/Db.java +bdb/java/src/com/sleepycat/db/DbBtreeStat.java +bdb/java/src/com/sleepycat/db/DbConstants.java +bdb/java/src/com/sleepycat/db/DbHashStat.java +bdb/java/src/com/sleepycat/db/DbLockStat.java +bdb/java/src/com/sleepycat/db/DbLogStat.java +bdb/java/src/com/sleepycat/db/DbMpoolFStat.java +bdb/java/src/com/sleepycat/db/DbQueueStat.java +bdb/java/src/com/sleepycat/db/DbRepStat.java +bdb/java/src/com/sleepycat/db/DbTxnStat.java +bdb/libdb_java/java_stat_auto.c +bdb/libdb_java/java_stat_auto.h +bdb/log/log_auto.c +bdb/qam/qam_auto.c +bdb/rpc_client/db_server_clnt.c +bdb/rpc_client/gen_client.c +bdb/rpc_server/c/db_server_proc.c +bdb/rpc_server/c/db_server_proc.sed +bdb/rpc_server/c/db_server_svc.c +bdb/rpc_server/c/db_server_xdr.c +bdb/rpc_server/c/gen_db_server.c +bdb/rpc_server/db_server.x +bdb/rpc_server/db_server_proc.sed +bdb/rpc_server/db_server_svc.c +bdb/rpc_server/db_server_xdr.c +bdb/rpc_server/gen_db_server.c +bdb/test/TESTS +bdb/test/include.tcl +bdb/test/logtrack.list +bdb/txn/txn_auto.c +binary/* +bkpull.log +bkpull.log* +bkpull.log.2 +bkpull.log.3 +bkpull.log.4 +bkpull.log.5 +bkpull.log.6 +bkpush.log +bkpush.log* +build.log +build_tags.sh +client/#mysql.cc# +client/*.ds? +client/*.vcproj +client/.deps/base64.Po +client/.deps/completion_hash.Po +client/.deps/dummy.Po +client/.deps/mf_tempdir.Po +client/.deps/my_bit.Po +client/.deps/my_bitmap.Po +client/.deps/my_getsystime.Po +client/.deps/my_new.Po +client/.deps/my_user.Po +client/.deps/my_vle.Po +client/.deps/mysql.Po +client/.deps/mysql_upgrade.Po +client/.deps/mysqladmin.Po +client/.deps/mysqlbinlog.Po +client/.deps/mysqlcheck.Po +client/.deps/mysqldump.Po +client/.deps/mysqlimport.Po +client/.deps/mysqlshow.Po +client/.deps/mysqlslap.Po +client/.deps/mysqltest.Po +client/.deps/readline.Po +client/.deps/sql_string.Po +client/.libs -prune +client/.libs/lt-mysql +client/.libs/lt-mysqladmin +client/.libs/lt-mysqlbinlog +client/.libs/lt-mysqlcheck +client/.libs/lt-mysqldump +client/.libs/lt-mysqlimport +client/.libs/lt-mysqlshow +client/.libs/lt-mysqlslap +client/.libs/lt-mysqltest +client/.libs/mysql +client/.libs/mysql_upgrade +client/.libs/mysqladmin +client/.libs/mysqlbinlog +client/.libs/mysqlcheck +client/.libs/mysqldump +client/.libs/mysqlimport +client/.libs/mysqlshow +client/.libs/mysqlslap +client/.libs/mysqltest +client/completion_hash.cpp +client/decimal.c +client/insert_test +client/link_sources +client/log_event.cc +client/log_event.h +client/log_event_old.cc +client/log_event_old.h +client/mf_iocache.c +client/mf_iocache.cc +client/my_decimal.cc +client/my_decimal.h +client/my_user.c +client/mysql +client/mysql.cpp +client/mysql_upgrade +client/mysqladmin +client/mysqladmin.c +client/mysqladmin.cpp +client/mysqlbinlog +client/mysqlbinlog.cpp +client/mysqlcheck +client/mysqldump +client/mysqlimport +client/mysqlmanager-pwgen +client/mysqlmanagerc +client/mysqlshow +client/mysqlslap +client/mysqltest +client/mysqltestmanager-pwgen +client/mysqltestmanagerc +client/mysys_priv.h +client/readline.cpp +client/rpl_constants.h +client/rpl_record_old.cc +client/rpl_record_old.h +client/rpl_tblmap.h +client/rpl_tblmap.cc +client/rpl_utility.h +client/rpl_utility.cc +client/select_test +client/sql_const.h +client/sql_string.cpp +client/ssl_test +client/thimble +client/thread_test +client/tmp.diff +client_debug/* +client_release/* +client_test +cmake_install.cmake +cmd-line-utils/libedit/.deps/chared.Po +cmd-line-utils/libedit/.deps/common.Po +cmd-line-utils/libedit/.deps/el.Po +cmd-line-utils/libedit/.deps/emacs.Po +cmd-line-utils/libedit/.deps/fcns.Po +cmd-line-utils/libedit/.deps/fgetln.Po +cmd-line-utils/libedit/.deps/help.Po +cmd-line-utils/libedit/.deps/hist.Po +cmd-line-utils/libedit/.deps/history.Po +cmd-line-utils/libedit/.deps/key.Po +cmd-line-utils/libedit/.deps/map.Po +cmd-line-utils/libedit/.deps/parse.Po +cmd-line-utils/libedit/.deps/prompt.Po +cmd-line-utils/libedit/.deps/read.Po +cmd-line-utils/libedit/.deps/readline.Po +cmd-line-utils/libedit/.deps/refresh.Po +cmd-line-utils/libedit/.deps/search.Po +cmd-line-utils/libedit/.deps/sig.Po +cmd-line-utils/libedit/.deps/strlcat.Po +cmd-line-utils/libedit/.deps/strlcpy.Po +cmd-line-utils/libedit/.deps/term.Po +cmd-line-utils/libedit/.deps/tokenizer.Po +cmd-line-utils/libedit/.deps/tty.Po +cmd-line-utils/libedit/.deps/unvis.Po +cmd-line-utils/libedit/.deps/vi.Po +cmd-line-utils/libedit/.deps/vis.Po +cmd-line-utils/libedit/common.h +cmd-line-utils/libedit/makelist +cmd-line-utils/readline/.deps/bind.Po +cmd-line-utils/readline/.deps/callback.Po +cmd-line-utils/readline/.deps/compat.Po +cmd-line-utils/readline/.deps/complete.Po +cmd-line-utils/readline/.deps/display.Po +cmd-line-utils/readline/.deps/funmap.Po +cmd-line-utils/readline/.deps/histexpand.Po +cmd-line-utils/readline/.deps/histfile.Po +cmd-line-utils/readline/.deps/history.Po +cmd-line-utils/readline/.deps/histsearch.Po +cmd-line-utils/readline/.deps/input.Po +cmd-line-utils/readline/.deps/isearch.Po +cmd-line-utils/readline/.deps/keymaps.Po +cmd-line-utils/readline/.deps/kill.Po +cmd-line-utils/readline/.deps/macro.Po +cmd-line-utils/readline/.deps/mbutil.Po +cmd-line-utils/readline/.deps/misc.Po +cmd-line-utils/readline/.deps/nls.Po +cmd-line-utils/readline/.deps/parens.Po +cmd-line-utils/readline/.deps/readline.Po +cmd-line-utils/readline/.deps/rltty.Po +cmd-line-utils/readline/.deps/savestring.Po +cmd-line-utils/readline/.deps/search.Po +cmd-line-utils/readline/.deps/shell.Po +cmd-line-utils/readline/.deps/signals.Po +cmd-line-utils/readline/.deps/terminal.Po +cmd-line-utils/readline/.deps/text.Po +cmd-line-utils/readline/.deps/tilde.Po +cmd-line-utils/readline/.deps/undo.Po +cmd-line-utils/readline/.deps/util.Po +cmd-line-utils/readline/.deps/vi_mode.Po +cmd-line-utils/readline/.deps/xmalloc.Po +comon.h +comp_err/*.ds? +comp_err/*.vcproj +compile +config.cache +config.guess +config.h +config.h.in +config.log +config.status +config.sub +configure +configure.lineno +contrib/*.ds? +contrib/*.vcproj +core +core.* +cscope.in.out +cscope.out +cscope.po.out +db-*.*.* +dbug/*.ds? +dbug/*.vcproj +dbug/.deps/dbug.Po +dbug/.deps/dbug_analyze.Po +dbug/.deps/factorial.Po +dbug/.deps/my_main.Po +dbug/.deps/sanity.Po +dbug/dbug_analyze +dbug/example*.r +dbug/factorial +dbug/factorial.r +dbug/main.r +dbug/output*.r +dbug/user.ps +dbug/user.t +debian/control +debian/defs.mk +depcomp +emacs.h +examples/*.ds? +examples/*.vcproj +examples/udf_example/udf_example.def +extra/.deps/charset2html.Po +extra/.deps/comp_err.Po +extra/.deps/innochecksum.Po +extra/.deps/my_print_defaults.Po +extra/.deps/mysql_waitpid.Po +extra/.deps/perror.Po +extra/.deps/replace.Po +extra/.deps/resolve_stack_dump.Po +extra/.deps/resolveip.Po +extra/charset2html +extra/comp_err +extra/created_include_files +extra/innochecksum +extra/my_print_defaults +extra/mysql_install +extra/mysql_tzinfo_to_sql +extra/mysql_waitpid +extra/mysqld_ername.h +extra/mysqld_error.h +extra/perror +extra/replace +extra/resolve_stack_dump +extra/resolveip +extra/sql_state.h +extra/tztime.cc +extra/yassl/src/.deps/buffer.Plo +extra/yassl/src/.deps/cert_wrapper.Plo +extra/yassl/src/.deps/crypto_wrapper.Plo +extra/yassl/src/.deps/handshake.Plo +extra/yassl/src/.deps/lock.Plo +extra/yassl/src/.deps/log.Plo +extra/yassl/src/.deps/socket_wrapper.Plo +extra/yassl/src/.deps/ssl.Plo +extra/yassl/src/.deps/template_instnt.Plo +extra/yassl/src/.deps/timer.Plo +extra/yassl/src/.deps/yassl_error.Plo +extra/yassl/src/.deps/yassl_imp.Plo +extra/yassl/src/.deps/yassl_int.Plo +extra/yassl/taocrypt/benchmark/.deps/benchmark-benchmark.Po +extra/yassl/taocrypt/benchmark/benchmark +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aes.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aestables.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-algebra.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-arc4.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-asn.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-bftables.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-blowfish.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-coding.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-des.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dh.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dsa.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-file.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-hash.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-integer.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md2.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md4.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md5.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-misc.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-random.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-ripemd.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-rsa.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-sha.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-template_instnt.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-tftables.Plo +extra/yassl/taocrypt/src/.deps/libtaocrypt_la-twofish.Plo +extra/yassl/taocrypt/test/.deps/test-test.Po +extra/yassl/taocrypt/test/test +extra/yassl/testsuite/.deps/testsuite-client.Po +extra/yassl/testsuite/.deps/testsuite-echoclient.Po +extra/yassl/testsuite/.deps/testsuite-echoserver.Po +extra/yassl/testsuite/.deps/testsuite-server.Po +extra/yassl/testsuite/.deps/testsuite-test.Po +extra/yassl/testsuite/.deps/testsuite-testsuite.Po +extra/yassl/testsuite/testsuite +fcns.c +fcns.h +gdbinit +gmon.out +hardcopy.0 +heap/*.ds? +heap/*.vcproj +heap/hp_test1 +heap/hp_test2 +help +help.c +help.h +include/abi_check +include/check_abi +include/link_sources +include/my_config.h +include/my_global.h +include/mysql_h.ic +include/mysql_version.h +include/mysqld_ername.h +include/mysqld_error.h +include/mysqld_error.h.rule +include/openssl +include/probes_mysql_dtrace.h +include/readline +include/readline/*.h +include/readline/readline.h +include/sql_state.h +include/widec.h +innobase/*.ds? +innobase/*.vcproj +innobase/autom4te-2.53.cache/* +innobase/autom4te-2.53.cache/output.0 +innobase/autom4te-2.53.cache/requests +innobase/autom4te-2.53.cache/traces.0 +innobase/autom4te.cache/* +innobase/autom4te.cache/output.0 +innobase/autom4te.cache/requests +innobase/autom4te.cache/traces.0 +innobase/configure.lineno +innobase/conftest.s1 +innobase/conftest.subs +innobase/ib_config.h +innobase/ib_config.h.in +innobase/mkinstalldirs +innobase/stamp-h1 +insert_test +install +install-sh +isam/*.ds? +isam/*.vcproj +isam/isamchk +isam/isamlog +isam/pack_isam +isam/test1 +isam/test2 +isam/test3 +isamchk/*.ds? +isamchk/*.vcproj +item_xmlfunc.cc +lib_debug/* +lib_release/* +libmysql/*.c +libmysql/*.ds? +libmysql/*.vcproj +libmysql/.deps/array.Plo +libmysql/.deps/bchange.Plo +libmysql/.deps/bcmp.Plo +libmysql/.deps/bmove.Plo +libmysql/.deps/bmove_upp.Plo +libmysql/.deps/charset-def.Plo +libmysql/.deps/charset.Plo +libmysql/.deps/client.Plo +libmysql/.deps/conf_to_src.Po +libmysql/.deps/ctype-big5.Plo +libmysql/.deps/ctype-bin.Plo +libmysql/.deps/ctype-cp932.Plo +libmysql/.deps/ctype-czech.Plo +libmysql/.deps/ctype-euc_kr.Plo +libmysql/.deps/ctype-eucjpms.Plo +libmysql/.deps/ctype-extra.Plo +libmysql/.deps/ctype-gb2312.Plo +libmysql/.deps/ctype-gbk.Plo +libmysql/.deps/ctype-latin1.Plo +libmysql/.deps/ctype-mb.Plo +libmysql/.deps/ctype-simple.Plo +libmysql/.deps/ctype-sjis.Plo +libmysql/.deps/ctype-tis620.Plo +libmysql/.deps/ctype-uca.Plo +libmysql/.deps/ctype-ucs2.Plo +libmysql/.deps/ctype-ujis.Plo +libmysql/.deps/ctype-utf8.Plo +libmysql/.deps/ctype-win1250ch.Plo +libmysql/.deps/ctype.Plo +libmysql/.deps/dbug.Plo +libmysql/.deps/default.Plo +libmysql/.deps/default_modify.Plo +libmysql/.deps/errmsg.Plo +libmysql/.deps/errors.Plo +libmysql/.deps/get_password.Plo +libmysql/.deps/hash.Plo +libmysql/.deps/int2str.Plo +libmysql/.deps/is_prefix.Plo +libmysql/.deps/libmysql.Plo +libmysql/.deps/list.Plo +libmysql/.deps/llstr.Plo +libmysql/.deps/longlong2str.Plo +libmysql/.deps/manager.Plo +libmysql/.deps/md5.Plo +libmysql/.deps/mf_cache.Plo +libmysql/.deps/mf_dirname.Plo +libmysql/.deps/mf_fn_ext.Plo +libmysql/.deps/mf_format.Plo +libmysql/.deps/mf_iocache.Plo +libmysql/.deps/mf_iocache2.Plo +libmysql/.deps/mf_loadpath.Plo +libmysql/.deps/mf_pack.Plo +libmysql/.deps/mf_path.Plo +libmysql/.deps/mf_tempfile.Plo +libmysql/.deps/mf_unixpath.Plo +libmysql/.deps/mf_wcomp.Plo +libmysql/.deps/mulalloc.Plo +libmysql/.deps/my_alloc.Plo +libmysql/.deps/my_chsize.Plo +libmysql/.deps/my_compress.Plo +libmysql/.deps/my_create.Plo +libmysql/.deps/my_delete.Plo +libmysql/.deps/my_div.Plo +libmysql/.deps/my_error.Plo +libmysql/.deps/my_file.Plo +libmysql/.deps/my_fopen.Plo +libmysql/.deps/my_fstream.Plo +libmysql/.deps/my_gethostbyname.Plo +libmysql/.deps/my_getopt.Plo +libmysql/.deps/my_getwd.Plo +libmysql/.deps/my_init.Plo +libmysql/.deps/my_lib.Plo +libmysql/.deps/my_malloc.Plo +libmysql/.deps/my_messnc.Plo +libmysql/.deps/my_net.Plo +libmysql/.deps/my_once.Plo +libmysql/.deps/my_open.Plo +libmysql/.deps/my_port.Plo +libmysql/.deps/my_pread.Plo +libmysql/.deps/my_pthread.Plo +libmysql/.deps/my_read.Plo +libmysql/.deps/my_realloc.Plo +libmysql/.deps/my_rename.Plo +libmysql/.deps/my_seek.Plo +libmysql/.deps/my_sleep.Plo +libmysql/.deps/my_static.Plo +libmysql/.deps/my_strtoll10.Plo +libmysql/.deps/my_symlink.Plo +libmysql/.deps/my_thr_init.Plo +libmysql/.deps/my_time.Plo +libmysql/.deps/my_vsnprintf.Plo +libmysql/.deps/my_write.Plo +libmysql/.deps/net.Plo +libmysql/.deps/pack.Plo +libmysql/.deps/password.Plo +libmysql/.deps/safemalloc.Plo +libmysql/.deps/sha1.Plo +libmysql/.deps/str2int.Plo +libmysql/.deps/str_alloc.Plo +libmysql/.deps/strcend.Plo +libmysql/.deps/strcont.Plo +libmysql/.deps/strend.Plo +libmysql/.deps/strfill.Plo +libmysql/.deps/string.Plo +libmysql/.deps/strinstr.Plo +libmysql/.deps/strmake.Plo +libmysql/.deps/strmov.Plo +libmysql/.deps/strnlen.Plo +libmysql/.deps/strnmov.Plo +libmysql/.deps/strtod.Plo +libmysql/.deps/strtoll.Plo +libmysql/.deps/strtoull.Plo +libmysql/.deps/strxmov.Plo +libmysql/.deps/strxnmov.Plo +libmysql/.deps/thr_mutex.Plo +libmysql/.deps/typelib.Plo +libmysql/.deps/vio.Plo +libmysql/.deps/viosocket.Plo +libmysql/.deps/viossl.Plo +libmysql/.deps/viosslfactories.Plo +libmysql/.deps/xml.Plo +libmysql/.libs/libmysqlclient.lai +libmysql/.libs/libmysqlclient.so.15 +libmysql/.libs/libmysqlclient.so.15.0.0 +libmysql/conf_to_src +libmysql/debug/libmysql.exp +libmysql/libmysql.ver +libmysql/link_sources +libmysql/my_static.h +libmysql/my_time.c +libmysql/mysys_priv.h +libmysql/net.c +libmysql/release/libmysql.exp +libmysql/vio_priv.h +libmysql/viosocket.o.6WmSJk +libmysql_r/*.c +libmysql_r/.deps/array.Plo +libmysql_r/.deps/bchange.Plo +libmysql_r/.deps/bcmp.Plo +libmysql_r/.deps/bmove.Plo +libmysql_r/.deps/bmove_upp.Plo +libmysql_r/.deps/charset-def.Plo +libmysql_r/.deps/charset.Plo +libmysql_r/.deps/client.Plo +libmysql_r/.deps/conf_to_src.Po +libmysql_r/.deps/ctype-big5.Plo +libmysql_r/.deps/ctype-bin.Plo +libmysql_r/.deps/ctype-cp932.Plo +libmysql_r/.deps/ctype-czech.Plo +libmysql_r/.deps/ctype-euc_kr.Plo +libmysql_r/.deps/ctype-eucjpms.Plo +libmysql_r/.deps/ctype-extra.Plo +libmysql_r/.deps/ctype-gb2312.Plo +libmysql_r/.deps/ctype-gbk.Plo +libmysql_r/.deps/ctype-latin1.Plo +libmysql_r/.deps/ctype-mb.Plo +libmysql_r/.deps/ctype-simple.Plo +libmysql_r/.deps/ctype-sjis.Plo +libmysql_r/.deps/ctype-tis620.Plo +libmysql_r/.deps/ctype-uca.Plo +libmysql_r/.deps/ctype-ucs2.Plo +libmysql_r/.deps/ctype-ujis.Plo +libmysql_r/.deps/ctype-utf8.Plo +libmysql_r/.deps/ctype-win1250ch.Plo +libmysql_r/.deps/ctype.Plo +libmysql_r/.deps/dbug.Plo +libmysql_r/.deps/default.Plo +libmysql_r/.deps/default_modify.Plo +libmysql_r/.deps/errmsg.Plo +libmysql_r/.deps/errors.Plo +libmysql_r/.deps/get_password.Plo +libmysql_r/.deps/hash.Plo +libmysql_r/.deps/int2str.Plo +libmysql_r/.deps/is_prefix.Plo +libmysql_r/.deps/libmysql.Plo +libmysql_r/.deps/list.Plo +libmysql_r/.deps/llstr.Plo +libmysql_r/.deps/longlong2str.Plo +libmysql_r/.deps/manager.Plo +libmysql_r/.deps/md5.Plo +libmysql_r/.deps/mf_cache.Plo +libmysql_r/.deps/mf_dirname.Plo +libmysql_r/.deps/mf_fn_ext.Plo +libmysql_r/.deps/mf_format.Plo +libmysql_r/.deps/mf_iocache.Plo +libmysql_r/.deps/mf_iocache2.Plo +libmysql_r/.deps/mf_loadpath.Plo +libmysql_r/.deps/mf_pack.Plo +libmysql_r/.deps/mf_path.Plo +libmysql_r/.deps/mf_tempfile.Plo +libmysql_r/.deps/mf_unixpath.Plo +libmysql_r/.deps/mf_wcomp.Plo +libmysql_r/.deps/mulalloc.Plo +libmysql_r/.deps/my_alloc.Plo +libmysql_r/.deps/my_chsize.Plo +libmysql_r/.deps/my_compress.Plo +libmysql_r/.deps/my_create.Plo +libmysql_r/.deps/my_delete.Plo +libmysql_r/.deps/my_div.Plo +libmysql_r/.deps/my_error.Plo +libmysql_r/.deps/my_file.Plo +libmysql_r/.deps/my_fopen.Plo +libmysql_r/.deps/my_fstream.Plo +libmysql_r/.deps/my_gethostbyname.Plo +libmysql_r/.deps/my_getopt.Plo +libmysql_r/.deps/my_getwd.Plo +libmysql_r/.deps/my_init.Plo +libmysql_r/.deps/my_lib.Plo +libmysql_r/.deps/my_malloc.Plo +libmysql_r/.deps/my_messnc.Plo +libmysql_r/.deps/my_net.Plo +libmysql_r/.deps/my_once.Plo +libmysql_r/.deps/my_open.Plo +libmysql_r/.deps/my_port.Plo +libmysql_r/.deps/my_pread.Plo +libmysql_r/.deps/my_pthread.Plo +libmysql_r/.deps/my_read.Plo +libmysql_r/.deps/my_realloc.Plo +libmysql_r/.deps/my_rename.Plo +libmysql_r/.deps/my_seek.Plo +libmysql_r/.deps/my_sleep.Plo +libmysql_r/.deps/my_static.Plo +libmysql_r/.deps/my_strtoll10.Plo +libmysql_r/.deps/my_symlink.Plo +libmysql_r/.deps/my_thr_init.Plo +libmysql_r/.deps/my_time.Plo +libmysql_r/.deps/my_vsnprintf.Plo +libmysql_r/.deps/my_write.Plo +libmysql_r/.deps/net.Plo +libmysql_r/.deps/pack.Plo +libmysql_r/.deps/password.Plo +libmysql_r/.deps/safemalloc.Plo +libmysql_r/.deps/sha1.Plo +libmysql_r/.deps/str2int.Plo +libmysql_r/.deps/str_alloc.Plo +libmysql_r/.deps/strcend.Plo +libmysql_r/.deps/strcont.Plo +libmysql_r/.deps/strend.Plo +libmysql_r/.deps/strfill.Plo +libmysql_r/.deps/string.Plo +libmysql_r/.deps/strinstr.Plo +libmysql_r/.deps/strmake.Plo +libmysql_r/.deps/strmov.Plo +libmysql_r/.deps/strnlen.Plo +libmysql_r/.deps/strnmov.Plo +libmysql_r/.deps/strtod.Plo +libmysql_r/.deps/strtoll.Plo +libmysql_r/.deps/strtoull.Plo +libmysql_r/.deps/strxmov.Plo +libmysql_r/.deps/strxnmov.Plo +libmysql_r/.deps/thr_mutex.Plo +libmysql_r/.deps/typelib.Plo +libmysql_r/.deps/vio.Plo +libmysql_r/.deps/viosocket.Plo +libmysql_r/.deps/viossl.Plo +libmysql_r/.deps/viosslfactories.Plo +libmysql_r/.deps/xml.Plo +libmysql_r/.libs/libmysqlclient_r.lai +libmysql_r/.libs/libmysqlclient_r.so.15 +libmysql_r/.libs/libmysqlclient_r.so.15.0.0 +libmysql_r/acconfig.h +libmysql_r/client_settings.h +libmysql_r/conf_to_src +libmysql_r/link_sources +libmysql_r/my_static.h +libmysql_r/mysys_priv.h +libmysql_r/vio_priv.h +libmysqld/*.ds? +libmysqld/*.vcproj +libmysqld/.deps/client.Po +libmysqld/.deps/derror.Po +libmysqld/.deps/discover.Po +libmysqld/.deps/emb_qcache.Po +libmysqld/.deps/errmsg.Po +libmysqld/.deps/event_data_objects.Po +libmysqld/.deps/event_db_repository.Po +libmysqld/.deps/event_queue.Po +libmysqld/.deps/event_scheduler.Po +libmysqld/.deps/events.Po +libmysqld/.deps/field.Po +libmysqld/.deps/field_conv.Po +libmysqld/.deps/filesort.Po +libmysqld/.deps/get_password.Po +libmysqld/.deps/gstream.Po +libmysqld/.deps/ha_berkeley.Po +libmysqld/.deps/ha_federated.Po +libmysqld/.deps/ha_heap.Po +libmysqld/.deps/ha_innodb.Po +libmysqld/.deps/ha_myisam.Po +libmysqld/.deps/ha_myisammrg.Po +libmysqld/.deps/ha_ndbcluster.Po +libmysqld/.deps/ha_ndbcluster_binlog.Po +libmysqld/.deps/ha_partition.Po +libmysqld/.deps/handler.Po +libmysqld/.deps/hash_filo.Po +libmysqld/.deps/hostname.Po +libmysqld/.deps/init.Po +libmysqld/.deps/item.Po +libmysqld/.deps/item_buff.Po +libmysqld/.deps/item_cmpfunc.Po +libmysqld/.deps/item_create.Po +libmysqld/.deps/item_func.Po +libmysqld/.deps/item_geofunc.Po +libmysqld/.deps/item_row.Po +libmysqld/.deps/item_strfunc.Po +libmysqld/.deps/item_subselect.Po +libmysqld/.deps/item_sum.Po +libmysqld/.deps/item_timefunc.Po +libmysqld/.deps/item_uniq.Po +libmysqld/.deps/item_xmlfunc.Po +libmysqld/.deps/key.Po +libmysqld/.deps/lib_sql.Po +libmysqld/.deps/libmysql.Po +libmysqld/.deps/libmysqld.Po +libmysqld/.deps/lock.Po +libmysqld/.deps/log.Po +libmysqld/.deps/log_event.Po +libmysqld/.deps/my_decimal.Po +libmysqld/.deps/my_time.Po +libmysqld/.deps/my_user.Po +libmysqld/.deps/net_serv.Po +libmysqld/.deps/opt_range.Po +libmysqld/.deps/opt_sum.Po +libmysqld/.deps/pack.Po +libmysqld/.deps/parse_file.Po +libmysqld/.deps/partition_info.Po +libmysqld/.deps/password.Po +libmysqld/.deps/procedure.Po +libmysqld/.deps/protocol.Po +libmysqld/.deps/records.Po +libmysqld/.deps/rpl_filter.Po +libmysqld/.deps/rpl_injector.Po +libmysqld/.deps/set_var.Po +libmysqld/.deps/sp.Po +libmysqld/.deps/sp_cache.Po +libmysqld/.deps/sp_head.Po +libmysqld/.deps/sp_pcontext.Po +libmysqld/.deps/sp_rcontext.Po +libmysqld/.deps/spatial.Po +libmysqld/.deps/sql_acl.Po +libmysqld/.deps/sql_analyse.Po +libmysqld/.deps/sql_base.Po +libmysqld/.deps/sql_builtin.Po +libmysqld/.deps/sql_cache.Po +libmysqld/.deps/sql_class.Po +libmysqld/.deps/sql_crypt.Po +libmysqld/.deps/sql_cursor.Po +libmysqld/.deps/sql_db.Po +libmysqld/.deps/sql_delete.Po +libmysqld/.deps/sql_truncate.Po +libmysqld/.deps/sql_reload.Po +libmysqld/.deps/datadict.Po +libmysqld/.deps/sql_derived.Po +libmysqld/.deps/sql_do.Po +libmysqld/.deps/sql_error.Po +libmysqld/.deps/sql_handler.Po +libmysqld/.deps/sql_help.Po +libmysqld/.deps/sql_insert.Po +libmysqld/.deps/sql_lex.Po +libmysqld/.deps/sql_list.Po +libmysqld/.deps/sql_load.Po +libmysqld/.deps/sql_manager.Po +libmysqld/.deps/sql_map.Po +libmysqld/.deps/sql_parse.Po +libmysqld/.deps/sql_partition.Po +libmysqld/.deps/sql_plugin.Po +libmysqld/.deps/sql_prepare.Po +libmysqld/.deps/sql_rename.Po +libmysqld/.deps/sql_select.Po +libmysqld/.deps/sql_show.Po +libmysqld/.deps/sql_state.Po +libmysqld/.deps/sql_string.Po +libmysqld/.deps/sql_table.Po +libmysqld/.deps/sql_tablespace.Po +libmysqld/.deps/sql_test.Po +libmysqld/.deps/sql_trigger.Po +libmysqld/.deps/sql_udf.Po +libmysqld/.deps/sql_union.Po +libmysqld/.deps/sql_update.Po +libmysqld/.deps/sql_view.Po +libmysqld/.deps/sql_yacc.Po +libmysqld/.deps/stacktrace.Po +libmysqld/.deps/strfunc.Po +libmysqld/.deps/table.Po +libmysqld/.deps/thr_malloc.Po +libmysqld/.deps/time.Po +libmysqld/.deps/tztime.Po +libmysqld/.deps/uniques.Po +libmysqld/.deps/unireg.Po +libmysqld/backup_dir +libmysqld/client.c +libmysqld/client_settings.h +libmysqld/cmake_dummy.c +libmysqld/convert.cc +libmysqld/derror.cc +libmysqld/discover.cc +libmysqld/emb_qcache.cpp +libmysqld/errmsg.c +libmysqld/event.cc +libmysqld/event_data_objects.cc +libmysqld/event_db_repository.cc +libmysqld/event_executor.cc +libmysqld/event_queue.cc +libmysqld/event_scheduler.cc +libmysqld/event_timed.cc +libmysqld/events.cc +libmysqld/examples/.deps/completion_hash.Po +libmysqld/examples/.deps/mysql.Po +libmysqld/examples/.deps/mysql_client_test.Po +libmysqld/examples/.deps/mysqltest.Po +libmysqld/examples/.deps/readline.Po +libmysqld/examples/client_test.c +libmysqld/examples/client_test.cc +libmysqld/examples/completion_hash.cc +libmysqld/examples/completion_hash.h +libmysqld/examples/link_sources +libmysqld/examples/my_readline.h +libmysqld/examples/mysql +libmysqld/examples/mysql.cc +libmysqld/examples/mysql_client_test.c +libmysqld/examples/mysql_client_test_embedded +libmysqld/examples/mysqltest +libmysqld/examples/mysqltest.c +libmysqld/examples/mysqltest_embedded +libmysqld/examples/readline.cc +libmysqld/examples/sql_string.cc +libmysqld/examples/sql_string.h +libmysqld/examples/test-gdbinit +libmysqld/field.cc +libmysqld/field_conv.cc +libmysqld/filesort.cc +libmysqld/get_password.c +libmysqld/gstream.cc +libmysqld/ha_archive.cc +libmysqld/ha_berkeley.cc +libmysqld/ha_blackhole.cc +libmysqld/ha_example.cc +libmysqld/ha_federated.cc +libmysqld/ha_heap.cc +libmysqld/ha_innobase.cc +libmysqld/ha_innodb.cc +libmysqld/ha_isam.cc +libmysqld/ha_isammrg.cc +libmysqld/ha_myisam.cc +libmysqld/ha_myisammrg.cc +libmysqld/ha_ndbcluster.cc +libmysqld/ha_ndbcluster_binlog.cc +libmysqld/ha_ndbcluster_cond.cc +libmysqld/ha_partition.cc +libmysqld/ha_tina.cc +libmysqld/handler.cc +libmysqld/handlerton.cc +libmysqld/hash_filo.cc +libmysqld/hostname.cc +libmysqld/init.cc +libmysqld/item.cc +libmysqld/item_buff.cc +libmysqld/item_cmpfunc.cc +libmysqld/item_create.cc +libmysqld/item_func.cc +libmysqld/item_geofunc.cc +libmysqld/item_row.cc +libmysqld/item_strfunc.cc +libmysqld/item_subselect.cc +libmysqld/item_sum.cc +libmysqld/item_timefunc.cc +libmysqld/item_uniq.cc +libmysqld/key.cc +libmysqld/lex_hash.h +libmysqld/lib_sql.cpp +libmysqld/libmysql.c +libmysqld/link_sources +libmysqld/lock.cc +libmysqld/log.cc +libmysqld/log_event.cc +libmysqld/log_event_old.cc +libmysqld/md5.c +libmysqld/message.h +libmysqld/message.rc +libmysqld/mf_iocache.cc +libmysqld/mini_client.cc +libmysqld/my_decimal.cc +libmysqld/my_time.c +libmysqld/my_user.c +libmysqld/net_pkg.cc +libmysqld/net_serv.cc +libmysqld/opt_ft.cc +libmysqld/opt_range.cc +libmysqld/opt_sum.cc +libmysqld/pack.c +libmysqld/parse_file.cc +libmysqld/partition_info.cc +libmysqld/password.c +libmysqld/procedure.cc +libmysqld/protocol.cc +libmysqld/protocol_cursor.cc +libmysqld/records.cc +libmysqld/repl_failsafe.cc +libmysqld/rpl_filter.cc +libmysqld/rpl_handler.cc +libmysqld/rpl_injector.cc +libmysqld/rpl_record.cc +libmysqld/rpl_record_old.cc +libmysqld/rpl_utility.cc +libmysqld/scheduler.cc +libmysqld/set_var.cc +libmysqld/sha2.cc +libmysqld/simple-test +libmysqld/slave.cc +libmysqld/sp.cc +libmysqld/sp_cache.cc +libmysqld/sp_head.cc +libmysqld/sp_pcontext.cc +libmysqld/sp_rcontext.cc +libmysqld/spatial.cc +libmysqld/sql_acl.cc +libmysqld/sql_analyse.cc +libmysqld/sql_base.cc +libmysqld/sql_builtin.cc +libmysqld/sql_cache.cc +libmysqld/sql_class.cc +libmysqld/sql_command +libmysqld/sql_connect.cc +libmysqld/sql_crypt.cc +libmysqld/sql_cursor.cc +libmysqld/sql_cursor.h +libmysqld/sql_db.cc +libmysqld/sql_delete.cc +libmysqld/sql_truncate.cc +libmysqld/sql_reload.cc +libmysqld/datadict.cc +libmysqld/sql_derived.cc +libmysqld/sql_do.cc +libmysqld/sql_error.cc +libmysqld/sql_handler.cc +libmysqld/sql_help.cc +libmysqld/sql_insert.cc +libmysqld/sql_lex.cc +libmysqld/sql_list.cc +libmysqld/sql_load.cc +libmysqld/sql_locale.cc +libmysqld/sql_manager.cc +libmysqld/sql_map.cc +libmysqld/sql_olap.cc +libmysqld/sql_parse.cc +libmysqld/sql_partition.cc +libmysqld/sql_plugin.cc +libmysqld/sql_prepare.cc +libmysqld/sql_profile.cc +libmysqld/sql_rename.cc +libmysqld/sql_repl.cc +libmysqld/sql_select.cc +libmysqld/sql_servers.cc +libmysqld/sql_show.cc +libmysqld/sql_state.c +libmysqld/sql_string.cc +libmysqld/sql_table.cc +libmysqld/sql_tablespace.cc +libmysqld/sql_test.cc +libmysqld/sql_trigger.cc +libmysqld/sql_udf.cc +libmysqld/sql_union.cc +libmysqld/sql_unions.cc +libmysqld/sql_update.cc +libmysqld/sql_view.cc +libmysqld/sql_yacc.cc +libmysqld/sql_yacc.cpp +libmysqld/sql_yacc.h +libmysqld/stacktrace.c +libmysqld/strfunc.cc +libmysqld/table.cc +libmysqld/thr_malloc.cc +libmysqld/sql_time.cc +libmysqld/tztime.cc +libmysqld/uniques.cc +libmysqld/unireg.cc +libmysqltest/*.ds? +libmysqltest/*.vcproj +libmysqltest/mytest.c +libtool +linked_client_sources +linked_include_sources +linked_libmysql_r_sources +linked_libmysql_sources +linked_libmysqld_sources +linked_libmysqldex_sources +linked_server_sources +linked_tools_sources +locked +ltmain.sh +man/*.1 +merge/*.ds? +merge/*.vcproj +missing +mit-pthreads/config.flags +mit-pthreads/include/bits +mit-pthreads/include/pthread/machdep.h +mit-pthreads/include/pthread/posix.h +mit-pthreads/include/sys +mit-pthreads/machdep.c +mit-pthreads/pg++ +mit-pthreads/pgcc +mit-pthreads/syscall.S +mkinstalldirs +my_print_defaults/*.ds? +my_print_defaults/*.vcproj +myisam/*.ds? +myisam/*.vcproj +myisam/FT1.MYD +myisam/FT1.MYI +myisam/ft_dump +myisam/ft_eval +myisam/ft_test1 +myisam/ftbench/data +myisam/ftbench/t +myisam/ftbench/var/* +myisam/mi_test1 +myisam/mi_test2 +myisam/mi_test3 +myisam/mi_test_all +myisam/myisam.log +myisam/myisam_ftdump +myisam/myisamchk +myisam/myisamlog +myisam/myisampack +myisam/rt_test +myisam/rt_test.MYD +myisam/rt_test.MYI +myisam/sp_test +myisam/test1.MYD +myisam/test1.MYI +myisam/test2.MYD +myisam/test2.MYI +myisam_ftdump/*.ds? +myisam_ftdump/*.vcproj +myisamchk/*.ds? +myisamchk/*.vcproj +myisamlog/*.ds? +myisamlog/*.vcproj +myisammrg/*.ds? +myisammrg/*.vcproj +myisampack/*.ds? +myisampack/*.vcproj +mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz +mysql-4.0.2-alpha.tar.gz +mysql-4.1.8-win-src.zip +mysql-5.0.2-alpha.tar.gz +mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz +mysql-test/*.ds? +mysql-test/*.vcproj +mysql-test/.DS_Store +mysql-test/collections/default.release +mysql-test/collections/default.release.done +mysql-test/funcs_1.log +mysql-test/funcs_1.tar +mysql-test/gmon.out +mysql-test/install_test_db +mysql-test/lib/My/SafeProcess/my_safe_process +mysql-test/lib/init_db.sql +mysql-test/linux_sys_vars.inc +mysql-test/load_sysvars.inc +mysql-test/mtr +mysql-test/mysql-test-run +mysql-test/mysql-test-gcov.err +mysql-test/mysql-test-gcov.msg +mysql-test/mysql-test-run-shell +mysql-test/mysql-test-run.log +mysql-test/mysql_test_run_new +mysql-test/ndb/ndbcluster +mysql-test/partitions.log +mysql-test/r/*.err +mysql-test/r/*.log +mysql-test/r/*.out +mysql-test/r/*.reject +mysql-test/r/index_merge_load.result +mysql-test/r/max_allowed_packet_func.result +mysql-test/r/rpl000001.eval +mysql-test/r/rpl000002.eval +mysql-test/r/rpl000014.eval +mysql-test/r/rpl000015.eval +mysql-test/r/rpl000016.eval +mysql-test/r/rpl_log.eval +mysql-test/r/slave-running.eval +mysql-test/r/slave-stopped.eval +mysql-test/r/tmp.result +mysql-test/reg.log +mysql-test/rpl.log +mysql-test/share/mysql +mysql-test/std_data/*.pem +mysql-test/suite/funcs_1.tar.gz +mysql-test/suite/funcs_1.tar.zip +mysql-test/suite/funcs_1/r/innodb_trig_03e.warnings +mysql-test/suite/funcs_1/r/innodb_views.warnings +mysql-test/suite/funcs_1/r/memory_trig_03e.warnings +mysql-test/suite/funcs_1/r/memory_views.warnings +mysql-test/suite/funcs_1/r/myisam_trig_03e.warnings +mysql-test/suite/funcs_1/r/myisam_views.warnings +mysql-test/suite/funcs_1/r/ndb_trig_03e.warnings +mysql-test/suite/funcs_1/r/ndb_views.warnings +mysql-test/suite/partitions/r/dif +mysql-test/suite/partitions/r/diff +mysql-test/suite/partitions/r/partition.result +mysql-test/suite/partitions/r/partition_bit_ndb.warnings +mysql-test/suite/partitions/r/partition_special_innodb.warnings +mysql-test/suite/partitions/r/partition_special_myisam.warnings +mysql-test/suite/partitions/r/partition_t55.out +mysql-test/suite/partitions/r/partition_t55.refout +mysql-test/suite/partitions/t/partition.test +mysql-test/t/index_merge.load +mysql-test/t/tmp.test +mysql-test/var +mysql-test/var/* +mysql-test/windows_sys_vars.inc +mysql.kdevprj +mysql.proj +sql_priv.h +mysqlbinlog/*.ds? +mysqlbinlog/*.vcproj +mysqlcheck/*.ds? +mysqlcheck/*.vcproj +mysqld.S +mysqld.sym +mysqldemb/*.ds? +mysqldemb/*.vcproj +mysqlserver/*.ds? +mysqlserver/*.vcproj +mysys/#mf_iocache.c# +mysys/*.ds? +mysys/*.vcproj +mysys/.deps/array.Po +mysys/.deps/base64.Po +mysys/.deps/charset-def.Po +mysys/.deps/charset.Po +mysys/.deps/checksum.Po +mysys/.deps/default.Po +mysys/.deps/default_modify.Po +mysys/.deps/errors.Po +mysys/.deps/hash.Po +mysys/.deps/list.Po +mysys/.deps/md5.Po +mysys/.deps/mf_brkhant.Po +mysys/.deps/mf_cache.Po +mysys/.deps/mf_dirname.Po +mysys/.deps/mf_fn_ext.Po +mysys/.deps/mf_format.Po +mysys/.deps/mf_getdate.Po +mysys/.deps/mf_iocache.Po +mysys/.deps/mf_iocache2.Po +mysys/.deps/mf_keycache.Po +mysys/.deps/mf_keycaches.Po +mysys/.deps/mf_loadpath.Po +mysys/.deps/mf_pack.Po +mysys/.deps/mf_path.Po +mysys/.deps/mf_qsort.Po +mysys/.deps/mf_qsort2.Po +mysys/.deps/mf_radix.Po +mysys/.deps/mf_same.Po +mysys/.deps/mf_sort.Po +mysys/.deps/mf_strip.Po +mysys/.deps/mf_tempdir.Po +mysys/.deps/mf_tempfile.Po +mysys/.deps/mf_unixpath.Po +mysys/.deps/mf_wcomp.Po +mysys/.deps/mf_wfile.Po +mysys/.deps/mulalloc.Po +mysys/.deps/my_access.Po +mysys/.deps/my_aes.Po +mysys/.deps/my_alarm.Po +mysys/.deps/my_alloc.Po +mysys/.deps/my_append.Po +mysys/.deps/my_atomic.Po +mysys/.deps/my_bit.Po +mysys/.deps/my_bitmap.Po +mysys/.deps/my_chsize.Po +mysys/.deps/my_clock.Po +mysys/.deps/my_compress.Po +mysys/.deps/my_copy.Po +mysys/.deps/my_crc32.Po +mysys/.deps/my_create.Po +mysys/.deps/my_delete.Po +mysys/.deps/my_div.Po +mysys/.deps/my_dup.Po +mysys/.deps/my_error.Po +mysys/.deps/my_file.Po +mysys/.deps/my_fopen.Po +mysys/.deps/my_fstream.Po +mysys/.deps/my_gethostbyname.Po +mysys/.deps/my_gethwaddr.Po +mysys/.deps/my_getncpus.Po +mysys/.deps/my_getopt.Po +mysys/.deps/my_getsystime.Po +mysys/.deps/my_getwd.Po +mysys/.deps/my_handler.Po +mysys/.deps/my_init.Po +mysys/.deps/my_largepage.Po +mysys/.deps/my_lib.Po +mysys/.deps/my_libwrap.Po +mysys/.deps/my_lock.Po +mysys/.deps/my_lockmem.Po +mysys/.deps/my_lread.Po +mysys/.deps/my_lwrite.Po +mysys/.deps/my_malloc.Po +mysys/.deps/my_memmem.Po +mysys/.deps/my_messnc.Po +mysys/.deps/my_mkdir.Po +mysys/.deps/my_mmap.Po +mysys/.deps/my_net.Po +mysys/.deps/my_netware.Po +mysys/.deps/my_new.Po +mysys/.deps/my_once.Po +mysys/.deps/my_open.Po +mysys/.deps/my_port.Po +mysys/.deps/my_pread.Po +mysys/.deps/my_pthread.Po +mysys/.deps/my_quick.Po +mysys/.deps/my_read.Po +mysys/.deps/my_realloc.Po +mysys/.deps/my_redel.Po +mysys/.deps/my_rename.Po +mysys/.deps/my_seek.Po +mysys/.deps/my_semaphore.Po +mysys/.deps/my_sleep.Po +mysys/.deps/my_static.Po +mysys/.deps/my_symlink.Po +mysys/.deps/my_symlink2.Po +mysys/.deps/my_sync.Po +mysys/.deps/my_thr_init.Po +mysys/.deps/my_vle.Po +mysys/.deps/my_windac.Po +mysys/.deps/my_write.Po +mysys/.deps/ptr_cmp.Po +mysys/.deps/queues.Po +mysys/.deps/rijndael.Po +mysys/.deps/safemalloc.Po +mysys/.deps/sha1.Po +mysys/.deps/string.Po +mysys/.deps/thr_alarm.Po +mysys/.deps/thr_lock.Po +mysys/.deps/thr_mutex.Po +mysys/.deps/thr_rwlock.Po +mysys/.deps/tree.Po +mysys/.deps/trie.Po +mysys/.deps/typelib.Po +mysys/charset2html +mysys/getopt.c +mysys/getopt1.c +mysys/main.cc +mysys/my_new.cpp +mysys/raid.cpp +mysys/ste5KbMa +mysys/test_atomic +mysys/test_bitmap +mysys/test_charset +mysys/test_dir +mysys/test_gethwaddr +mysys/test_io_cache +mysys/test_thr_alarm +mysys/test_thr_lock +mysys/test_vsnprintf +mysys/testhash +ndb/bin/DbAsyncGenerator +ndb/bin/DbCreate +ndb/bin/acid +ndb/bin/async-lmc-bench-l-p10.sh +ndb/bin/async-lmc-bench-l.sh +ndb/bin/async-lmc-bench-p10.sh +ndb/bin/async-lmc-bench.sh +ndb/bin/atrt +ndb/bin/atrt-analyze-result.sh +ndb/bin/atrt-clear-result.sh +ndb/bin/atrt-gather-result.sh +ndb/bin/atrt-setup.sh +ndb/bin/bankCreator +ndb/bin/bankMakeGL +ndb/bin/bankSumAccounts +ndb/bin/bankTimer +ndb/bin/bankTransactionMaker +ndb/bin/bankValidateAllGLs +ndb/bin/basicTransporterTest +ndb/bin/benchronja +ndb/bin/bulk_copy +ndb/bin/copy_tab +ndb/bin/create_all_tabs +ndb/bin/create_index +ndb/bin/create_tab +ndb/bin/delete_all +ndb/bin/desc +ndb/bin/drop_all_tabs +ndb/bin/drop_index +ndb/bin/drop_tab +ndb/bin/flexAsynch +ndb/bin/flexBench +ndb/bin/flexHammer +ndb/bin/flexScan +ndb/bin/flexTT +ndb/bin/hugoCalculator +ndb/bin/hugoFill +ndb/bin/hugoLoad +ndb/bin/hugoLockRecords +ndb/bin/hugoPkDelete +ndb/bin/hugoPkRead +ndb/bin/hugoPkReadRecord +ndb/bin/hugoPkUpdate +ndb/bin/hugoScanRead +ndb/bin/hugoScanUpdate +ndb/bin/index +ndb/bin/index2 +ndb/bin/initronja +ndb/bin/interpreterInTup +ndb/bin/list_tables +ndb/bin/make-config.sh +ndb/bin/mgmtclient +ndb/bin/mgmtsrvr +ndb/bin/mkconfig +ndb/bin/ndb +ndb/bin/ndb_cpcc +ndb/bin/ndb_cpcd +ndb/bin/ndb_rep +ndb/bin/ndbsql +ndb/bin/newton_basic +ndb/bin/newton_br +ndb/bin/newton_pb +ndb/bin/newton_perf +ndb/bin/perfTransporterTest +ndb/bin/printConfig +ndb/bin/printSchemafile +ndb/bin/printSysfile +ndb/bin/redoLogFileReader +ndb/bin/restart +ndb/bin/restarter +ndb/bin/restarter2 +ndb/bin/restarts +ndb/bin/restore +ndb/bin/select_all +ndb/bin/select_count +ndb/bin/telco +ndb/bin/testBackup +ndb/bin/testBank +ndb/bin/testBasic +ndb/bin/testBasicAsynch +ndb/bin/testCopy +ndb/bin/testDataBuffers +ndb/bin/testDict +ndb/bin/testGrep +ndb/bin/testGrepVerify +ndb/bin/testIndex +ndb/bin/testInterpreter +ndb/bin/testKernelDataBuffer +ndb/bin/testLongSig +ndb/bin/testMgm +ndb/bin/testMgmapi +ndb/bin/testNdbApi +ndb/bin/testNodeRestart +ndb/bin/testOIBasic +ndb/bin/testOdbcDriver +ndb/bin/testOperations +ndb/bin/testRestartGci +ndb/bin/testScan +ndb/bin/testScanInterpreter +ndb/bin/testSimplePropertiesSection +ndb/bin/testSystemRestart +ndb/bin/testTimeout +ndb/bin/testTransactions +ndb/bin/test_cpcd +ndb/bin/test_event +ndb/bin/verify_index +ndb/bin/waiter +ndb/config/autom4te.cache/* +ndb/config/config.mk +ndb/examples/ndbapi_example1/ndbapi_example1 +ndb/examples/ndbapi_example2/ndbapi_example2 +ndb/examples/ndbapi_example3/ndbapi_example3 +ndb/examples/ndbapi_example5/ndbapi_example5 +ndb/examples/select_all/select_all +ndb/include/ndb_global.h +ndb/include/ndb_types.h +ndb/include/ndb_version.h +ndb/lib/libMGM_API.so +ndb/lib/libNDB_API.so +ndb/lib/libNDB_ODBC.so +ndb/lib/libNEWTON_API.so +ndb/lib/libNEWTON_BASICTEST_COMMON.so +ndb/lib/libREP_API.so +ndb/lib/libndbclient.so +ndb/lib/libndbclient_extra.so +ndb/src/common/debugger/libtrace.dsp +ndb/src/common/debugger/signaldata/libsignaldataprint.dsp +ndb/src/common/logger/liblogger.dsp +ndb/src/common/mgmcommon/libmgmsrvcommon.dsp +ndb/src/common/mgmcommon/printConfig/*.d +ndb/src/common/portlib/libportlib.dsp +ndb/src/common/transporter/libtransporter.dsp +ndb/src/common/util/libgeneral.dsp +ndb/src/common/util/testBitmask.cpp +ndb/src/cw/cpcd/ndb_cpcd +ndb/src/dummy.cpp +ndb/src/kernel/blocks/backup/libbackup.dsp +ndb/src/kernel/blocks/backup/restore/ndb_restore +ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp +ndb/src/kernel/blocks/dbacc/libdbacc.dsp +ndb/src/kernel/blocks/dbdict/libdbdict.dsp +ndb/src/kernel/blocks/dbdih/libdbdih.dsp +ndb/src/kernel/blocks/dblqh/libdblqh.dsp +ndb/src/kernel/blocks/dbtc/libdbtc.dsp +ndb/src/kernel/blocks/dbtup/libdbtup.dsp +ndb/src/kernel/blocks/dbtux/libdbtux.dsp +ndb/src/kernel/blocks/dbutil/libdbutil.dsp +ndb/src/kernel/blocks/grep/libgrep.dsp +ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp +ndb/src/kernel/blocks/ndbfs/libndbfs.dsp +ndb/src/kernel/blocks/qmgr/libqmgr.dsp +ndb/src/kernel/blocks/suma/libsuma.dsp +ndb/src/kernel/blocks/trix/libtrix.dsp +ndb/src/kernel/error/liberror.dsp +ndb/src/kernel/ndbd +ndb/src/kernel/ndbd.dsp +ndb/src/kernel/vm/libkernel.dsp +ndb/src/libndb.ver +ndb/src/libndbclient.dsp +ndb/src/mgmapi/libmgmapi.dsp +ndb/src/mgmclient/libndbmgmclient.dsp +ndb/src/mgmclient/ndb_mgm +ndb/src/mgmclient/ndb_mgm.dsp +ndb/src/mgmclient/test_cpcd/*.d +ndb/src/mgmsrv/ndb_mgmd +ndb/src/mgmsrv/ndb_mgmd.dsp +ndb/src/ndbapi/libndbapi.dsp +ndb/test/ndbapi/bank/bankCreator +ndb/test/ndbapi/bank/bankMakeGL +ndb/test/ndbapi/bank/bankSumAccounts +ndb/test/ndbapi/bank/bankTimer +ndb/test/ndbapi/bank/bankTransactionMaker +ndb/test/ndbapi/bank/bankValidateAllGLs +ndb/test/ndbapi/bank/testBank +ndb/test/ndbapi/create_all_tabs +ndb/test/ndbapi/create_tab +ndb/test/ndbapi/drop_all_tabs +ndb/test/ndbapi/flexAsynch +ndb/test/ndbapi/flexBench +ndb/test/ndbapi/flexBench.dsp +ndb/test/ndbapi/flexHammer +ndb/test/ndbapi/flexTT +ndb/test/ndbapi/testBackup +ndb/test/ndbapi/testBasic +ndb/test/ndbapi/testBasic.dsp +ndb/test/ndbapi/testBasicAsynch +ndb/test/ndbapi/testBlobs +ndb/test/ndbapi/testBlobs.dsp +ndb/test/ndbapi/testDataBuffers +ndb/test/ndbapi/testDeadlock +ndb/test/ndbapi/testDict +ndb/test/ndbapi/testIndex +ndb/test/ndbapi/testMgm +ndb/test/ndbapi/testNdbApi +ndb/test/ndbapi/testNodeRestart +ndb/test/ndbapi/testOIBasic +ndb/test/ndbapi/testOperations +ndb/test/ndbapi/testRestartGci +ndb/test/ndbapi/testSRBank +ndb/test/ndbapi/testScan +ndb/test/ndbapi/testScan.dsp +ndb/test/ndbapi/testScanInterpreter +ndb/test/ndbapi/testScanPerf +ndb/test/ndbapi/testSystemRestart +ndb/test/ndbapi/testTimeout +ndb/test/ndbapi/testTransactions +ndb/test/ndbapi/test_event +ndb/test/run-test/atrt +ndb/test/src/libNDBT.dsp +ndb/test/tools/copy_tab +ndb/test/tools/create_index +ndb/test/tools/hugoCalculator +ndb/test/tools/hugoFill +ndb/test/tools/hugoLoad +ndb/test/tools/hugoLockRecords +ndb/test/tools/hugoPkDelete +ndb/test/tools/hugoPkRead +ndb/test/tools/hugoPkReadRecord +ndb/test/tools/hugoPkUpdate +ndb/test/tools/hugoScanRead +ndb/test/tools/hugoScanUpdate +ndb/test/tools/ndb_cpcc +ndb/test/tools/restart +ndb/test/tools/verify_index +ndb/tools/ndb_config +ndb/tools/ndb_delete_all +ndb/tools/ndb_delete_all.dsp +ndb/tools/ndb_desc +ndb/tools/ndb_desc.dsp +ndb/tools/ndb_drop_index +ndb/tools/ndb_drop_index.dsp +ndb/tools/ndb_drop_table +ndb/tools/ndb_drop_table.dsp +ndb/tools/ndb_restore +ndb/tools/ndb_select_all +ndb/tools/ndb_select_all.dsp +ndb/tools/ndb_select_count +ndb/tools/ndb_select_count.dsp +ndb/tools/ndb_show_tables +ndb/tools/ndb_show_tables.dsp +ndb/tools/ndb_test_platform +ndb/tools/ndb_waiter +ndb/tools/ndb_waiter.dsp +ndbcluster-1186 +ndbcluster-1186/SCCS +ndbcluster-1186/config.ini +ndbcluster-1186/ndb_1.pid +ndbcluster-1186/ndb_1_out.log +ndbcluster-1186/ndb_1_signal.log +ndbcluster-1186/ndb_2.pid +ndbcluster-1186/ndb_2_out.log +ndbcluster-1186/ndb_2_signal.log +ndbcluster-1186/ndb_3.pid +ndbcluster-1186/ndb_3_cluster.log +ndbcluster-1186/ndb_3_out.log +ndbcluster-1186/ndbcluster.pid +netware/.deps/libmysqlmain.Po +netware/.deps/my_manage.Po +netware/.deps/mysql_install_db.Po +netware/.deps/mysql_test_run.Po +netware/.deps/mysqld_safe.Po +netware/init_db.sql +netware/libmysql.imp +netware/test_db.sql +pack_isam/*.ds? +perror/*.ds? +perror/*.vcproj +plugin/fulltext/.deps/mypluglib_la-plugin_example.Plo +plugin/fulltext/.libs/mypluglib.lai +plugin/fulltext/.libs/mypluglib.so.0 +plugin/fulltext/.libs/mypluglib.so.0.0.0 +pstack/.deps/bucomm.Po +pstack/.deps/debug.Po +pstack/.deps/filemode.Po +pstack/.deps/ieee.Po +pstack/.deps/linuxthreads.Po +pstack/.deps/pstack.Po +pstack/.deps/rddbg.Po +pstack/.deps/stabs.Po +pull.log +regex/*.ds? +regex/*.vcproj +regex/.deps/debug.Po +regex/.deps/main.Po +regex/.deps/regcomp.Po +regex/.deps/regerror.Po +regex/.deps/regexec.Po +regex/.deps/regfree.Po +regex/.deps/reginit.Po +regex/.deps/split.Po +regex/re +repl-tests/test-repl-ts/repl-timestamp.master.reject +repl-tests/test-repl/foo-dump-slave.master. +repl-tests/test-repl/sum-wlen-slave.master. +repl-tests/test-repl/sum-wlen-slave.master.re +repl-tests/test-repl/sum-wlen-slave.master.reje +replace/*.ds? +replace/*.vcproj +scripts/comp_sql +scripts/fill_func_tables +scripts/fill_func_tables.sql +scripts/fill_help_tables +scripts/fill_help_tables.sql +scripts/make_binary_distribution +scripts/make_sharedlib_distribution +scripts/make_win_binary_distribution +scripts/make_win_src_distribution +scripts/make_win_src_distribution_old +scripts/msql2mysql +scripts/mysql_config +scripts/mysql_convert_table_format +scripts/mysql_create_system_tables +scripts/mysql_explain_log +scripts/mysql_find_rows +scripts/mysql_fix_extensions +scripts/mysql_fix_privilege_tables +scripts/mysql_fix_privilege_tables.sql +scripts/mysql_fix_privilege_tables.sql.rule +scripts/mysql_fix_privilege_tables_sql.c +scripts/mysql_fix_privilege_tables_sql.c.rule +scripts/mysql_install_db +scripts/mysql_secure_installation +scripts/mysql_setpermission +scripts/mysql_tableinfo +scripts/mysql_upgrade +scripts/mysql_upgrade_shell +scripts/mysql_zap +scripts/mysqlaccess +scripts/mysqlbug +scripts/mysqld_multi +scripts/mysqld_safe +scripts/mysqldumpslow +scripts/mysqlhotcopy +scripts/mysqlhotcopy.sh.rej +scripts/safe_mysqld +select_test +server-tools/instance-manager/.deps/buffer.Po +server-tools/instance-manager/.deps/command.Po +server-tools/instance-manager/.deps/commands.Po +server-tools/instance-manager/.deps/guardian.Po +server-tools/instance-manager/.deps/instance.Po +server-tools/instance-manager/.deps/instance_map.Po +server-tools/instance-manager/.deps/instance_options.Po +server-tools/instance-manager/.deps/liboptions_la-options.Plo +server-tools/instance-manager/.deps/liboptions_la-priv.Plo +server-tools/instance-manager/.deps/listener.Po +server-tools/instance-manager/.deps/log.Po +server-tools/instance-manager/.deps/manager.Po +server-tools/instance-manager/.deps/messages.Po +server-tools/instance-manager/.deps/mysql_connection.Po +server-tools/instance-manager/.deps/mysqlmanager.Po +server-tools/instance-manager/.deps/net_serv.Po +server-tools/instance-manager/.deps/parse.Po +server-tools/instance-manager/.deps/parse_output.Po +server-tools/instance-manager/.deps/protocol.Po +server-tools/instance-manager/.deps/thread_registry.Po +server-tools/instance-manager/.deps/user_management_commands.Po +server-tools/instance-manager/.deps/user_map.Po +server-tools/instance-manager/buffer.cpp +server-tools/instance-manager/client.c +server-tools/instance-manager/client_settings.h +server-tools/instance-manager/command.cpp +server-tools/instance-manager/commands.cpp +server-tools/instance-manager/errmsg.c +server-tools/instance-manager/guardian.cpp +server-tools/instance-manager/instance.cpp +server-tools/instance-manager/instance_map.cpp +server-tools/instance-manager/instance_options.cpp +server-tools/instance-manager/listener.cpp +server-tools/instance-manager/log.cpp +server-tools/instance-manager/manager.cpp +server-tools/instance-manager/messages.cpp +server-tools/instance-manager/mysql_connection.cpp +server-tools/instance-manager/mysqlmanager +server-tools/instance-manager/mysqlmanager.cpp +server-tools/instance-manager/net_serv.cc +server-tools/instance-manager/options.cpp +server-tools/instance-manager/parse.cpp +server-tools/instance-manager/parse_output.cpp +server-tools/instance-manager/priv.cpp +server-tools/instance-manager/protocol.cpp +server-tools/instance-manager/thr_alarm.c +server-tools/instance-manager/thread_registry.cpp +server-tools/instance-manager/user_map.cpp +sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686 +sql-bench/bench-count-distinct +sql-bench/bench-init.pl +sql-bench/compare-results +sql-bench/compare-results-all +sql-bench/copy-db +sql-bench/crash-me +sql-bench/gif/* +sql-bench/graph-compare-results +sql-bench/innotest1 +sql-bench/innotest1a +sql-bench/innotest1b +sql-bench/innotest2 +sql-bench/innotest2a +sql-bench/innotest2b +sql-bench/output/* +sql-bench/run-all-tests +sql-bench/server-cfg +sql-bench/template.html +sql-bench/test-ATIS +sql-bench/test-alter-table +sql-bench/test-big-tables +sql-bench/test-connect +sql-bench/test-create +sql-bench/test-insert +sql-bench/test-select +sql-bench/test-transactions +sql-bench/test-wisconsin +sql/*.cpp +sql/*.ds? +sql/*.def +sql/*.vcproj +sql/.deps/client.Po +sql/.deps/derror.Po +sql/.deps/des_key_file.Po +sql/.deps/discover.Po +sql/.deps/event_data_objects.Po +sql/.deps/event_db_repository.Po +sql/.deps/event_queue.Po +sql/.deps/event_scheduler.Po +sql/.deps/events.Po +sql/.deps/field.Po +sql/.deps/field_conv.Po +sql/.deps/filesort.Po +sql/.deps/gen_lex_hash.Po +sql/.deps/gstream.Po +sql/.deps/ha_berkeley.Po +sql/.deps/ha_federated.Po +sql/.deps/ha_heap.Po +sql/.deps/ha_innodb.Po +sql/.deps/ha_myisam.Po +sql/.deps/ha_myisammrg.Po +sql/.deps/ha_ndbcluster.Po +sql/.deps/ha_ndbcluster_binlog.Po +sql/.deps/ha_partition.Po +sql/.deps/handler.Po +sql/.deps/hash_filo.Po +sql/.deps/hostname.Po +sql/.deps/init.Po +sql/.deps/item.Po +sql/.deps/item_buff.Po +sql/.deps/item_cmpfunc.Po +sql/.deps/item_create.Po +sql/.deps/item_func.Po +sql/.deps/item_geofunc.Po +sql/.deps/item_row.Po +sql/.deps/item_strfunc.Po +sql/.deps/item_subselect.Po +sql/.deps/item_sum.Po +sql/.deps/item_timefunc.Po +sql/.deps/item_uniq.Po +sql/.deps/item_xmlfunc.Po +sql/.deps/key.Po +sql/.deps/lock.Po +sql/.deps/log.Po +sql/.deps/log_event.Po +sql/.deps/mf_iocache.Po +sql/.deps/mini_client_errors.Po +sql/.deps/my_decimal.Po +sql/.deps/my_lock.Po +sql/.deps/my_time.Po +sql/.deps/my_user.Po +sql/.deps/mysql_tzinfo_to_sql.Po +sql/.deps/mysqld.Po +sql/.deps/net_serv.Po +sql/.deps/opt_range.Po +sql/.deps/opt_sum.Po +sql/.deps/pack.Po +sql/.deps/parse_file.Po +sql/.deps/partition_info.Po +sql/.deps/password.Po +sql/.deps/procedure.Po +sql/.deps/protocol.Po +sql/.deps/records.Po +sql/.deps/repl_failsafe.Po +sql/.deps/rpl_filter.Po +sql/.deps/rpl_injector.Po +sql/.deps/rpl_tblmap.Po +sql/.deps/set_var.Po +sql/.deps/slave.Po +sql/.deps/sp.Po +sql/.deps/sp_cache.Po +sql/.deps/sp_head.Po +sql/.deps/sp_pcontext.Po +sql/.deps/sp_rcontext.Po +sql/.deps/spatial.Po +sql/.deps/sql_acl.Po +sql/.deps/sql_analyse.Po +sql/.deps/sql_base.Po +sql/.deps/sql_binlog.Po +sql/.deps/sql_builtin.Po +sql/.deps/sql_cache.Po +sql/.deps/sql_class.Po +sql/.deps/sql_client.Po +sql/.deps/sql_crypt.Po +sql/.deps/sql_cursor.Po +sql/.deps/sql_db.Po +sql/.deps/sql_delete.Po +sql/.deps/sql_truncate.Po +sql/.deps/sql_reload.Po +sql/.deps/datadict.Po +sql/.deps/sql_derived.Po +sql/.deps/sql_do.Po +sql/.deps/sql_error.Po +sql/.deps/sql_handler.Po +sql/.deps/sql_help.Po +sql/.deps/sql_insert.Po +sql/.deps/sql_lex.Po +sql/.deps/sql_list.Po +sql/.deps/sql_load.Po +sql/.deps/sql_manager.Po +sql/.deps/sql_map.Po +sql/.deps/sql_olap.Po +sql/.deps/sql_parse.Po +sql/.deps/sql_partition.Po +sql/.deps/sql_plugin.Po +sql/.deps/sql_prepare.Po +sql/.deps/sql_rename.Po +sql/.deps/sql_repl.Po +sql/.deps/sql_select.Po +sql/.deps/sql_show.Po +sql/.deps/sql_state.Po +sql/.deps/sql_string.Po +sql/.deps/sql_table.Po +sql/.deps/sql_tablespace.Po +sql/.deps/sql_test.Po +sql/.deps/sql_trigger.Po +sql/.deps/sql_udf.Po +sql/.deps/sql_union.Po +sql/.deps/sql_update.Po +sql/.deps/sql_view.Po +sql/.deps/sql_yacc.Po +sql/.deps/stacktrace.Po +sql/.deps/strfunc.Po +sql/.deps/table.Po +sql/.deps/thr_malloc.Po +sql/.deps/time.Po +sql/.deps/tztime.Po +sql/.deps/udf_example.Plo +sql/.deps/uniques.Po +sql/.deps/unireg.Po +sql/.gdbinit +sql/.libs/udf_example.lai +sql/.libs/udf_example.so.0 +sql/.libs/udf_example.so.0.0.0 +sql/client.c +sql/cmake_dummy.cc +sql/Doxyfile +sql/f.c +sql/gen_lex_hash +sql/gmon.out +sql/handlerton.cc +sql/html +sql/latex +sql/lex_hash.h +sql/lex_hash.h.rule +sql/link_sources +sql/max/* +sql/message.h +sql/message.mc +sql/message.rc +sql/mini_client_errors.c +sql/my_time.c +sql/my_user.c +sql/mysql_tzinfo_to_sql +sql/mysql_tzinfo_to_sql.cc +sql/mysql_tzinfo_to_sql_tztime.cc +sql/mysqlbinlog +sql/mysqld +sql/mysqld-purecov +sql/mysqld-purify +sql/mysqld-quantify +sql/new.cc +sql/pack.c +sql/safe_to_cache_query.txt +sql/share/*.sys +sql/share/charsets/gmon.out +sql/share/fixerrmsg.pl +sql/share/gmon.out +sql/share/iso639-2.txt +sql/share/mysql +sql/share/norwegian-ny/errmsg.sys +sql/share/norwegian/errmsg.sys +sql/sql_builtin.cc +sql/sql_select.cc.orig +sql/sql_yacc.cc +sql/sql_yacc.h +sql/sql_yacc.h.rule +sql/sql_yacc.output +sql/sql_yacc.yy.orig +sql/test_time +sql/udf_example.so +sql_error.cc +sql_prepare.cc +stamp-h +stamp-h.in +stamp-h1 +stamp-h1.in +stamp-h2 +stamp-h2.in +stamp-h3 +stamp-h4 +start_mysqld.sh +storage/archive/.deps/archive_test-archive_test.Po +storage/archive/.deps/archive_test-azio.Po +storage/archive/.deps/ha_archive_la-azio.Plo +storage/archive/.deps/ha_archive_la-ha_archive.Plo +storage/archive/.deps/libarchive_a-azio.Po +storage/archive/.deps/libarchive_a-ha_archive.Po +storage/archive/archive_reader +storage/archive/archive_test +storage/bdb/*.ds? +storage/bdb/*.vcproj +storage/bdb/README +storage/bdb/btree/btree_auto.c +storage/bdb/btree/btree_autop.c +storage/bdb/build_unix/* +storage/bdb/build_vxworks/BerkeleyDB20.wpj +storage/bdb/build_vxworks/BerkeleyDB20small.wpj +storage/bdb/build_vxworks/BerkeleyDB22.wpj +storage/bdb/build_vxworks/BerkeleyDB22small.wpj +storage/bdb/build_vxworks/db.h +storage/bdb/build_vxworks/db_config.h +storage/bdb/build_vxworks/db_config_small.h +storage/bdb/build_vxworks/db_deadlock/db_deadlock20.wpj +storage/bdb/build_vxworks/db_deadlock/db_deadlock22.wpj +storage/bdb/build_vxworks/db_int.h +storage/bdb/build_vxworks/dbdemo/dbdemo.c +storage/bdb/build_vxworks/dbdemo/dbdemo20.wpj +storage/bdb/build_vxworks/dbdemo/dbdemo22.wpj +storage/bdb/build_win32/*.dsp +storage/bdb/build_win32/*.h +storage/bdb/build_win32/db.h +storage/bdb/build_win32/db_archive.dsp +storage/bdb/build_win32/db_checkpoint.dsp +storage/bdb/build_win32/db_config.h +storage/bdb/build_win32/db_cxx.h +storage/bdb/build_win32/db_deadlock.dsp +storage/bdb/build_win32/db_dll.dsp +storage/bdb/build_win32/db_dump.dsp +storage/bdb/build_win32/db_int.h +storage/bdb/build_win32/db_java.dsp +storage/bdb/build_win32/db_load.dsp +storage/bdb/build_win32/db_perf.dsp +storage/bdb/build_win32/db_printlog.dsp +storage/bdb/build_win32/db_recover.dsp +storage/bdb/build_win32/db_stat.dsp +storage/bdb/build_win32/db_static.dsp +storage/bdb/build_win32/db_tcl.dsp +storage/bdb/build_win32/db_test.dsp +storage/bdb/build_win32/db_upgrade.dsp +storage/bdb/build_win32/db_verify.dsp +storage/bdb/build_win32/ex_access.dsp +storage/bdb/build_win32/ex_btrec.dsp +storage/bdb/build_win32/ex_env.dsp +storage/bdb/build_win32/ex_lock.dsp +storage/bdb/build_win32/ex_mpool.dsp +storage/bdb/build_win32/ex_tpcb.dsp +storage/bdb/build_win32/excxx_access.dsp +storage/bdb/build_win32/excxx_btrec.dsp +storage/bdb/build_win32/excxx_env.dsp +storage/bdb/build_win32/excxx_lock.dsp +storage/bdb/build_win32/excxx_mpool.dsp +storage/bdb/build_win32/excxx_tpcb.dsp +storage/bdb/build_win32/include.tcl +storage/bdb/build_win32/libdb.def +storage/bdb/build_win32/libdb.rc +storage/bdb/build_win64/*.dsp +storage/bdb/build_win64/*.dsw +storage/bdb/build_win64/*.h +storage/bdb/db/crdel_auto.c +storage/bdb/db/crdel_autop.c +storage/bdb/db/db_auto.c +storage/bdb/db/db_autop.c +storage/bdb/dbinc_auto/*.* +storage/bdb/dbreg/dbreg_auto.c +storage/bdb/dbreg/dbreg_autop.c +storage/bdb/dist/autom4te-2.53.cache/* +storage/bdb/dist/autom4te-2.53.cache/output.0 +storage/bdb/dist/autom4te-2.53.cache/requests +storage/bdb/dist/autom4te-2.53.cache/traces.0 +storage/bdb/dist/autom4te.cache/* +storage/bdb/dist/autom4te.cache/output.0 +storage/bdb/dist/autom4te.cache/requests +storage/bdb/dist/autom4te.cache/traces.0 +storage/bdb/dist/config.hin +storage/bdb/dist/configure +storage/bdb/dist/tags +storage/bdb/dist/template/db_server_proc +storage/bdb/dist/template/gen_client_ret +storage/bdb/dist/template/rec_btree +storage/bdb/dist/template/rec_crdel +storage/bdb/dist/template/rec_db +storage/bdb/dist/template/rec_dbreg +storage/bdb/dist/template/rec_fileops +storage/bdb/dist/template/rec_hash +storage/bdb/dist/template/rec_log +storage/bdb/dist/template/rec_qam +storage/bdb/dist/template/rec_txn +storage/bdb/examples_c/ex_apprec/ex_apprec_auto.c +storage/bdb/examples_c/ex_apprec/ex_apprec_auto.h +storage/bdb/examples_c/ex_apprec/ex_apprec_template +storage/bdb/examples_java +storage/bdb/fileops/fileops_auto.c +storage/bdb/fileops/fileops_autop.c +storage/bdb/hash/hash_auto.c +storage/bdb/hash/hash_autop.c +storage/bdb/include/btree_auto.h +storage/bdb/include/btree_ext.h +storage/bdb/include/clib_ext.h +storage/bdb/include/common_ext.h +storage/bdb/include/crdel_auto.h +storage/bdb/include/db_auto.h +storage/bdb/include/db_ext.h +storage/bdb/include/db_server.h +storage/bdb/include/env_ext.h +storage/bdb/include/gen_client_ext.h +storage/bdb/include/gen_server_ext.h +storage/bdb/include/hash_auto.h +storage/bdb/include/hash_ext.h +storage/bdb/include/lock_ext.h +storage/bdb/include/log_auto.h +storage/bdb/include/log_ext.h +storage/bdb/include/mp_ext.h +storage/bdb/include/mutex_ext.h +storage/bdb/include/os_ext.h +storage/bdb/include/qam_auto.h +storage/bdb/include/qam_ext.h +storage/bdb/include/rpc_client_ext.h +storage/bdb/include/rpc_server_ext.h +storage/bdb/include/tcl_ext.h +storage/bdb/include/txn_auto.h +storage/bdb/include/txn_ext.h +storage/bdb/include/xa_ext.h +storage/bdb/java/src/com/sleepycat/db/Db.java +storage/bdb/java/src/com/sleepycat/db/DbBtreeStat.java +storage/bdb/java/src/com/sleepycat/db/DbConstants.java +storage/bdb/java/src/com/sleepycat/db/DbHashStat.java +storage/bdb/java/src/com/sleepycat/db/DbLockStat.java +storage/bdb/java/src/com/sleepycat/db/DbLogStat.java +storage/bdb/java/src/com/sleepycat/db/DbMpoolFStat.java +storage/bdb/java/src/com/sleepycat/db/DbQueueStat.java +storage/bdb/java/src/com/sleepycat/db/DbRepStat.java +storage/bdb/java/src/com/sleepycat/db/DbTxnStat.java +storage/bdb/libdb_java/java_stat_auto.c +storage/bdb/libdb_java/java_stat_auto.h +storage/bdb/libdb_java/java_util.i +storage/bdb/log/log_auto.c +storage/bdb/qam/qam_auto.c +storage/bdb/qam/qam_autop.c +storage/bdb/rep/rep_auto.c +storage/bdb/rep/rep_autop.c +storage/bdb/rpc_client/db_server_clnt.c +storage/bdb/rpc_client/gen_client.c +storage/bdb/rpc_server/c/db_server_proc.c +storage/bdb/rpc_server/c/db_server_proc.sed +storage/bdb/rpc_server/c/db_server_svc.c +storage/bdb/rpc_server/c/db_server_xdr.c +storage/bdb/rpc_server/c/gen_db_server.c +storage/bdb/rpc_server/db_server.x +storage/bdb/rpc_server/db_server_proc.sed +storage/bdb/rpc_server/db_server_svc.c +storage/bdb/rpc_server/db_server_xdr.c +storage/bdb/rpc_server/gen_db_server.c +storage/bdb/test/TESTS +storage/bdb/test/include.tcl +storage/bdb/test/logtrack.list +storage/bdb/txn/txn_auto.c +storage/bdb/txn/txn_autop.c +storage/blackhole/.deps/ha_blackhole_la-ha_blackhole.Plo +storage/blackhole/.deps/libblackhole_a-ha_blackhole.Po +storage/csv/.deps/ha_csv_la-ha_tina.Plo +storage/csv/.deps/libcsv_a-ha_tina.Po +storage/example/.deps/ha_example_la-ha_example.Plo +storage/example/.deps/libexample_a-ha_example.Po +storage/heap/.deps/_check.Po +storage/heap/.deps/_rectest.Po +storage/heap/.deps/hp_block.Po +storage/heap/.deps/hp_clear.Po +storage/heap/.deps/hp_close.Po +storage/heap/.deps/hp_create.Po +storage/heap/.deps/hp_delete.Po +storage/heap/.deps/hp_extra.Po +storage/heap/.deps/hp_hash.Po +storage/heap/.deps/hp_info.Po +storage/heap/.deps/hp_open.Po +storage/heap/.deps/hp_panic.Po +storage/heap/.deps/hp_rename.Po +storage/heap/.deps/hp_rfirst.Po +storage/heap/.deps/hp_rkey.Po +storage/heap/.deps/hp_rlast.Po +storage/heap/.deps/hp_rnext.Po +storage/heap/.deps/hp_rprev.Po +storage/heap/.deps/hp_rrnd.Po +storage/heap/.deps/hp_rsame.Po +storage/heap/.deps/hp_scan.Po +storage/heap/.deps/hp_static.Po +storage/heap/.deps/hp_test1.Po +storage/heap/.deps/hp_test2.Po +storage/heap/.deps/hp_update.Po +storage/heap/.deps/hp_write.Po +storage/heap/hp_test1 +storage/heap/hp_test2 +storage/innobase/autom4te-2.53.cache/* +storage/innobase/autom4te-2.53.cache/output.0 +storage/innobase/autom4te-2.53.cache/requests +storage/innobase/autom4te-2.53.cache/traces.0 +storage/innobase/autom4te.cache/* +storage/innobase/autom4te.cache/output.0 +storage/innobase/autom4te.cache/requests +storage/innobase/autom4te.cache/traces.0 +storage/innobase/btr/.deps/btr0btr.Po +storage/innobase/btr/.deps/btr0cur.Po +storage/innobase/btr/.deps/btr0pcur.Po +storage/innobase/btr/.deps/btr0sea.Po +storage/innobase/buf/.deps/buf0buf.Po +storage/innobase/buf/.deps/buf0flu.Po +storage/innobase/buf/.deps/buf0lru.Po +storage/innobase/buf/.deps/buf0rea.Po +storage/innobase/configure.lineno +storage/innobase/conftest.s1 +storage/innobase/conftest.subs +storage/innobase/data/.deps/data0data.Po +storage/innobase/data/.deps/data0type.Po +storage/innobase/dict/.deps/dict0boot.Po +storage/innobase/dict/.deps/dict0crea.Po +storage/innobase/dict/.deps/dict0dict.Po +storage/innobase/dict/.deps/dict0load.Po +storage/innobase/dict/.deps/dict0mem.Po +storage/innobase/dyn/.deps/dyn0dyn.Po +storage/innobase/eval/.deps/eval0eval.Po +storage/innobase/eval/.deps/eval0proc.Po +storage/innobase/fil/.deps/fil0fil.Po +storage/innobase/fsp/.deps/fsp0fsp.Po +storage/innobase/fut/.deps/fut0fut.Po +storage/innobase/fut/.deps/fut0lst.Po +storage/innobase/ha/.deps/ha0ha.Po +storage/innobase/ha/.deps/hash0hash.Po +storage/innobase/ib_config.h +storage/innobase/ib_config.h.in +storage/innobase/ibuf/.deps/ibuf0ibuf.Po +storage/innobase/lock/.deps/lock0lock.Po +storage/innobase/log/.deps/log0log.Po +storage/innobase/log/.deps/log0recv.Po +storage/innobase/mach/.deps/mach0data.Po +storage/innobase/mem/.deps/mem0mem.Po +storage/innobase/mem/.deps/mem0pool.Po +storage/innobase/mkinstalldirs +storage/innobase/mtr/.deps/mtr0log.Po +storage/innobase/mtr/.deps/mtr0mtr.Po +storage/innobase/os/.deps/os0file.Po +storage/innobase/os/.deps/os0proc.Po +storage/innobase/os/.deps/os0sync.Po +storage/innobase/os/.deps/os0thread.Po +storage/innobase/page/.deps/page0cur.Po +storage/innobase/page/.deps/page0page.Po +storage/innobase/pars/.deps/lexyy.Po +storage/innobase/pars/.deps/pars0grm.Po +storage/innobase/pars/.deps/pars0opt.Po +storage/innobase/pars/.deps/pars0pars.Po +storage/innobase/pars/.deps/pars0sym.Po +storage/innobase/que/.deps/que0que.Po +storage/innobase/read/.deps/read0read.Po +storage/innobase/rem/.deps/rem0cmp.Po +storage/innobase/rem/.deps/rem0rec.Po +storage/innobase/row/.deps/row0ins.Po +storage/innobase/row/.deps/row0mysql.Po +storage/innobase/row/.deps/row0purge.Po +storage/innobase/row/.deps/row0row.Po +storage/innobase/row/.deps/row0sel.Po +storage/innobase/row/.deps/row0uins.Po +storage/innobase/row/.deps/row0umod.Po +storage/innobase/row/.deps/row0undo.Po +storage/innobase/row/.deps/row0upd.Po +storage/innobase/row/.deps/row0vers.Po +storage/innobase/srv/.deps/srv0que.Po +storage/innobase/srv/.deps/srv0srv.Po +storage/innobase/srv/.deps/srv0start.Po +storage/innobase/stamp-h1 +storage/innobase/sync/.deps/sync0arr.Po +storage/innobase/sync/.deps/sync0rw.Po +storage/innobase/sync/.deps/sync0sync.Po +storage/innobase/thr/.deps/thr0loc.Po +storage/innobase/trx/.deps/trx0purge.Po +storage/innobase/trx/.deps/trx0rec.Po +storage/innobase/trx/.deps/trx0roll.Po +storage/innobase/trx/.deps/trx0rseg.Po +storage/innobase/trx/.deps/trx0sys.Po +storage/innobase/trx/.deps/trx0trx.Po +storage/innobase/trx/.deps/trx0undo.Po +storage/innobase/usr/.deps/usr0sess.Po +storage/innobase/ut/.deps/ut0byte.Po +storage/innobase/ut/.deps/ut0dbg.Po +storage/innobase/ut/.deps/ut0list.Po +storage/innobase/ut/.deps/ut0mem.Po +storage/innobase/ut/.deps/ut0rnd.Po +storage/innobase/ut/.deps/ut0ut.Po +storage/innobase/ut/.deps/ut0vec.Po +storage/innobase/ut/.deps/ut0wqueue.Po +storage/myisam/.deps/ft_boolean_search.Po +storage/myisam/.deps/ft_nlq_search.Po +storage/myisam/.deps/ft_parser.Po +storage/myisam/.deps/ft_static.Po +storage/myisam/.deps/ft_stopwords.Po +storage/myisam/.deps/ft_update.Po +storage/myisam/.deps/mi_cache.Po +storage/myisam/.deps/mi_changed.Po +storage/myisam/.deps/mi_check.Po +storage/myisam/.deps/mi_checksum.Po +storage/myisam/.deps/mi_close.Po +storage/myisam/.deps/mi_create.Po +storage/myisam/.deps/mi_dbug.Po +storage/myisam/.deps/mi_delete.Po +storage/myisam/.deps/mi_delete_all.Po +storage/myisam/.deps/mi_delete_table.Po +storage/myisam/.deps/mi_dynrec.Po +storage/myisam/.deps/mi_extra.Po +storage/myisam/.deps/mi_info.Po +storage/myisam/.deps/mi_key.Po +storage/myisam/.deps/mi_keycache.Po +storage/myisam/.deps/mi_locking.Po +storage/myisam/.deps/mi_log.Po +storage/myisam/.deps/mi_open.Po +storage/myisam/.deps/mi_packrec.Po +storage/myisam/.deps/mi_page.Po +storage/myisam/.deps/mi_panic.Po +storage/myisam/.deps/mi_preload.Po +storage/myisam/.deps/mi_range.Po +storage/myisam/.deps/mi_rename.Po +storage/myisam/.deps/mi_rfirst.Po +storage/myisam/.deps/mi_rkey.Po +storage/myisam/.deps/mi_rlast.Po +storage/myisam/.deps/mi_rnext.Po +storage/myisam/.deps/mi_rnext_same.Po +storage/myisam/.deps/mi_rprev.Po +storage/myisam/.deps/mi_rrnd.Po +storage/myisam/.deps/mi_rsame.Po +storage/myisam/.deps/mi_rsamepos.Po +storage/myisam/.deps/mi_scan.Po +storage/myisam/.deps/mi_search.Po +storage/myisam/.deps/mi_static.Po +storage/myisam/.deps/mi_statrec.Po +storage/myisam/.deps/mi_test1.Po +storage/myisam/.deps/mi_test2.Po +storage/myisam/.deps/mi_test3.Po +storage/myisam/.deps/mi_unique.Po +storage/myisam/.deps/mi_update.Po +storage/myisam/.deps/mi_write.Po +storage/myisam/.deps/myisam_ftdump.Po +storage/myisam/.deps/myisamchk.Po +storage/myisam/.deps/myisamlog.Po +storage/myisam/.deps/myisampack.Po +storage/myisam/.deps/rt_index.Po +storage/myisam/.deps/rt_key.Po +storage/myisam/.deps/rt_mbr.Po +storage/myisam/.deps/rt_split.Po +storage/myisam/.deps/rt_test.Po +storage/myisam/.deps/sort.Po +storage/myisam/.deps/sp_key.Po +storage/myisam/.deps/sp_test.Po +storage/myisam/FT1.MYD +storage/myisam/FT1.MYI +storage/myisam/ft_dump +storage/myisam/ft_eval +storage/myisam/ft_test1 +storage/myisam/ftbench/data +storage/myisam/ftbench/t +storage/myisam/ftbench/var/* +storage/myisam/mi_test1 +storage/myisam/mi_test2 +storage/myisam/mi_test3 +storage/myisam/mi_test_all +storage/myisam/myisam.log +storage/myisam/myisam_ftdump +storage/myisam/myisamchk +storage/myisam/myisamlog +storage/myisam/myisampack +storage/myisam/rt_test +storage/myisam/rt_test.MYD +storage/myisam/rt_test.MYI +storage/myisam/sp_test +storage/myisam/test1.MYD +storage/myisam/test1.MYI +storage/myisam/test2.MYD +storage/myisam/test2.MYI +storage/myisammrg/.deps/myrg_close.Po +storage/myisammrg/.deps/myrg_create.Po +storage/myisammrg/.deps/myrg_delete.Po +storage/myisammrg/.deps/myrg_extra.Po +storage/myisammrg/.deps/myrg_info.Po +storage/myisammrg/.deps/myrg_locking.Po +storage/myisammrg/.deps/myrg_open.Po +storage/myisammrg/.deps/myrg_panic.Po +storage/myisammrg/.deps/myrg_queue.Po +storage/myisammrg/.deps/myrg_range.Po +storage/myisammrg/.deps/myrg_rfirst.Po +storage/myisammrg/.deps/myrg_rkey.Po +storage/myisammrg/.deps/myrg_rlast.Po +storage/myisammrg/.deps/myrg_rnext.Po +storage/myisammrg/.deps/myrg_rnext_same.Po +storage/myisammrg/.deps/myrg_rprev.Po +storage/myisammrg/.deps/myrg_rrnd.Po +storage/myisammrg/.deps/myrg_rsame.Po +storage/myisammrg/.deps/myrg_static.Po +storage/myisammrg/.deps/myrg_update.Po +storage/myisammrg/.deps/myrg_write.Po +storage/ndb/bin/DbAsyncGenerator +storage/ndb/bin/DbCreate +storage/ndb/bin/acid +storage/ndb/bin/async-lmc-bench-l-p10.sh +storage/ndb/bin/async-lmc-bench-l.sh +storage/ndb/bin/async-lmc-bench-p10.sh +storage/ndb/bin/async-lmc-bench.sh +storage/ndb/bin/atrt +storage/ndb/bin/atrt-analyze-result.sh +storage/ndb/bin/atrt-clear-result.sh +storage/ndb/bin/atrt-gather-result.sh +storage/ndb/bin/atrt-setup.sh +storage/ndb/bin/bankCreator +storage/ndb/bin/bankMakeGL +storage/ndb/bin/bankSumAccounts +storage/ndb/bin/bankTimer +storage/ndb/bin/bankTransactionMaker +storage/ndb/bin/bankValidateAllGLs +storage/ndb/bin/basicTransporterTest +storage/ndb/bin/benchronja +storage/ndb/bin/bulk_copy +storage/ndb/bin/copy_tab +storage/ndb/bin/create_all_tabs +storage/ndb/bin/create_index +storage/ndb/bin/create_tab +storage/ndb/bin/delete_all +storage/ndb/bin/desc +storage/ndb/bin/drop_all_tabs +storage/ndb/bin/drop_index +storage/ndb/bin/drop_tab +storage/ndb/bin/flexAsynch +storage/ndb/bin/flexBench +storage/ndb/bin/flexHammer +storage/ndb/bin/flexScan +storage/ndb/bin/flexTT +storage/ndb/bin/hugoCalculator +storage/ndb/bin/hugoFill +storage/ndb/bin/hugoLoad +storage/ndb/bin/hugoLockRecords +storage/ndb/bin/hugoPkDelete +storage/ndb/bin/hugoPkRead +storage/ndb/bin/hugoPkReadRecord +storage/ndb/bin/hugoPkUpdate +storage/ndb/bin/hugoScanRead +storage/ndb/bin/hugoScanUpdate +storage/ndb/bin/index +storage/ndb/bin/index2 +storage/ndb/bin/initronja +storage/ndb/bin/interpreterInTup +storage/ndb/bin/list_tables +storage/ndb/bin/make-config.sh +storage/ndb/bin/mgmtclient +storage/ndb/bin/mgmtsrvr +storage/ndb/bin/mkconfig +storage/ndb/bin/ndb +storage/ndb/bin/ndb_cpcc +storage/ndb/bin/ndb_cpcd +storage/ndb/bin/ndb_rep +storage/ndb/bin/ndbsql +storage/ndb/bin/newton_basic +storage/ndb/bin/newton_br +storage/ndb/bin/newton_pb +storage/ndb/bin/newton_perf +storage/ndb/bin/perfTransporterTest +storage/ndb/bin/printConfig +storage/ndb/bin/printSchemafile +storage/ndb/bin/printSysfile +storage/ndb/bin/redoLogFileReader +storage/ndb/bin/restart +storage/ndb/bin/restarter +storage/ndb/bin/restarter2 +storage/ndb/bin/restarts +storage/ndb/bin/restore +storage/ndb/bin/select_all +storage/ndb/bin/select_count +storage/ndb/bin/telco +storage/ndb/bin/testBackup +storage/ndb/bin/testBank +storage/ndb/bin/testBasic +storage/ndb/bin/testBasicAsynch +storage/ndb/bin/testCopy +storage/ndb/bin/testDataBuffers +storage/ndb/bin/testDict +storage/ndb/bin/testGrep +storage/ndb/bin/testGrepVerify +storage/ndb/bin/testIndex +storage/ndb/bin/testInterpreter +storage/ndb/bin/testKernelDataBuffer +storage/ndb/bin/testLongSig +storage/ndb/bin/testMgm +storage/ndb/bin/testMgmapi +storage/ndb/bin/testNdbApi +storage/ndb/bin/testNodeRestart +storage/ndb/bin/testOIBasic +storage/ndb/bin/testOdbcDriver +storage/ndb/bin/testOperations +storage/ndb/bin/testRestartGci +storage/ndb/bin/testScan +storage/ndb/bin/testScanInterpreter +storage/ndb/bin/testSimplePropertiesSection +storage/ndb/bin/testSystemRestart +storage/ndb/bin/testTimeout +storage/ndb/bin/testTransactions +storage/ndb/bin/test_cpcd +storage/ndb/bin/test_event +storage/ndb/bin/verify_index +storage/ndb/bin/waiter +storage/ndb/config/autom4te.cache/* +storage/ndb/config/config.mk +storage/ndb/examples/ndbapi_example1/ndbapi_example1 +storage/ndb/examples/ndbapi_example2/ndbapi_example2 +storage/ndb/examples/ndbapi_example3/ndbapi_example3 +storage/ndb/examples/ndbapi_example5/ndbapi_example5 +storage/ndb/examples/select_all/select_all +storage/ndb/include/ndb_global.h +storage/ndb/include/ndb_types.h +storage/ndb/include/ndb_version.h +storage/ndb/lib/libMGM_API.so +storage/ndb/lib/libNDB_API.so +storage/ndb/lib/libNDB_ODBC.so +storage/ndb/lib/libNEWTON_API.so +storage/ndb/lib/libNEWTON_BASICTEST_COMMON.so +storage/ndb/lib/libREP_API.so +storage/ndb/lib/libndbclient.so +storage/ndb/lib/libndbclient_extra.so +storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent +storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2 +storage/ndb/ndbapi-examples/ndbapi_async/ndbapi_async +storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1 +storage/ndb/ndbapi-examples/ndbapi_event/ndbapi_event +storage/ndb/ndbapi-examples/ndbapi_retries/ndbapi_retries +storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan +storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple +storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual +storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index +storage/ndb/src/common/debugger/libtrace.dsp +storage/ndb/src/common/debugger/signaldata/libsignaldataprint.dsp +storage/ndb/src/common/logger/liblogger.dsp +storage/ndb/src/common/mgmcommon/libmgmsrvcommon.dsp +storage/ndb/src/common/mgmcommon/printConfig/*.d +storage/ndb/src/common/portlib/libportlib.dsp +storage/ndb/src/common/transporter/libtransporter.dsp +storage/ndb/src/common/util/libgeneral.dsp +storage/ndb/src/common/util/testBitmask.cpp +storage/ndb/src/cw/cpcd/ndb_cpcd +storage/ndb/src/dummy.cpp +storage/ndb/src/kernel/blocks/backup/libbackup.dsp +storage/ndb/src/kernel/blocks/backup/ndb_print_backup_file +storage/ndb/src/kernel/blocks/backup/restore/ndb_restore +storage/ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp +storage/ndb/src/kernel/blocks/dbacc/libdbacc.dsp +storage/ndb/src/kernel/blocks/dbdict/libdbdict.dsp +storage/ndb/src/kernel/blocks/dbdict/ndb_print_schema_file +storage/ndb/src/kernel/blocks/dbdih/libdbdih.dsp +storage/ndb/src/kernel/blocks/dbdih/ndb_print_sys_file +storage/ndb/src/kernel/blocks/dblqh/libdblqh.dsp +storage/ndb/src/kernel/blocks/dbtc/libdbtc.dsp +storage/ndb/src/kernel/blocks/dbtup/libdbtup.dsp +storage/ndb/src/kernel/blocks/dbtup/test_varpage +storage/ndb/src/kernel/blocks/dbtux/libdbtux.dsp +storage/ndb/src/kernel/blocks/dbutil/libdbutil.dsp +storage/ndb/src/kernel/blocks/grep/libgrep.dsp +storage/ndb/src/kernel/blocks/ndb_print_file +storage/ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp +storage/ndb/src/kernel/blocks/ndbfs/libndbfs.dsp +storage/ndb/src/kernel/blocks/qmgr/libqmgr.dsp +storage/ndb/src/kernel/blocks/suma/libsuma.dsp +storage/ndb/src/kernel/blocks/trix/libtrix.dsp +storage/ndb/src/kernel/error/liberror.dsp +storage/ndb/src/kernel/ndbd +storage/ndb/src/kernel/ndbd.dsp +storage/ndb/src/kernel/vm/libkernel.dsp +storage/ndb/src/libndb.ver +storage/ndb/src/libndbclient.dsp +storage/ndb/src/mgmapi/libmgmapi.dsp +storage/ndb/src/mgmclient/libndbmgmclient.dsp +storage/ndb/src/mgmclient/ndb_mgm +storage/ndb/src/mgmclient/ndb_mgm.dsp +storage/ndb/src/mgmclient/test_cpcd/*.d +storage/ndb/src/mgmsrv/ndb_mgmd +storage/ndb/src/mgmsrv/ndb_mgmd.dsp +storage/ndb/src/ndbapi/libndbapi.dsp +storage/ndb/src/ndbapi/ndberror_check +storage/ndb/test/ndbapi/DbAsyncGenerator +storage/ndb/test/ndbapi/DbCreate +storage/ndb/test/ndbapi/bank/bankCreator +storage/ndb/test/ndbapi/bank/bankMakeGL +storage/ndb/test/ndbapi/bank/bankSumAccounts +storage/ndb/test/ndbapi/bank/bankTimer +storage/ndb/test/ndbapi/bank/bankTransactionMaker +storage/ndb/test/ndbapi/bank/bankValidateAllGLs +storage/ndb/test/ndbapi/bank/testBank +storage/ndb/test/ndbapi/create_all_tabs +storage/ndb/test/ndbapi/create_tab +storage/ndb/test/ndbapi/drop_all_tabs +storage/ndb/test/ndbapi/flexAsynch +storage/ndb/test/ndbapi/flexBench +storage/ndb/test/ndbapi/flexBench.dsp +storage/ndb/test/ndbapi/flexHammer +storage/ndb/test/ndbapi/flexTT +storage/ndb/test/ndbapi/ndbapi_slow_select +storage/ndb/test/ndbapi/testBackup +storage/ndb/test/ndbapi/testBasic +storage/ndb/test/ndbapi/testBasic.dsp +storage/ndb/test/ndbapi/testBasicAsynch +storage/ndb/test/ndbapi/testBitfield +storage/ndb/test/ndbapi/testBlobs +storage/ndb/test/ndbapi/testBlobs.dsp +storage/ndb/test/ndbapi/testDataBuffers +storage/ndb/test/ndbapi/testDeadlock +storage/ndb/test/ndbapi/testDict +storage/ndb/test/ndbapi/testIndex +storage/ndb/test/ndbapi/testIndexStat +storage/ndb/test/ndbapi/testInterpreter +storage/ndb/test/ndbapi/testLcp +storage/ndb/test/ndbapi/testMgm +storage/ndb/test/ndbapi/testNdbApi +storage/ndb/test/ndbapi/testNodeRestart +storage/ndb/test/ndbapi/testOIBasic +storage/ndb/test/ndbapi/testOperations +storage/ndb/test/ndbapi/testPartitioning +storage/ndb/test/ndbapi/testReadPerf +storage/ndb/test/ndbapi/testRestartGci +storage/ndb/test/ndbapi/testSRBank +storage/ndb/test/ndbapi/testScan +storage/ndb/test/ndbapi/testScan.dsp +storage/ndb/test/ndbapi/testScanInterpreter +storage/ndb/test/ndbapi/testScanPerf +storage/ndb/test/ndbapi/testSystemRestart +storage/ndb/test/ndbapi/testTimeout +storage/ndb/test/ndbapi/testTransactions +storage/ndb/test/ndbapi/test_event +storage/ndb/test/ndbapi/test_event_merge +storage/ndb/test/run-test/atrt +storage/ndb/test/src/libNDBT.dsp +storage/ndb/test/tools/copy_tab +storage/ndb/test/tools/create_index +storage/ndb/test/tools/hugoCalculator +storage/ndb/test/tools/hugoFill +storage/ndb/test/tools/hugoLoad +storage/ndb/test/tools/hugoLockRecords +storage/ndb/test/tools/hugoPkDelete +storage/ndb/test/tools/hugoPkRead +storage/ndb/test/tools/hugoPkReadRecord +storage/ndb/test/tools/hugoPkUpdate +storage/ndb/test/tools/hugoScanRead +storage/ndb/test/tools/hugoScanUpdate +storage/ndb/test/tools/listen_event +storage/ndb/test/tools/ndb_cpcc +storage/ndb/test/tools/rep_latency +storage/ndb/test/tools/restart +storage/ndb/test/tools/verify_index +storage/ndb/tools/ndb_config +storage/ndb/tools/ndb_delete_all +storage/ndb/tools/ndb_delete_all.dsp +storage/ndb/tools/ndb_desc +storage/ndb/tools/ndb_desc.dsp +storage/ndb/tools/ndb_drop_index +storage/ndb/tools/ndb_drop_index.dsp +storage/ndb/tools/ndb_drop_table +storage/ndb/tools/ndb_drop_table.dsp +storage/ndb/tools/ndb_restore +storage/ndb/tools/ndb_select_all +storage/ndb/tools/ndb_select_all.dsp +storage/ndb/tools/ndb_select_count +storage/ndb/tools/ndb_select_count.dsp +storage/ndb/tools/ndb_show_tables +storage/ndb/tools/ndb_show_tables.dsp +storage/ndb/tools/ndb_test_platform +storage/ndb/tools/ndb_waiter +storage/ndb/tools/ndb_waiter.dsp +strings/*.ds? +strings/*.vcproj +strings/.deps/bchange.Po +strings/.deps/bcmp.Po +strings/.deps/bfill.Po +strings/.deps/bmove.Po +strings/.deps/bmove512.Po +strings/.deps/bmove_upp.Po +strings/.deps/conf_to_src.Po +strings/.deps/ctype-big5.Po +strings/.deps/ctype-bin.Po +strings/.deps/ctype-cp932.Po +strings/.deps/ctype-czech.Po +strings/.deps/ctype-euc_kr.Po +strings/.deps/ctype-eucjpms.Po +strings/.deps/ctype-extra.Po +strings/.deps/ctype-gb2312.Po +strings/.deps/ctype-gbk.Po +strings/.deps/ctype-latin1.Po +strings/.deps/ctype-mb.Po +strings/.deps/ctype-simple.Po +strings/.deps/ctype-sjis.Po +strings/.deps/ctype-tis620.Po +strings/.deps/ctype-uca.Po +strings/.deps/ctype-ucs2.Po +strings/.deps/ctype-ujis.Po +strings/.deps/ctype-utf8.Po +strings/.deps/ctype-win1250ch.Po +strings/.deps/ctype.Po +strings/.deps/decimal.Po +strings/.deps/int2str.Po +strings/.deps/is_prefix.Po +strings/.deps/llstr.Po +strings/.deps/longlong2str.Po +strings/.deps/longlong2str_asm.Po +strings/.deps/my_strchr.Po +strings/.deps/my_strtoll10.Po +strings/.deps/my_vsnprintf.Po +strings/.deps/r_strinstr.Po +strings/.deps/str2int.Po +strings/.deps/str_alloc.Po +strings/.deps/strappend.Po +strings/.deps/strcend.Po +strings/.deps/strcont.Po +strings/.deps/strend.Po +strings/.deps/strfill.Po +strings/.deps/strinstr.Po +strings/.deps/strmake.Po +strings/.deps/strmov.Po +strings/.deps/strnlen.Po +strings/.deps/strnmov.Po +strings/.deps/strstr.Po +strings/.deps/strtod.Po +strings/.deps/strtol.Po +strings/.deps/strtoll.Po +strings/.deps/strtoul.Po +strings/.deps/strtoull.Po +strings/.deps/strxmov.Po +strings/.deps/strxnmov.Po +strings/.deps/xml.Po +strings/conf_to_src +strings/ctype_autoconf.c +strings/ctype_extra_sources.c +strings/str_test +strings/test_decimal +support-files/*.ini +support-files/MacOSX/Description.plist +support-files/MacOSX/Info.plist +support-files/MacOSX/ReadMe.txt +support-files/MacOSX/StartupParameters.plist +support-files/MacOSX/postflight +support-files/MacOSX/postinstall +support-files/MacOSX/preflight +support-files/MacOSX/preinstall +support-files/binary-configure +support-files/my-huge.cnf +support-files/my-innodb-heavy-4G.cnf +support-files/my-large.cnf +support-files/my-medium.cnf +support-files/my-small.cnf +support-files/mysql-3.23.25-beta.spec +support-files/mysql-3.23.26-beta.spec +support-files/mysql-3.23.27-beta.spec +support-files/mysql-3.23.28-gamma.spec +support-files/mysql-3.23.29-gamma.spec +support-files/mysql-log-rotate +support-files/mysql.server +support-files/mysql.spec +support-files/mysqld_multi.server +support-files/ndb-config-2-node.ini +tags +test/ndbapi/bank/bankCreator +test/ndbapi/bank/bankMakeGL +test/ndbapi/bank/bankSumAccounts +test/ndbapi/bank/bankTimer +test/ndbapi/bank/bankTransactionMaker +test/ndbapi/bank/bankValidateAllGLs +test/ndbapi/bank/testBank +test/ndbapi/create_all_tabs +test/ndbapi/create_tab +test/ndbapi/drop_all_tabs +test/ndbapi/flexAsynch +test/ndbapi/flexBench +test/ndbapi/flexHammer +test/ndbapi/flexTT +test/ndbapi/testBackup +test/ndbapi/testBasic +test/ndbapi/testBasicAsynch +test/ndbapi/testBlobs +test/ndbapi/testDataBuffers +test/ndbapi/testDeadlock +test/ndbapi/testDict +test/ndbapi/testIndex +test/ndbapi/testMgm +test/ndbapi/testNdbApi +test/ndbapi/testNodeRestart +test/ndbapi/testOIBasic +test/ndbapi/testOperations +test/ndbapi/testRestartGci +test/ndbapi/testScan +test/ndbapi/testScanInterpreter +test/ndbapi/testScanPerf +test/ndbapi/testSystemRestart +test/ndbapi/testTimeout +test/ndbapi/testTransactions +test/ndbapi/test_event +test/run-test/atrt +test/tools/copy_tab +test/tools/create_index +test/tools/hugoCalculator +test/tools/hugoFill +test/tools/hugoLoad +test/tools/hugoLockRecords +test/tools/hugoPkDelete +test/tools/hugoPkRead +test/tools/hugoPkReadRecord +test/tools/hugoPkUpdate +test/tools/hugoScanRead +test/tools/hugoScanUpdate +test/tools/ndb_cpcc +test/tools/restart +test/tools/verify_index +test1/* +test_xml +tests/*.ds? +tests/*.vcproj +tests/.deps/dummy.Po +tests/.deps/insert_test.Po +tests/.deps/mysql_client_test.Po +tests/.deps/select_test.Po +tests/.deps/thread_test.Po +tests/.libs -prune +tests/.libs/lt-mysql_client_test +tests/.libs/mysql_client_test +tests/bug25714 +tests/client_test +tests/connect_test +tests/mysql_client_test +thr_insert_test/* +thr_test/* +thread_test +tmp/* +tools/.libs -prune +tools/my_vsnprintf.c +tools/mysqlmanager +tools/mysqlmngd +tools/mysqltestmanager +tools/mysys_priv.h +unittest/examples/*.t +unittest/examples/.deps/no_plan-t.Po +unittest/examples/.deps/simple-t.Po +unittest/examples/.deps/skip-t.Po +unittest/examples/.deps/skip_all-t.Po +unittest/examples/.deps/todo-t.Po +unittest/mysys/*.t +unittest/mysys/.deps/base64-t.Po +unittest/mysys/.deps/bitmap-t.Po +unittest/mysys/.deps/my_atomic-t.Po +unittest/mytap/.deps/tap.Po +unittest/mytap/t/*.t +unittest/mytap/t/.deps/basic-t.Po +unittest/unit +vi.h +vio/*.ds? +vio/*.vcproj +vio/.deps/dummy.Po +vio/.deps/test-ssl.Po +vio/.deps/test-sslclient.Po +vio/.deps/test-sslserver.Po +vio/.deps/vio.Po +vio/.deps/viosocket.Po +vio/.deps/viossl.Po +vio/.deps/viosslfactories.Po +vio/test-ssl +vio/test-sslclient +vio/test-sslserver +vio/viotest-ssl +vio/viotest-sslconnect.cpp +vio/viotest.cpp +win/configure.data +win/vs71cache.txt +win/vs8cache.txt +win/nmake_cache.txt +ylwrap +zlib/*.ds? +zlib/*.vcproj +mysql-test/bug36522-64.tar +mysql-test/bug36522.tar +mysql-test/t.log +mysql-test/tps.log +libmysqld/event_parse_data.cc +autom4te.cache +sql/share/czech +sql/share/danish +sql/share/dutch +sql/share/english +sql/share/estonian +sql/share/french +sql/share/german +sql/share/greek +sql/share/hungarian +sql/share/italian +sql/share/japanese +sql/share/japanese-sjis +sql/share/korean +sql/share/norwegian +sql/share/norwegian-ny +sql/share/polish +sql/share/portuguese +sql/share/romanian +sql/share/russian +sql/share/serbian +sql/share/slovak +sql/share/spanish +sql/share/swedish +sql/share/ukrainian +libmysqld/examples/mysqltest.cc +libmysqld/sql_signal.cc +libmysqld/debug_sync.cc +dbug/tests +libmysqld/mdl.cc +client/transaction.h +libmysqld/transaction.cc +libmysqld/sys_vars.cc +libmysqld/keycaches.cc +client/dtoa.c +libmysqld/sql_audit.cc +configure.am +libmysqld/des_key_file.cc +CPackConfig.cmake +CPackSourceConfig.cmake +make_dist.cmake +client/echo +libmysql/libmysql_exports_file.cc +libmysql/merge_archives_mysqlclient.cmake +libmysqld/merge_archives_mysqlserver.cmake +libmysqld/mysqlserver_depends.c +libmysqld/examples/mysql_embedded +sql/dummy.bak +mysys/thr_lock +VERSION.dep +info_macros.cmake +Docs/INFO_BIN +Docs/INFO_SRC +Testing +FilesCopied +source_downloads From 929680913417e6a09330376b9d99f3bf33db7ff3 Mon Sep 17 00:00:00 2001 From: Sujatha Sivakumar Date: Wed, 8 Oct 2014 10:50:02 +0530 Subject: [PATCH 022/201] Bug#19145698: READ OUT OF BOUNDS ISSUE Problem: ======== In a master slave replication if a slave receives a Start_log_event_v3 the payload is expected to be of fixed size. If a payload which is smaller than the fixed size is received it causes a read out of bounds issue. Analysis: ======== According to documentation the fixed data part of Start_log_event_v3 looks as shown below. 2 bytes: The binary log format version 50 bytes: The MySQL server's version 4 bytes: Timestamp in seconds when this event was created Since the payload is expected to be of fixed size, therefore ST_SERVER_VER_LEN (50) bytes are memcpy'ed into server_version. But if a malicious master sends a shorter payload it causes a read out of bounds issue. Fix: === In Start_log_event_v3 event's constructor a check has been added which expects the minimum payload length to be of size common_header_len + ST_COMMON_HEADER_LEN_OFFSET bytes. If a malicious packet of lesser length is received it will be considered as an invalid event. sql/log_event.cc: Added code changes to check the minimum packet length of Start_log_event_v3 should be > 56. sql/log_event.h: Moved server_version from stack to heap and modified is_valid function for Start_log_event_v3. --- sql/log_event.cc | 21 +++++++++++++-------- sql/log_event.h | 4 ++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 71ca722ffd6..403c512ab3a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1307,7 +1307,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Execute_load_log_event(buf, event_len, description_event); break; case START_EVENT_V3: /* this is sent only by MySQL <=4.x */ - ev = new Start_log_event_v3(buf, description_event); + ev = new Start_log_event_v3(buf, event_len, description_event); break; case STOP_EVENT: ev = new Stop_log_event(buf, description_event); @@ -3788,11 +3788,17 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info) Start_log_event_v3::Start_log_event_v3() */ -Start_log_event_v3::Start_log_event_v3(const char* buf, +Start_log_event_v3::Start_log_event_v3(const char* buf, uint event_len, const Format_description_log_event *description_event) - :Log_event(buf, description_event) + :Log_event(buf, description_event), binlog_version(BINLOG_VERSION) { + if (event_len < (uint)description_event->common_header_len + + ST_COMMON_HEADER_LEN_OFFSET) + { + server_version[0]= 0; + return; + } buf+= description_event->common_header_len; binlog_version= uint2korr(buf+ST_BINLOG_VER_OFFSET); memcpy(server_version, buf+ST_SERVER_VER_OFFSET, @@ -4082,16 +4088,15 @@ Format_description_log_event(const char* buf, const Format_description_log_event* description_event) - :Start_log_event_v3(buf, description_event), event_type_permutation(0) + :Start_log_event_v3(buf, event_len, description_event), + common_header_len(0), post_header_len(NULL), event_type_permutation(0) { DBUG_ENTER("Format_description_log_event::Format_description_log_event(char*,...)"); + if (!Start_log_event_v3::is_valid()) + DBUG_VOID_RETURN; /* sanity check */ buf+= LOG_EVENT_MINIMAL_HEADER_LEN; if ((common_header_len=buf[ST_COMMON_HEADER_LEN_OFFSET]) < OLD_HEADER_LEN) - { - /* this makes is_valid() return false. */ - post_header_len= NULL; DBUG_VOID_RETURN; /* sanity check */ - } number_of_event_types= event_len-(LOG_EVENT_MINIMAL_HEADER_LEN+ST_COMMON_HEADER_LEN_OFFSET+1); DBUG_PRINT("info", ("common_header_len=%d number_of_event_types=%d", diff --git a/sql/log_event.h b/sql/log_event.h index d8f04454a7a..0dd1a9f41e6 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2276,14 +2276,14 @@ public: void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif - Start_log_event_v3(const char* buf, + Start_log_event_v3(const char* buf, uint event_len, const Format_description_log_event* description_event); ~Start_log_event_v3() {} Log_event_type get_type_code() { return START_EVENT_V3;} #ifdef MYSQL_SERVER bool write(IO_CACHE* file); #endif - bool is_valid() const { return 1; } + bool is_valid() const { return server_version[0] != 0; } int get_data_size() { return START_V3_HEADER_LEN; //no variable-sized part From 0827d756276dfaaeac6873daae852c8263146294 Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Wed, 8 Oct 2014 21:54:35 +0530 Subject: [PATCH 023/201] Bug #18808072 MYSQLBINLOG USES LOCALTIME() TO PRINT EVENTS, CAUSES KERNEL MUTEX CONTENTION Problem: For every event read, mysqlbinlog calls localtime() which in turn calls stat(/etc/localtime) which is causing kernel mutex contention. Analysis and Fix: localtime() calls stat(/etc/localtime) for every instance of the call where as localtime_r() the reentrant version was optimized to store the read only tz internal structure. Hence it will not call stat(/etc/localtime). It will call only once at the beginning. The mysql server is calling localtime_r() and mysqlbinlog tool is one place where we are still using localtime(). Once the process (mysqlbinlog) is started if timezone is changed it will be not picked up the the process and it will continue with the same values as the beginning of the process. This behavior is in-lined with mysql server. Also adding localtime_r() and gmtime_r() support for windows. --- client/mysqlbinlog.cc | 3 ++- cmake/os/WindowsCache.cmake | 6 +++--- include/my_pthread.h | 16 +++++++++++++--- mysys/my_wincond.c | 24 +----------------------- sql/log_event.cc | 5 ----- 5 files changed, 19 insertions(+), 35 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index dbc30680959..73a801c4b21 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, 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 @@ -2102,6 +2102,7 @@ int main(int argc, char** argv) DBUG_PROCESS(argv[0]); my_init_time(); // for time functions + tzset(); // set tzname if (load_defaults("my", load_default_groups, &argc, &argv)) exit(1); diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 897012896c8..bbed14556b9 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, 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 @@ -88,7 +88,7 @@ SET(HAVE_GETRLIMIT CACHE INTERNAL "") SET(HAVE_GETRUSAGE CACHE INTERNAL "") SET(HAVE_GETTIMEOFDAY CACHE INTERNAL "") SET(HAVE_GETWD CACHE INTERNAL "") -SET(HAVE_GMTIME_R CACHE INTERNAL "") +SET(HAVE_GMTIME_R 1 CACHE INTERNAL "") SET(HAVE_GRP_H CACHE INTERNAL "") SET(HAVE_IA64INTRIN_H CACHE INTERNAL "") SET(HAVE_IEEEFP_H CACHE INTERNAL "") @@ -109,7 +109,7 @@ SET(HAVE_LANGINFO_H CACHE INTERNAL "") SET(HAVE_LDIV 1 CACHE INTERNAL "") SET(HAVE_LIMITS_H 1 CACHE INTERNAL "") SET(HAVE_LOCALE_H 1 CACHE INTERNAL "") -SET(HAVE_LOCALTIME_R CACHE INTERNAL "") +SET(HAVE_LOCALTIME_R 1 CACHE INTERNAL "") SET(HAVE_LOG2 CACHE INTERNAL "") SET(HAVE_LONGJMP 1 CACHE INTERNAL "") SET(HAVE_LRAND48 CACHE INTERNAL "") diff --git a/include/my_pthread.h b/include/my_pthread.h index 20d929ba8eb..92676bd727c 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, 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 @@ -142,8 +142,18 @@ int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); int pthread_attr_destroy(pthread_attr_t *connect_att); int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void)); -struct tm *localtime_r(const time_t *timep,struct tm *tmp); -struct tm *gmtime_r(const time_t *timep,struct tm *tmp); + +static inline struct tm *localtime_r(const time_t *timep, struct tm *tmp) +{ + localtime_s(tmp, timep); + return tmp; +} + +static inline struct tm *gmtime_r(const time_t *clock, struct tm *res) +{ + gmtime_s(res, clock); + return res; +} void pthread_exit(void *a); int pthread_join(pthread_t thread, void **value_ptr); diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c index 4794bb391b6..ac0166c87b8 100644 --- a/mysys/my_wincond.c +++ b/mysys/my_wincond.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, 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 @@ -344,26 +344,4 @@ int pthread_attr_destroy(pthread_attr_t *connect_att) return 0; } -/**************************************************************************** -** Fix localtime_r() to be a bit safer -****************************************************************************/ - -struct tm *localtime_r(const time_t *timep,struct tm *tmp) -{ - if (*timep == (time_t) -1) /* This will crash win32 */ - { - bzero(tmp,sizeof(*tmp)); - } - else - { - struct tm *res=localtime(timep); - if (!res) /* Wrong date */ - { - bzero(tmp,sizeof(*tmp)); /* Keep things safe */ - return 0; - } - *tmp= *res; - } - return tmp; -} #endif /* __WIN__ */ diff --git a/sql/log_event.cc b/sql/log_event.cc index 403c512ab3a..38efb2a9c6b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2162,13 +2162,8 @@ void Log_event::print_timestamp(IO_CACHE* file, time_t* ts) DBUG_ENTER("Log_event::print_timestamp"); if (!ts) ts = &when; -#ifdef MYSQL_SERVER // This is always false struct tm tm_tmp; localtime_r(ts,(res= &tm_tmp)); -#else - res=localtime(ts); -#endif - my_b_printf(file,"%02d%02d%02d %2d:%02d:%02d", res->tm_year % 100, res->tm_mon+1, From 57eec7bc29734d55600260f93d191664b15ef7cf Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 13 Oct 2014 09:52:28 +0200 Subject: [PATCH 024/201] Bug#17633291: SET PROPER COMPILE OPTIONS FOR CLANG Bug#17959689: MAKE GCC AND CLANG GIVE CONSISTENT COMPILATION WARNINGS Bug#18313717: ENABLE -WERROR IN MAINTANER MODE WHEN COMPILING WITH CLANG Bug#18510941: REMOVE CMAKE WORKAROUNDS FOR OLDER VERSIONS OF OS X/XCODE Backport from mysql-5.6 to mysql-5.5 --- CMakeLists.txt | 92 +++++++++++-------- client/CMakeLists.txt | 6 ++ .../build_configurations/mysql_release.cmake | 19 ++-- cmake/compile_flags.cmake | 44 +++++++++ cmake/maintainer.cmake | 67 +++++++------- cmake/os/Darwin.cmake | 21 +---- configure.cmake | 9 -- libmysqld/CMakeLists.txt | 8 ++ libmysqld/examples/CMakeLists.txt | 6 ++ plugin/auth/CMakeLists.txt | 4 +- scripts/CMakeLists.txt | 12 ++- sql/CMakeLists.txt | 8 ++ storage/innobase/CMakeLists.txt | 8 ++ 13 files changed, 187 insertions(+), 117 deletions(-) create mode 100644 cmake/compile_flags.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index f43473f76a5..8ce5f4734c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,10 +27,12 @@ ENDIF() # We use the LOCATION target property (CMP0026) # and get_target_property() for non-existent targets (CMP0045) +# and INSTALL_NAME_DIR (CMP0042) IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR CMAKE_VERSION VERSION_GREATER "3.0.0") CMAKE_POLICY(SET CMP0026 OLD) CMAKE_POLICY(SET CMP0045 OLD) + CMAKE_POLICY(SET CMP0042 OLD) ENDIF() MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") @@ -73,11 +75,9 @@ ENDIF() SET(BUILDTYPE_DOCSTRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel") - + IF(WITH_DEBUG) SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING ${BUILDTYPE_DOCSTRING} FORCE) - SET(MYSQL_MAINTAINER_MODE ON CACHE BOOL - "MySQL maintainer-specific development environment") IF(UNIX AND NOT APPLE) # Compiling with PIC speeds up embedded build, on PIC sensitive systems # Predefine it to ON, in case user chooses to build embedded. @@ -107,6 +107,15 @@ ELSE() ENDIF() PROJECT(${MYSQL_PROJECT_NAME}) +# Maintainer mode is default on only for Linux debug builds using GCC/G++ +IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND + CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX) + SET(MYSQL_MAINTAINER_MODE ON CACHE BOOL + "MySQL maintainer-specific development environment") + ENDIF() +ENDIF() + IF(BUILD_CONFIG) INCLUDE( ${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake) @@ -130,38 +139,12 @@ FOREACH(_base ENDFOREACH() - # Following autotools tradition, add preprocessor definitions # specified in environment variable CPPFLAGS IF(DEFINED ENV{CPPFLAGS}) ADD_DEFINITIONS($ENV{CPPFLAGS}) ENDIF() -# -# Control aspects of the development environment which are -# specific to MySQL maintainers and developers. -# -INCLUDE(maintainer) - -OPTION(MYSQL_MAINTAINER_MODE - "MySQL maintainer-specific development environment" OFF) - -# Whether the maintainer mode compiler options should be enabled. -IF(MYSQL_MAINTAINER_MODE) - IF(CMAKE_C_COMPILER_ID MATCHES "GNU") - SET_MYSQL_MAINTAINER_GNU_C_OPTIONS() - ENDIF() - IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS() - ENDIF() - IF(CMAKE_C_COMPILER_ID MATCHES "Intel") - SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS() - ENDIF() - IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS() - ENDIF() -ENDIF() - # Add macros INCLUDE(character_sets) INCLUDE(zlib) @@ -192,7 +175,6 @@ OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED) - include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) # We need some extra FAIL_REGEX patterns @@ -373,13 +355,13 @@ MYSQL_CHECK_READLINE() # not run with the warning options as to not perturb fragile checks # (i.e. do not make warnings into errors). # -IF(MYSQL_MAINTAINER_MODE) - # Set compiler flags required under maintainer mode. - MESSAGE(STATUS "C warning options: ${MY_MAINTAINER_C_WARNINGS}") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}") - MESSAGE(STATUS "C++ warning options: ${MY_MAINTAINER_CXX_WARNINGS}") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}") -ENDIF() +# Why doesn't these flags affect the entire build? +# Because things may already have been included with ADD_SUBDIRECTORY +# +OPTION(MYSQL_MAINTAINER_MODE + "MySQL maintainer-specific development environment" OFF) + +INCLUDE(maintainer) IF(NOT WITHOUT_SERVER) SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "") @@ -395,7 +377,6 @@ ADD_SUBDIRECTORY(regex) ADD_SUBDIRECTORY(mysys) ADD_SUBDIRECTORY(libmysql) - IF(WITH_UNIT_TESTS) ENABLE_TESTING() ENDIF() @@ -487,7 +468,6 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") ) INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR}) - IF(UNIX) INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) ENDIF() @@ -507,3 +487,37 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") ENDIF() INCLUDE(CPack) + +# C compiler flags consist of: +# CPPFLAGS Taken from environment, see above. +# ADD_DEFINITIONS In each individual CMakeLists.txt +# CMAKE_C_FLAGS From command line. +# We extend these in maintainer.cmake +# ENV{CFLAGS} From environment, but environment is ignored if +# CMAKE_C_FLAGS is also given on command line +# CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} +# We extend these in compiler_options.cmake +# +# Note that CMakeCache.txt contains cmake builtins for these variables, +# *not* the values that will actually be used: + +IF(CMAKE_GENERATOR MATCHES "Makefiles") + MESSAGE(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +ENDIF() +GET_PROPERTY(cwd_definitions DIRECTORY PROPERTY COMPILE_DEFINITIONS) +MESSAGE(STATUS "COMPILE_DEFINITIONS: ${cwd_definitions}") +MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") +MESSAGE(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") +IF(CMAKE_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Makefiles") + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKEBT) + MESSAGE(STATUS "CMAKE_C_FLAGS_${CMAKEBT}: ${CMAKE_C_FLAGS_${CMAKEBT}}") + MESSAGE(STATUS "CMAKE_CXX_FLAGS_${CMAKEBT}: ${CMAKE_CXX_FLAGS_${CMAKEBT}}") +ENDIF() +IF(NOT CMAKE_GENERATOR MATCHES "Makefiles") + MESSAGE(STATUS "CMAKE_C_FLAGS_DEBUG: ${CMAKE_C_FLAGS_DEBUG}") + MESSAGE(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") + MESSAGE(STATUS + "CMAKE_C_FLAGS_RELWITHDEBINFO: ${CMAKE_C_FLAGS_RELWITHDEBINFO}") + MESSAGE(STATUS + "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") +ENDIF() diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 4d8fab3f4b9..0d67cf2e0d4 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -35,6 +35,12 @@ ENDIF(UNIX) MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test) SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS") +# mysqltest has unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) +IF(HAVE_WERROR_FLAG) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(mysqltest.cc COMPILE_FLAGS "-Wno-error") +ENDIF() TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index e2b815ef830..b0d3de10299 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -189,15 +189,16 @@ IF(UNIX) ENDIF() ENDIF() - # OSX flags - IF(APPLE) - SET(COMMON_C_FLAGS "-g -fno-common -fno-strict-aliasing") - # XXX: why are we using -felide-constructors on OSX? - SET(COMMON_CXX_FLAGS "-g -fno-common -felide-constructors -fno-strict-aliasing") - SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}") - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${COMMON_C_FLAGS}") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${COMMON_CXX_FLAGS}") + # Default Clang flags + IF(CMAKE_C_COMPILER_ID MATCHES "Clang") + SET(COMMON_C_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}") + ENDIF() + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(COMMON_CXX_FLAGS "-g -fno-omit-frame-pointer -fno-strict-aliasing") + SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}") ENDIF() # Solaris flags diff --git a/cmake/compile_flags.cmake b/cmake/compile_flags.cmake new file mode 100644 index 00000000000..5e872f981b0 --- /dev/null +++ b/cmake/compile_flags.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2014, 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_COMPILE_FLAGS( COMPILE_FLAGS ) +MACRO(ADD_COMPILE_FLAGS) + SET(FILES "") + SET(FLAGS "") + SET(COMPILE_FLAGS) + FOREACH(ARG ${ARGV}) + IF(ARG STREQUAL "COMPILE_FLAGS") + SET(COMPILE_FLAGS "COMPILE_FLAGS") + ELSEIF(COMPILE_FLAGS) + LIST(APPEND FLAGS ${ARG}) + ELSE() + LIST(APPEND FILES ${ARG}) + ENDIF() + ENDFOREACH() + FOREACH(FILE ${FILES}) + FOREACH(FLAG ${FLAGS}) + GET_SOURCE_FILE_PROPERTY(PROP ${FILE} COMPILE_FLAGS) + IF(NOT PROP) + SET(PROP ${FLAG}) + ELSE() + SET(PROP "${PROP} ${FLAG}") + ENDIF() + SET_SOURCE_FILES_PROPERTIES( + ${FILE} PROPERTIES COMPILE_FLAGS "${PROP}" + ) + ENDFOREACH() + ENDFOREACH() +ENDMACRO() diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index a91905a281b..c537d00260f 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, 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 @@ -13,42 +13,39 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -INCLUDE(CheckCCompilerFlag) +# Common warning flags for GCC, G++, Clang and Clang++ +SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security") +MY_CHECK_C_COMPILER_FLAG("-Wvla" HAVE_WVLA) # Requires GCC 4.3+ or Clang +IF(HAVE_WVLA) + SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla") +ENDIF() -# Setup GCC (GNU C compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS) - SET(MY_MAINTAINER_WARNINGS - "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror") - CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement" - HAVE_DECLARATION_AFTER_STATEMENT) - IF(HAVE_DECLARATION_AFTER_STATEMENT) - SET(MY_MAINTAINER_DECLARATION_AFTER_STATEMENT - "-Wdeclaration-after-statement") - ENDIF() - SET(MY_MAINTAINER_C_WARNINGS - "${MY_MAINTAINER_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}" - CACHE STRING "C warning options used in maintainer builds.") - # Do not make warnings in checks into errors. - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error") -ENDMACRO() +# Common warning flags for GCC and Clang +SET(MY_C_WARNING_FLAGS + "${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement") -# Setup G++ (GNU C++ compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS) - SET(MY_MAINTAINER_CXX_WARNINGS - "${MY_MAINTAINER_WARNINGS} -Wno-unused-parameter -Woverloaded-virtual" - CACHE STRING "C++ warning options used in maintainer builds.") -ENDMACRO() +# Common warning flags for G++ and Clang++ +SET(MY_CXX_WARNING_FLAGS + "${MY_WARNING_FLAGS} -Woverloaded-virtual -Wno-unused-parameter") -# Setup ICC (Intel C Compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS) - SET(MY_MAINTAINER_WARNINGS "-Wcheck") - SET(MY_MAINTAINER_C_WARNINGS "${MY_MAINTAINER_WARNINGS}" - CACHE STRING "C warning options used in maintainer builds.") -ENDMACRO() +# Extra warning flags for Clang++ +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(MY_CXX_WARNING_FLAGS + "${MY_CXX_WARNING_FLAGS} -Wno-null-conversion -Wno-unused-private-field") +ENDIF() -# Setup ICPC (Intel C++ Compiler) warning options. -MACRO(SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS) - SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_WARNINGS}" - CACHE STRING "C++ warning options used in maintainer builds.") -ENDMACRO() +# Turn on Werror (warning => error) when using maintainer mode. +IF(MYSQL_MAINTAINER_MODE) + SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -Werror") + SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Werror") + SET(COMPILE_FLAG_WERROR 1) +ENDIF() +# Set warning flags for GCC/Clang +IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_WARNING_FLAGS}") +ENDIF() +# Set warning flags for G++/Clang++ +IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}") +ENDIF() diff --git a/cmake/os/Darwin.cmake b/cmake/os/Darwin.cmake index 0d8bac106f0..4ac72070e8b 100644 --- a/cmake/os/Darwin.cmake +++ b/cmake/os/Darwin.cmake @@ -1,5 +1,4 @@ -# Copyright (c) 2010 Sun Microsystems, Inc. -# Use is subject to license terms. +# Copyright (c) 2010, 2014, 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 @@ -15,21 +14,3 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This file includes OSX specific options and quirks, related to system checks - -# Workaround for CMake bug#9051 -# (CMake does not pass CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET when -# running TRY_COMPILE) - -IF(CMAKE_OSX_SYSROOT) - SET(ENV{CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}) -ENDIF() -IF(CMAKE_OSX_SYSROOT) - SET(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSX_DEPLOYMENT_TARGET}) -ENDIF() - -IF(CMAKE_OSX_DEPLOYMENT_TARGET) - # Workaround linker problems on OSX 10.4 - IF(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.5") - ADD_DEFINITIONS(-fno-common) - ENDIF() -ENDIF() diff --git a/configure.cmake b/configure.cmake index c3ac3a8222f..28974a84c49 100644 --- a/configure.cmake +++ b/configure.cmake @@ -53,15 +53,6 @@ IF(NOT SYSTEM_TYPE) ENDIF() -# Always enable -Wall for gnu C/C++ -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter") -ENDIF() -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -ENDIF() - - IF(CMAKE_COMPILER_IS_GNUCXX) # MySQL "canonical" GCC flags. At least -fno-rtti flag affects # ABI and cannot be simply removed. diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index f31aa819ed5..abbf887e1e6 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -93,6 +93,14 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ) +# These files have unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) +IF(HAVE_WERROR_FLAG) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(../sql/filesort.cc COMPILE_FLAGS "-Wno-error") + ADD_COMPILE_FLAGS(../sql/opt_range.cc COMPILE_FLAGS "-Wno-error") +ENDIF() + ADD_CONVENIENCE_LIBRARY(sql_embedded ${SQL_EMBEDDED_SOURCES}) DTRACE_INSTRUMENT(sql_embedded) ADD_DEPENDENCIES(sql_embedded GenError GenServerSource) diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index c4055a56303..55b2079c320 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -33,6 +33,12 @@ IF(UNIX) ENDIF(UNIX) MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc) +# mysqltest has unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) +IF(HAVE_WERROR_FLAG) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(../../client/mysqltest.cc COMPILE_FLAGS "-Wno-error") +ENDIF() TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver) diff --git a/plugin/auth/CMakeLists.txt b/plugin/auth/CMakeLists.txt index 6a9c31f82ce..9a3682a5e96 100644 --- a/plugin/auth/CMakeLists.txt +++ b/plugin/auth/CMakeLists.txt @@ -28,7 +28,9 @@ MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c MODULE_ONLY) CHECK_CXX_SOURCE_COMPILES( -"#define _GNU_SOURCE +"#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include int main() { struct ucred cred; diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 5e03acb654b..05bf8530a26 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -88,16 +88,20 @@ ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") # Strip maintainer mode options if necessary - STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}") - STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_C_WARNING_FLAGS}" "" CFLAGS + "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_CXX_WARNING_FLAGS}" "" CXXFLAGS + "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") ENDFOREACH() ELSE() # Strip maintainer mode options if necessary - STRING(REPLACE "${MY_MAINTAINER_C_WARNINGS}" "" CFLAGS "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - STRING(REPLACE "${MY_MAINTAINER_CXX_WARNINGS}" "" CXXFLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_C_WARNING_FLAGS}" "" CFLAGS + "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + STRING(REPLACE "${MY_CXX_WARNING_FLAGS}" "" CXXFLAGS + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") ENDIF() IF(UNIX) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index c19ea9b17bd..030f183d5f7 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -80,6 +80,14 @@ SET (SQL_SOURCE ${GEN_SOURCES} ${MYSYS_LIBWRAP_SOURCE}) +# These files have unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) +IF(HAVE_WERROR_FLAG) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(filesort.cc COMPILE_FLAGS "-Wno-error") + ADD_COMPILE_FLAGS(opt_range.cc COMPILE_FLAGS "-Wno-error") +ENDIF() + MYSQL_ADD_PLUGIN(partition ha_partition.cc STORAGE_ENGINE DEFAULT STATIC_ONLY RECOMPILE_FOR_EMBEDDED) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 01034eede69..4f000434eb9 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -247,6 +247,14 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ut/ut0byte.c ut/ut0dbg.c ut/ut0list.c ut/ut0mem.c ut/ut0rbt.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c ut/ut0bh.c) +# These files have unused result errors, so we skip Werror +CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR) +IF(HAVE_WERROR) + INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake) + ADD_COMPILE_FLAGS(page/page0zip.c COMPILE_FLAGS "-Wno-error") + ADD_COMPILE_FLAGS(ut/ut0ut.c COMPILE_FLAGS "-Wno-error") +ENDIF() + IF(WITH_INNODB) # Legacy option SET(WITH_INNOBASE_STORAGE_ENGINE TRUE) From 635f38a2c1bb0d4e2d382a04e03d7ab716915e45 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Fri, 17 Oct 2014 11:14:26 +0530 Subject: [PATCH 025/201] Bug #14486004 MYSQL_SETPERMISSION DOES NOT QUOTE USER NAMES Description: Certain operations using the client tool 'mysql\_setpermisson' which uses username of the format "xxx-yyy" results in a syntax error. Analysis: The user name variable ( $user ) was not quoted properly in the 'mysql\_setpermission' script. As a result, while granting user privileges for a user with username of the format 'xxx-yyy', results in a syntax error. Fix: The escape sequence has been applied for the user variable in the script file. Note: Test case is not added for this fix. 'mysql\_setpermission' executable resides in different directories on pb2 machines and on local boxes. Hence the test case cannot be made generic. --- scripts/mysql_setpermission.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index f23011a5ae6..48f0b09b566 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -264,13 +264,13 @@ sub addall { foreach $host (@hosts) { # user privileges: SELECT if (($todo == 2) || ($todo == 3)) { - $sth = $dbh->do("GRANT SELECT ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 4) { # user privileges: SELECT,INSERT,UPDATE,DELETE - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 5) { # user privileges: SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES - $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO $user@\"$host\" IDENTIFIED BY \'$pass\'") || die $dbh->errstr; + $sth = $dbh->do("GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,LOCK TABLES,CREATE TEMPORARY TABLES ON $db.* TO \'$user\'@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 6) { # all privileges $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; From 5c41d52904be50c77b204a8450829fbeacbf080f Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Mon, 20 Oct 2014 15:43:28 +0530 Subject: [PATCH 026/201] The test case innodb.foreign-keys is failing in pb2 5.5. This is because some of the tables are created in InnoDB and some tables are created in MyISAM. We need to create all tables on InnoDB. Fix is to add engine=innodb to the CREATE TABLE statements. approved in IM by Marko and Vasil. --- mysql-test/suite/innodb/r/foreign-keys.result | 4 ++-- mysql-test/suite/innodb/t/foreign-keys.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/innodb/r/foreign-keys.result b/mysql-test/suite/innodb/r/foreign-keys.result index be8d27b152c..53ddf618244 100644 --- a/mysql-test/suite/innodb/r/foreign-keys.result +++ b/mysql-test/suite/innodb/r/foreign-keys.result @@ -5,8 +5,8 @@ CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT, PRIMARY KEY (`department_id`)) engine=innodb; CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT, -`title_reporter_fk` INT, PRIMARY KEY (`title_id`)); -CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)); +`title_reporter_fk` INT, PRIMARY KEY (`title_id`)) engine=innodb; +CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)) engine=innodb; ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES `people` (`people_id`); ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people` diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test index 45642cf28a7..2d586e2d6be 100644 --- a/mysql-test/suite/innodb/t/foreign-keys.test +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -10,9 +10,9 @@ CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT, PRIMARY KEY (`department_id`)) engine=innodb; CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT, -`title_reporter_fk` INT, PRIMARY KEY (`title_id`)); +`title_reporter_fk` INT, PRIMARY KEY (`title_id`)) engine=innodb; -CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)); +CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)) engine=innodb; ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES `people` (`people_id`); From 349ac8c9b3bec7f56922ab55a2504e225b03ba87 Mon Sep 17 00:00:00 2001 From: Arun Kuruvila Date: Tue, 21 Oct 2014 16:25:35 +0530 Subject: [PATCH 027/201] Bug #16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5 Description:- Replace, the string replacement utility fails on the windows platform. Analysis:- The utility takes files and multiple string pairs as input. In the windows platform, the utility maps the standard input incorrectly (Considers 0 as the fd for standard input instead of 2048 on windows). Hence when the input file is supplied to the utility due to the incorrect mapping, a bad file descriptor error is generated causing the utility to exit with an error. Fix:- "my_fileno()" is used for getting the correct file despscriptor for standard input. --- extra/replace.c | 4 ++-- mysql-test/mysql-test-run.pl | 8 ++++++++ mysql-test/r/windows.result | 5 +++++ mysql-test/t/windows.test | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/extra/replace.c b/extra/replace.c index 53bc1fd925a..53d9830ad40 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2014, 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 @@ -1020,7 +1020,7 @@ FILE *in,*out; updated=retain=0; reset_buffer(); - while ((error=fill_buffer_retaining(fileno(in),retain)) > 0) + while ((error=fill_buffer_retaining(my_fileno(in),retain)) > 0) { end_of_line=buffer ; buffer[bufbytes]=0; /* Sentinel */ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7ddde593503..f82e67ef5b6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2461,6 +2461,14 @@ sub environment_setup { "$path_client_bindir/perror"); $ENV{'MY_PERROR'}= native_path($exe_perror); + # ---------------------------------------------------- + # replace + # ---------------------------------------------------- + my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'), + "$basedir/extra/replace", + "$path_client_bindir/replace"); + $ENV{'REPLACE'}= native_path($exe_replace); + # Create an environment variable to make it possible # to detect that valgrind is being used from test cases $ENV{'VALGRIND_TEST'}= $opt_valgrind; diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result index d0cdd858d4a..05e4600f4b7 100644 --- a/mysql-test/r/windows.result +++ b/mysql-test/r/windows.result @@ -60,3 +60,8 @@ SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'socket'; VARIABLE_NAME SOCKET +# +# Bug#16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5 +# +xyz +def diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test index b7d31948d23..617daba6b8e 100644 --- a/mysql-test/t/windows.test +++ b/mysql-test/t/windows.test @@ -98,3 +98,19 @@ deallocate prepare abc; SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'socket'; + +--echo # +--echo # Bug#16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5 +--echo # + +# Creating a temporary text file. +--write_file $MYSQL_TMP_DIR/bug16581605.txt +abc +def +EOF + +#REPLACE.EXE UTILITY will work fine after the fix. +--exec $REPLACE abc xyz < $MYSQL_TMP_DIR/bug16581605.txt + +#Cleanup +remove_file $MYSQL_TMP_DIR/bug16581605.txt; From db14346db1109dc0d2320d507746742aa42d7a37 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 21 Oct 2014 14:48:58 +0200 Subject: [PATCH 028/201] Bug#19775856: When the socket option is relative, mysqld startup script fails on CentOS 6 --- packaging/rpm-oel/mysql-systemd-start | 22 +++++++++++++++++++--- packaging/rpm-oel/mysql.init | 8 ++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/packaging/rpm-oel/mysql-systemd-start b/packaging/rpm-oel/mysql-systemd-start index 9cb2a25c990..8670f889574 100644 --- a/packaging/rpm-oel/mysql-systemd-start +++ b/packaging/rpm-oel/mysql-systemd-start @@ -8,10 +8,19 @@ # post mode : ping server until answer is received # +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + install_db () { # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode) - datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p') - + datadir=$(get_option mysqld datadir "/var/lib/mysql") + # Restore log, dir, perms and SELinux contexts [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 log=/var/log/mysqld.log @@ -35,9 +44,16 @@ pinger () { # Wait for ping to answer to signal startup completed, # might take a while in case of e.g. crash recovery # MySQL systemd service will timeout script if no answer + datadir=$(get_option mysqld datadir "/var/lib/mysql") + socket=$(get_option mysqld socket "$datadir/mysql.sock") + case $socket in + /*) adminsocket="$socket" ;; + *) adminsocket="$datadir/$socket" ;; + esac + while /bin/true ; do sleep 1 - mysqladmin ping >/dev/null 2>&1 && break + mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping >/dev/null 2>&1 && break done exit 0 } diff --git a/packaging/rpm-oel/mysql.init b/packaging/rpm-oel/mysql.init index d6f8f023850..79c8a8daa7d 100644 --- a/packaging/rpm-oel/mysql.init +++ b/packaging/rpm-oel/mysql.init @@ -50,11 +50,15 @@ errlogfile="$result" get_mysql_option mysqld_safe pid-file "/var/run/mysqld/mysqld.pid" mypidfile="$result" +case $socketfile in + /*) adminsocket="$socketfile" ;; + *) adminsocket="$datadir/$socketfile" ;; +esac start(){ [ -x $exec ] || exit 5 # check to see if it's already running - RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` + RESPONSE=$(/usr/bin/mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping 2>&1) if [ $? = 0 ]; then # already running, do nothing action $"Starting $prog: " /bin/true @@ -107,7 +111,7 @@ start(){ ret=0 TIMEOUT="$STARTTIMEOUT" while [ $TIMEOUT -gt 0 ]; do - RESPONSE=`/usr/bin/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` && break + RESPONSE=$(/usr/bin/mysqladmin --no-defaults --socket="$adminsocket" --user=UNKNOWN_MYSQL_USER ping 2>&1) && break echo "$RESPONSE" | grep -q "Access denied for user" && break if ! /bin/kill -0 $safe_pid 2>/dev/null; then echo "MySQL Daemon failed to start." From 54fd994a5d580f2bec526ef02794c5cda8f5cfad Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 21 Oct 2014 16:19:47 +0200 Subject: [PATCH 029/201] Fix changelog entries build failure --- support-files/mysql.spec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index ee95e65780b..8548be8ca4c 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -499,12 +499,14 @@ mkdir debug # Attempt to remove any optimisation flags from the debug build CFLAGS=`echo " ${CFLAGS} " | \ sed -e 's/ -O[0-9]* / /' \ + -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ -e 's/ -unroll2 / /' \ -e 's/ -ip / /' \ -e 's/^ //' \ -e 's/ $//'` CXXFLAGS=`echo " ${CXXFLAGS} " | \ sed -e 's/ -O[0-9]* / /' \ + -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ -e 's/ -unroll2 / /' \ -e 's/ -ip / /' \ -e 's/^ //' \ From b821be7df5e6f570d4d475a6c59ee0a47d7ace7b Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Thu, 23 Oct 2014 06:56:47 +0200 Subject: [PATCH 030/201] Rpm 4.9 and newer is more strict regarding weekday in %changelog --- support-files/mysql.spec.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 8548be8ca4c..e45573a6d77 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1252,12 +1252,12 @@ echo "=====" >> $STATUS_HISTORY * Mon Jun 11 2012 Joerg Bruehe - Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging. - + * Wed Sep 28 2011 Joerg Bruehe - Fix duplicate mentioning of "mysql_plugin" and its manual page, it is better to keep alphabetic order in the files list (merging!). - + * Wed Sep 14 2011 Joerg Bruehe - Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace @@ -1290,7 +1290,7 @@ echo "=====" >> $STATUS_HISTORY * Fri Aug 19 2011 Joerg Bruehe - Null-upmerge the fix of bug#37165: This spec file is not affected. -- Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}". +- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}". * Fri Aug 12 2011 Daniel Fischer @@ -1311,13 +1311,13 @@ echo "=====" >> $STATUS_HISTORY not in an RPM upgrade. This affects both the "mkdir" and the call of "mysql_install_db". -* Thu Feb 09 2011 Joerg Bruehe +* Wed Feb 09 2011 Joerg Bruehe - Fix bug#56581: If an installation deviates from the default file locations ("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade) should still work, and use these locations. The problem was that the fix for bug#27072 did not check for local settings. - + * Mon Jan 31 2011 Joerg Bruehe - Install the new "manifest" files: "INFO_SRC" and "INFO_BIN". @@ -1432,7 +1432,7 @@ echo "=====" >> $STATUS_HISTORY - Fix some problems with the directives around "tcmalloc" (experimental), remove erroneous traces of the InnoDB plugin (that is 5.1 only). -* Fri Oct 06 2009 Magnus Blaudd +* Tue Oct 06 2009 Magnus Blaudd - Removed mysql_fix_privilege_tables @@ -1550,7 +1550,7 @@ echo "=====" >> $STATUS_HISTORY * Thu Nov 30 2006 Joerg Bruehe -- Call "make install" using "benchdir_root=%{_datadir}", +- Call "make install" using "benchdir_root=%%{_datadir}", because that is affecting the regression test suite as well. * Thu Nov 16 2006 Joerg Bruehe @@ -1629,7 +1629,7 @@ echo "=====" >> $STATUS_HISTORY - Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS -* Wed Mar 07 2006 Kent Boortz +* Tue Mar 07 2006 Kent Boortz - Changed product name from "Community Edition" to "Community Server" @@ -1667,7 +1667,7 @@ echo "=====" >> $STATUS_HISTORY - Added zlib to the list of (static) libraries installed - Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld) - Compile MySQL with bundled zlib -- Fixed %packager name to "MySQL Production Engineering Team" +- Fixed %%packager name to "MySQL Production Engineering Team" * Mon Dec 05 2005 Joerg Bruehe @@ -1817,7 +1817,7 @@ echo "=====" >> $STATUS_HISTORY - ISAM and merge storage engines were purged. As well as appropriate tools and manpages (isamchk and isamlog) -* Thu Dec 31 2004 Lenz Grimmer +* Fri Dec 31 2004 Lenz Grimmer - enabled the "Archive" storage engine for the max binary - enabled the "CSV" storage engine for the max binary @@ -1877,7 +1877,7 @@ echo "=====" >> $STATUS_HISTORY - marked /etc/logrotate.d/mysql as a config file (BUG 2156) -* Fri Dec 13 2003 Lenz Grimmer +* Sat Dec 13 2003 Lenz Grimmer - fixed file permissions (BUG 1672) @@ -2019,7 +2019,7 @@ echo "=====" >> $STATUS_HISTORY - Added separate libmysql_r directory; now both a threaded and non-threaded library is shipped. -* Wed Sep 28 1999 David Axmark +* Tue Sep 28 1999 David Axmark - Added the support-files/my-example.cnf to the docs directory. From c978f6988d17819db4be8fb440f5841d48f4a68a Mon Sep 17 00:00:00 2001 From: Marko Makela Date: Mon, 27 Oct 2014 14:27:08 +0200 Subject: [PATCH 031/201] Bug#19584379 Reporting corruption may corrupt the innodb data dictionary dict_set_corrupted(): Use the canonical way of searching for less-than-equal (PAGE_CUR_LE) and then checking low_match. The code that was introduced in MySQL 5.5.17 in Bug#11830883 SUPPORT "CORRUPTED" BIT FOR INNODB TABLES AND INDEXES could position the cursor on the page supremum, and then attempt to overwrite non-existing 7th field of the 1-field supremum record. Approved by Jimmy Yang --- mysql-test/suite/innodb/r/innodb_corrupt_bit.result | 1 + mysql-test/suite/innodb/t/innodb_corrupt_bit.test | 12 +++++++++--- storage/innobase/dict/dict0dict.c | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result index 7e8792bb5b4..fac00bd0510 100644 --- a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result +++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result @@ -78,4 +78,5 @@ z 31 32 drop table corrupt_bit_test_Ä; +DROP DATABASE pad; SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test index b8d19ddfcee..3554e5e06b1 100644 --- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test +++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test @@ -16,14 +16,20 @@ # It instructs InnoDB to try to evict pages from the buffer pool when # change buffering is possible, so that the change buffer will be used # whenever possible. --- error 0,ER_UNKNOWN_SYSTEM_VARIABLE SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug; --- error 0,ER_UNKNOWN_SYSTEM_VARIABLE SET GLOBAL innodb_change_buffering_debug = 1; # Turn off Unique Check to create corrupted index with dup key SET UNIQUE_CHECKS=0; +CREATE DATABASE pad; +let $i=345; +while ($i) +{ + --eval CREATE TABLE pad.t$i (a INT PRIMARY KEY) ENGINE=InnoDB; + dec $i; +} + -- enable_query_log set names utf8; @@ -119,6 +125,6 @@ select z from corrupt_bit_test_Ä limit 10; # Drop table drop table corrupt_bit_test_Ä; +DROP DATABASE pad; --- error 0, ER_UNKNOWN_SYSTEM_VARIABLE SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 2bf774ad039..63571bb26c8 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -5498,11 +5498,11 @@ dict_set_corrupted( dict_index_copy_types(tuple, sys_index, 2); - btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE, + btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE, BTR_MODIFY_LEAF, &cursor, 0, __FILE__, __LINE__, &mtr); - if (cursor.up_match == dtuple_get_n_fields(tuple)) { + if (cursor.low_match == dtuple_get_n_fields(tuple)) { /* UPDATE SYS_INDEXES SET TYPE=index->type WHERE TABLE_ID=index->table->id AND INDEX_ID=index->id */ ulint len; From ffc33cffe3e06956537b03b688543caa367eba5b Mon Sep 17 00:00:00 2001 From: Annamalai Gurusami Date: Wed, 29 Oct 2014 16:53:53 +0530 Subject: [PATCH 032/201] Bug #19908343 SERVER CRASHES WHEN EXECUTING ALTER TABLE Problem: In the function dict_foreign_remove_from_cache(), the rb tree was updated without actually verifying whether the given foreign key object is there in the rb tree or not. There can be an existing foreign key object with the same id in the rb tree, which must not be removed. Such a scenario comes when an attempt is made to add a foreign key object with a duplicate identifier. Solution: When the foreign key object is removed from the dictionary cache, ensure that the foreign key object removed from the rbt is the correct one. rb#7168 approved by Jimmy and Marko. --- storage/innobase/dict/dict0dict.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 63571bb26c8..c298f867ae3 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -2529,8 +2529,15 @@ dict_foreign_remove_from_cache( foreign); rbt = foreign->referenced_table->referenced_rbt; + if (rbt != NULL) { - rbt_delete(rbt, foreign->id); + const ib_rbt_node_t* node + = rbt_lookup(rbt, foreign->id); + dict_foreign_t* val = *(dict_foreign_t**) node->value; + + if (val == foreign) { + rbt_delete(rbt, foreign->id); + } } } @@ -2543,7 +2550,13 @@ dict_foreign_remove_from_cache( rbt = foreign->foreign_table->foreign_rbt; if (rbt != NULL) { - rbt_delete(rbt, foreign->id); + const ib_rbt_node_t* node + = rbt_lookup(rbt, foreign->id); + dict_foreign_t* val = *(dict_foreign_t**) node->value; + + if (val == foreign) { + rbt_delete(rbt, foreign->id); + } } } From a265914018f06c036f8de8504725ff191b42ba92 Mon Sep 17 00:00:00 2001 From: Marko Makela Date: Thu, 30 Oct 2014 08:53:46 +0200 Subject: [PATCH 033/201] Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 CAUSES INFINITE PAGE SPLIT The debug configuration parameter innodb_optimistic_insert_debug which was introduced for testing corner cases in B-tree handling had a bug in it. The value 1 would trigger an infinite sequence of page splits. Fix: When the value 1 is specified, disable this debug feature. Approved by Yasufumi Kinoshita --- mysql-test/suite/innodb/r/insert_debug.result | 11 +++++++++++ mysql-test/suite/innodb/t/insert_debug.test | 16 ++++++++++++++++ storage/innobase/include/btr0cur.ic | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/innodb/r/insert_debug.result create mode 100644 mysql-test/suite/innodb/t/insert_debug.test diff --git a/mysql-test/suite/innodb/r/insert_debug.result b/mysql-test/suite/innodb/r/insert_debug.result new file mode 100644 index 00000000000..0d176afa116 --- /dev/null +++ b/mysql-test/suite/innodb/r/insert_debug.result @@ -0,0 +1,11 @@ +# +# Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 +# CAUSES INFINITE PAGE SPLIT +# +SET GLOBAL innodb_change_buffering_debug=1; +SET GLOBAL innodb_limit_optimistic_insert_debug=1; +CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB +PARTITION BY HASH (c1) PARTITIONS 15; +DROP TABLE t1; +SET GLOBAL innodb_change_buffering_debug=0; +SET GLOBAL innodb_limit_optimistic_insert_debug=0; diff --git a/mysql-test/suite/innodb/t/insert_debug.test b/mysql-test/suite/innodb/t/insert_debug.test new file mode 100644 index 00000000000..96ac0473f77 --- /dev/null +++ b/mysql-test/suite/innodb/t/insert_debug.test @@ -0,0 +1,16 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +--echo # +--echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 +--echo # CAUSES INFINITE PAGE SPLIT +--echo # + +SET GLOBAL innodb_change_buffering_debug=1; +SET GLOBAL innodb_limit_optimistic_insert_debug=1; +CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB +PARTITION BY HASH (c1) PARTITIONS 15; +DROP TABLE t1; + +SET GLOBAL innodb_change_buffering_debug=0; +SET GLOBAL innodb_limit_optimistic_insert_debug=0; diff --git a/storage/innobase/include/btr0cur.ic b/storage/innobase/include/btr0cur.ic index 5fc4651ca13..5d122101fab 100644 --- a/storage/innobase/include/btr0cur.ic +++ b/storage/innobase/include/btr0cur.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2014, 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 @@ -28,7 +28,7 @@ Created 10/16/1994 Heikki Tuuri #ifdef UNIV_DEBUG # define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE)\ -if (btr_cur_limit_optimistic_insert_debug\ +if (btr_cur_limit_optimistic_insert_debug > 1\ && (NREC) >= (ulint)btr_cur_limit_optimistic_insert_debug) {\ CODE;\ } From 73b99f055ea6604f6a58580e8831b70a542a0443 Mon Sep 17 00:00:00 2001 From: mithun Date: Mon, 3 Nov 2014 18:10:28 +0530 Subject: [PATCH 034/201] Bug #19372926 : 5.5.38 FAILS FUNC_MATH MTR TEST. Issue : ------- This seems for some platform -(LONGLONG_MIN) is not flagged as out of range. Fix: ---- Fix is backported from mysql-5.6 bug 14314156. Fixed by adding an explicit test for this value in Item_func_neg::int_op(). sql/item_func.cc: For some platforms we need special handling of LONGLONG_MIN to guarantee overflow. --- sql/item_func.cc | 8 +++++++- sql/item_func.h | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 96cf07550d8..bef48b1bfed 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1760,7 +1760,13 @@ longlong Item_func_neg::int_op() if ((null_value= args[0]->null_value)) return 0; if (args[0]->unsigned_flag && - (ulonglong) value > (ulonglong) LONGLONG_MAX + 1) + (ulonglong) value > (ulonglong) LONGLONG_MAX + 1ULL) + return raise_integer_overflow(); + // For some platforms we need special handling of LONGLONG_MIN to + // guarantee overflow. + if (value == LONGLONG_MIN && + !args[0]->unsigned_flag && + !unsigned_flag) return raise_integer_overflow(); return check_integer_overflow(-value, !args[0]->unsigned_flag && value < 0); } diff --git a/sql/item_func.h b/sql/item_func.h index 47a467f3580..fc9fa4a65fb 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1,7 +1,7 @@ #ifndef ITEM_FUNC_INCLUDED #define ITEM_FUNC_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2014, 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 @@ -251,7 +251,8 @@ public: inline longlong check_integer_overflow(longlong value, bool val_unsigned) { if ((unsigned_flag && !val_unsigned && value < 0) || - (!unsigned_flag && val_unsigned && (ulonglong) value > LONGLONG_MAX)) + (!unsigned_flag && val_unsigned && + (ulonglong) value > (ulonglong) LONGLONG_MAX)) return raise_integer_overflow(); return value; } From 0773c7f422c426e5693fc901df9999092e56aef3 Mon Sep 17 00:00:00 2001 From: Balasubramanian Kandasamy Date: Tue, 4 Nov 2014 08:30:23 +0100 Subject: [PATCH 035/201] Added sles11 repo packages --- CMakeLists.txt | 1 + packaging/rpm-sles/CMakeLists.txt | 28 + packaging/rpm-sles/filter-provides.sh | 6 + packaging/rpm-sles/filter-requires.sh | 6 + packaging/rpm-sles/my.cnf | 31 + packaging/rpm-sles/my_config.h | 30 + packaging/rpm-sles/mysql-systemd-start | 66 + packaging/rpm-sles/mysql.conf | 1 + packaging/rpm-sles/mysql.init | 236 ++++ packaging/rpm-sles/mysql.spec.in | 1646 ++++++++++++++++++++++++ packaging/rpm-sles/mysqld.service | 48 + 11 files changed, 2099 insertions(+) create mode 100644 packaging/rpm-sles/CMakeLists.txt create mode 100644 packaging/rpm-sles/filter-provides.sh create mode 100644 packaging/rpm-sles/filter-requires.sh create mode 100644 packaging/rpm-sles/my.cnf create mode 100644 packaging/rpm-sles/my_config.h create mode 100644 packaging/rpm-sles/mysql-systemd-start create mode 100644 packaging/rpm-sles/mysql.conf create mode 100644 packaging/rpm-sles/mysql.init create mode 100644 packaging/rpm-sles/mysql.spec.in create mode 100644 packaging/rpm-sles/mysqld.service diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ce5f4734c9..d770dad3ab0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,6 +411,7 @@ IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(internal) ENDIF() ADD_SUBDIRECTORY(packaging/rpm-oel) + ADD_SUBDIRECTORY(packaging/rpm-sles) ENDIF() INCLUDE(cmake/abi_check.cmake) diff --git a/packaging/rpm-sles/CMakeLists.txt b/packaging/rpm-sles/CMakeLists.txt new file mode 100644 index 00000000000..b5ffaa15565 --- /dev/null +++ b/packaging/rpm-sles/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 2012, 2013, 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 + + +IF(UNIX) + SET(prefix ${CMAKE_INSTALL_PREFIX}) + SET(SPECFILENAME "mysql.spec") + # Left in current directory, to be taken during build + CONFIGURE_FILE(mysql.spec.in ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY) + FOREACH(fedfile my.cnf my_config.h mysql.init + mysqld.service mysql-systemd-start mysql.conf + filter-requires.sh filter-provides.sh) + CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY) + ENDFOREACH() +ENDIF() + diff --git a/packaging/rpm-sles/filter-provides.sh b/packaging/rpm-sles/filter-provides.sh new file mode 100644 index 00000000000..bc166bd82d0 --- /dev/null +++ b/packaging/rpm-sles/filter-provides.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# + +/usr/lib/rpm/perl.prov $* | +sed -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d' + diff --git a/packaging/rpm-sles/filter-requires.sh b/packaging/rpm-sles/filter-requires.sh new file mode 100644 index 00000000000..3fdf43870fa --- /dev/null +++ b/packaging/rpm-sles/filter-requires.sh @@ -0,0 +1,6 @@ +#! /bin/bash +# + +/usr/lib/rpm/perl.req $* | +sed -e '/perl(GD)/d' -e '/perl(hostnames)/d' -e '/perl(lib::mtr.*/d' -e '/perl(lib::v1.*/d' -e '/perl(mtr_.*/d' -e '/perl(My::.*/d' + diff --git a/packaging/rpm-sles/my.cnf b/packaging/rpm-sles/my.cnf new file mode 100644 index 00000000000..3415115655e --- /dev/null +++ b/packaging/rpm-sles/my.cnf @@ -0,0 +1,31 @@ +# For advice on how to change settings please see +# http://dev.mysql.com/doc/refman/5.5/en/server-configuration-defaults.html + +[mysqld] +# +# Remove leading # and set to the amount of RAM for the most important data +# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. +# innodb_buffer_pool_size = 128M +# +# Remove leading # to turn on a very important data integrity option: logging +# changes to the binary log between backups. +# log_bin +# +# Remove leading # to set options mainly useful for reporting servers. +# The server defaults are faster for transactions and fast SELECTs. +# Adjust sizes as needed, experiment to find the optimal values. +# join_buffer_size = 128M +# sort_buffer_size = 2M +# read_rnd_buffer_size = 2M +datadir=/var/lib/mysql +socket=/var/lib/mysql/mysql.sock + +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +# Recommended in standard MySQL setup +#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + +[mysqld_safe] +log-error=/var/log/mysql/mysqld.log +pid-file=/var/run/mysql/mysqld.pid diff --git a/packaging/rpm-sles/my_config.h b/packaging/rpm-sles/my_config.h new file mode 100644 index 00000000000..75dc5e1d754 --- /dev/null +++ b/packaging/rpm-sles/my_config.h @@ -0,0 +1,30 @@ +/* + * Fedora supports multi arch: having 32 and 64 versions of MySQL + * installed at the same time. my_config.h will differ due arch + * dependent defs creating a file conflict. We move arch specific + * headers to arch specific file names and include the correct arch + * specific file by installing this generic file. + * + */ + +#if defined(__i386__) +#include "my_config_i386.h" +#elif defined(__ia64__) +#include "my_config_ia64.h" +#elif defined(__powerpc__) +#include "my_config_ppc.h" +#elif defined(__powerpc64__) +#include "my_config_ppc64.h" +#elif defined(__s390x__) +#include "my_config_s390x.h" +#elif defined(__s390__) +#include "my_config_s390.h" +#elif defined(__sparc__) && defined(__arch64__) +#include "my_config_sparc64.h" +#elif defined(__sparc__) +#include "my_config_sparc.h" +#elif defined(__x86_64__) +#include "my_config_x86_64.h" +#else +#error "This MySQL devel package does not work your architecture?" +#endif diff --git a/packaging/rpm-sles/mysql-systemd-start b/packaging/rpm-sles/mysql-systemd-start new file mode 100644 index 00000000000..dc151e0322c --- /dev/null +++ b/packaging/rpm-sles/mysql-systemd-start @@ -0,0 +1,66 @@ +#! /bin/bash +# +# Scripts to run by MySQL systemd service +# +# Needed argument: pre | post +# +# pre mode : try to run mysql_install_db and fix perms and SELinux contexts +# post mode : ping server until answer is received +# + +install_db () { + # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode) + datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p') + + # Restore log, dir, perms and SELinux contexts + [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1 + log=/var/log/mysqld.log + [ -e $log ] || touch $log + chmod 0640 $log + chown mysql:mysql $log || exit 1 + if [ -x /usr/sbin/restorecon ]; then + /usr/sbin/restorecon "$datadir" + /usr/sbin/restorecon $log + fi + + # If special mysql dir is in place, skip db install + [ -d "$datadir/mysql" ] && exit 0 + + # Create initial db + /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql + + # Create a file to trigger execution of mysql_secure_installation + # after server has started + touch "$datadir"/.phase_two_required + + exit 0 +} + +pinger () { + # Wait for ping to answer to signal startup completed, + # might take a while in case of e.g. crash recovery + # MySQL systemd service will timeout script if no answer + ret=1 + while /bin/true ; do + sleep 1 + mysqladmin ping >/dev/null 2>&1 && ret=0 && break + done + + # If server has been started successfully and file created in + # install_db step is present we run mysql_secure_installation + if [ $ret -eq 0 -a -e "$datadir"/.phase_two_required -a -x /usr/bin/mysql_secure_installation ] ; then + /usr/bin/mysql_secure_installation --use-default --defaults-file=/etc/my.cnf + rm -f "$datadir"/.phase_two_required + fi + + exit 0 +} + +# main +case $1 in + "pre") install_db ;; + "post") pinger ;; +esac + +exit 0 + diff --git a/packaging/rpm-sles/mysql.conf b/packaging/rpm-sles/mysql.conf new file mode 100644 index 00000000000..74cd5f836e7 --- /dev/null +++ b/packaging/rpm-sles/mysql.conf @@ -0,0 +1 @@ +d /var/run/mysqld 0755 mysql mysql - diff --git a/packaging/rpm-sles/mysql.init b/packaging/rpm-sles/mysql.init new file mode 100644 index 00000000000..50ca4c9033c --- /dev/null +++ b/packaging/rpm-sles/mysql.init @@ -0,0 +1,236 @@ +#! /bin/bash +# + +# MySQL Database start/stop script + +# chkconfig: - 64 36 +# description: MySQL Database +# processname: mysqld +# config: /etc/my.cnf +# pidfile: /var/run/mysql/mysqld.pid + +# Comments to support LSB init script conventions +### BEGIN INIT INFO +# Provides: mysql +# Required-Start: $network $remote_fs +# Required-Stop: $network $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 6 +# Short-Description: MySQL Database +# Description: MySQL Database +### END INIT INFO + +# +# https://en.opensuse.org/openSUSE:Packaging_init_scripts#Exit_Status_Codes +# + +[ -e /etc/rc.status ] && . /etc/rc.status + +rc_reset + +STARTTIMEOUT=180 +STOPTIMEOUT=60 +PROG=/usr/bin/mysqld_safe + +[ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql + +# Lock directory +lockfile=/var/lock/subsys/mysql + +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + +datadir=$(get_option mysqld datadir "/var/lib/mysql") +socket=$(get_option mysqld socket "$datadir/mysql.sock") +pidfile=$(get_option mysqld_safe pid-file "/var/run/mysql/mysqld.pid") +logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") + +install_db () { + # Note: something different than datadir=/var/lib/mysql requires + # SELinux policy changes (in enforcing mode) + datadir=$(get_option mysqld datadir "/var/lib/mysql") + logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log") + + # Restore log, dir, perms and SELinux contexts + [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || return 1 + + [ -e $logfile ] || touch $logfile || return 1 + chmod 0640 $logfile + chown mysql:mysql $logfile || return 1 + if [ -x /usr/sbin/restorecon ]; then + /usr/sbin/restorecon "$datadir" + /usr/sbin/restorecon $logfile + fi + + # If special mysql dir is in place, skip db install + [ -d "$datadir/mysql" ] && return 0 + + # Create initial db + /usr/bin/mysql_install_db --datadir="$datadir" --rpm --user=mysql + return $? +} + +# Wait for ping to answer to signal startup completed, +# might take a while in case of e.g. crash recovery +pinger () { + mysqld_safe_pid=$1 + timer=$STARTTIMEOUT + ret=0 + while [ $timer -gt 0 ]; do + sleep 1 + mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 && break + timer=$(expr $timer - 1) + + # Check if mysqld_safe is still alive, if not there is no hope + if ! kill -0 $mysqld_safe_pid >/dev/null 2>&1 ; then + ret=1 + break + fi + done + + # Did we timeout? + if [ $timer = 0 ]; then + echo "MySQL Database start up timeout after ${STARTTIMEOUT}s" + ret=1 + fi + return $ret +} + +# Check if mysqld is running +chk_running () { + ret=0 + if [ -e "$pidfile" ]; then + pid=$(cat "$pidfile") || ret=4 + else + ret=7 + fi + + # Check if $pid is a mysqld pid + if [ $ret -eq 0 ]; then + [ -L "/proc/$pid/exe" ] || ret=7 + fi + + if [ $ret -eq 0 ]; then + exec=$(readlink "/proc/$pid/exe") || ret=7 + fi + + if [ $ret -eq 0 ]; then + [ "x$(basename $exec)" = "xmysqld" ] || ret=7 + fi + return $ret +} + +start () { + if chk_running && mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 ; then + echo -n "Starting service MySQL:" + rc_reset ; rc_status -v ; rc_exit + fi + + if ! install_db; then + echo -n "MySQL Database could not initialize data directory:" + rc_failed 6 ; rc_status -v ; rc_exit + fi + + $PROG --basedir=/usr --datadir="$datadir" --pid-file="$pidfile" >/dev/null 2>&1 & + if pinger $! ; then + echo -n "Starting service MySQL:" + touch $lockfile + rc_reset + else + echo -n "Failed to start service MySQL:" + rc_failed 3 + fi + rc_status -v +} + +stop () { + chk_running + ret=$? + if [ $ret -ne 0 ]; then + echo -n "Shutting down service MySQL:" + rc_reset ; rc_status -v ; return 0 + fi + + # chk_running has verified this works + pid=$(cat "$pidfile") + + # We use a signal to avoid having to know the root password + # Send single kill command and then wait + if kill $pid >/dev/null 2>&1; then + timer=$STOPTIMEOUT + while [ $timer -gt 0 ]; do + kill -0 $pid >/dev/null 2>&1 || break + sleep 1 + timer=$(expr $timer - 1) + done + else + echo -n "Shutting down service MySQL:" + rc_failed 4 ; rc_status -v ; rc_exit + fi + + if [ $timer -eq 0 ]; then + echo -n "Failed to stop service MySQL:" + rc_failed 1 + else + rm -f $lockfile + rm -f "$socketfile" + echo -n "Shutting down service MySQL:" + rc_reset + fi + rc_status -v +} + +restart () { + stop + start +} + +reload () { + ret=0 + if chk_running && mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 ; then + pid=$(cat "$pidfile") + kill -HUP $pid >/dev/null 2>&1 + echo -n "Reloading service MySQL:" + rc_reset + else + echo -n "Reloading of service MySQL failed:" + rc_failed 7 + fi + rc_status -v +} + +condrestart () { + if chk_running && mysqladmin --no-defaults --socket="$socket" ping >/dev/null 2>&1 ; then + restart + fi +} + +status () { + echo -n "Checking for service MySQL:" + checkproc mysqld + rc_status -v +} + +case "$1" in + start ) start ;; + stop ) stop ;; + restart) restart ;; + status ) status ;; + condrestart ) condrestart ;; + reload|force-reload) reload ;; + + *) echo $"Usage: $0 {start|stop|restart|condrestart|status|reload|force-reload}"; exit 1 ;; +esac + +rc_exit + + + + + diff --git a/packaging/rpm-sles/mysql.spec.in b/packaging/rpm-sles/mysql.spec.in new file mode 100644 index 00000000000..75ed42a1cae --- /dev/null +++ b/packaging/rpm-sles/mysql.spec.in @@ -0,0 +1,1646 @@ +# Copyright (c) 2000, 2014, 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; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston +# MA 02110-1301 USA. + + +%global mysql_vendor Oracle and/or its affiliates +%global mysqldatadir /var/lib/mysql + +# By default, a build will include the bundeled "yaSSL" library for SSL. +%{?with_ssl: %global ssl_option -DWITH_SSL=%{with_ssl}} + +# Regression tests may take a long time, override the default to skip them +%{!?runselftest:%global runselftest 0} + +%{!?with_systemd: %global systemd 0} +%{!?with_debuginfo: %global nodebuginfo 1} +%{!?product_suffix: %global product_suffix community} +%{!?feature_set: %global feature_set community} +%{!?compilation_comment_release: %global compilation_comment_release MySQL Community Server - (GPL)} +%{!?compilation_comment_debug: %global compilation_comment_debug MySQL Community Server - Debug (GPL)} +%{!?src_base: %global src_base mysql} + +%global src_dir %{src_base}-%{version} + +# multiarch +%global multiarchs ppc %{power64} %{ix86} x86_64 %{sparc} + +# No debuginfo for now, ships /usr/sbin/mysqld-debug and libmysqlcliet-debug.a +%if 0%{?nodebuginfo} +%global _enable_debug_package 0 +%global debug_package %{nil} +%global __os_install_post /usr/lib/rpm/brp-compress %{nil} +%endif + +%if 0%{?commercial} +%global license_files_server %{src_dir}/LICENSE.mysql +%global license_type Commercial +%else +%global license_files_server %{src_dir}/COPYING %{src_dir}/README +%global license_type GPLv2 +%endif + +%if 0%{?sles_version} == 011 +%global dist .sles11 +%global sles11 1 +%endif + +Name: mysql-%{product_suffix} +Summary: A very fast and reliable SQL database server +Group: Applications/Databases +Version: @VERSION@ +Release: 2%{?commercial:.1}%{?dist} +License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{?license_type} license as shown in the Description field. +Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz +URL: http://www.mysql.com/ +Packager: MySQL Release Engineering +Vendor: %{mysql_vendor} +Source1: mysql-systemd-start +Source2: mysqld.service +Source3: mysql.conf +Source4: my_config.h +Source90: filter-provides.sh +Source91: filter-requires.sh +BuildRequires: cmake +BuildRequires: perl +BuildRequires: libaio-devel +BuildRequires: ncurses-devel +BuildRequires: openssl-devel +BuildRequires: zlib-devel +%if 0%{?systemd} +BuildRequires: systemd +%endif +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +%if 0%{?rhel} > 6 +# For rpm => 4.9 only: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering +%global __requires_exclude ^perl\\((GD|hostnames|lib::mtr|lib::v1|mtr_|My::) +%global __provides_exclude_from ^(/usr/share/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$ +%else +# https://fedoraproject.org/wiki/EPEL:Packaging#Generic_Filtering_on_EPEL6 +%global __perl_provides %{SOURCE90} +%global __perl_requires %{SOURCE91} +%endif + +%description +The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, +and robust SQL (Structured Query Language) database server. MySQL Server +is intended for mission-critical, heavy-load production systems as well +as for embedding into mass-deployed software. MySQL is a trademark of +%{mysql_vendor} + +The MySQL software has Dual Licensing, which means you can use the MySQL +software free of charge under the GNU General Public License +(http://www.gnu.org/licenses/). You can also purchase commercial MySQL +licenses from %{mysql_vendor} if you do not wish to be bound by the terms of +the GPL. See the chapter "Licensing and Support" in the manual for +further info. + +The MySQL web site (http://www.mysql.com/) provides the latest +news and information about the MySQL software. Also please see the +documentation and the manual for more information. + +%package server +Summary: A very fast and reliable SQL database server +Group: Applications/Databases +Requires: coreutils +Requires: grep +Requires: procps +Requires: shadow-utils +Requires: net-tools +Requires: perl-base +%if 0%{?commercial} +Provides: MySQL-server-advanced = %{version}-%{release} +Obsoletes: MySQL-server-advanced < %{version}-%{release} +Obsoletes: mysql-community-server < %{version}-%{release} +Requires: mysql-commercial-client = %{version}-%{release} +Requires: mysql-commercial-common = %{version}-%{release} +%else +Provides: MySQL-server = %{version}-%{release} +Requires: mysql-community-client = %{version}-%{release} +Requires: mysql-community-common = %{version}-%{release} +%endif +Obsoletes: MySQL-server < %{version}-%{release} +Obsoletes: mysql < %{version}-%{release} +Obsoletes: mysql-tools < %{version}-%{release} +Obsoletes: mariadb-server +Obsoletes: mariadb-galera-server +Provides: mysql = %{version}-%{release} +Provides: mysql-tools = %{version}-%{release} +%if 0%{?systemd} +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +%else +PreReq: insserv +PreReq: sed +PreReq: pwdutils +%endif +Conflicts: otherproviders(mysql) +Conflicts: otherproviders(mysql-debug) +Conflicts: otherproviders(mysql-tools) + +%description server +The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, +and robust SQL (Structured Query Language) database server. MySQL Server +is intended for mission-critical, heavy-load production systems as well +as for embedding into mass-deployed software. MySQL is a trademark of +%{mysql_vendor} + +The MySQL software has Dual Licensing, which means you can use the MySQL +software free of charge under the GNU General Public License +(http://www.gnu.org/licenses/). You can also purchase commercial MySQL +licenses from %{mysql_vendor} if you do not wish to be bound by the terms of +the GPL. See the chapter "Licensing and Support" in the manual for +further info. + +The MySQL web site (http://www.mysql.com/) provides the latest news and +information about the MySQL software. Also please see the documentation +and the manual for more information. + +This package includes the MySQL server binary as well as related utilities +to run and administer a MySQL server. + +%package client +Summary: MySQL database client applications and tools +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-client-advanced = %{version}-%{release} +Obsoletes: MySQL-client-advanced < %{version}-%{release} +Obsoletes: mysql-community-client < %{version}-%{release} +Requires: mysql-commercial-libs = %{version}-%{release} +%else +Provides: MySQL-client = %{version}-%{release} +Requires: mysql-community-libs = %{version}-%{release} +%endif +Obsoletes: MySQL-client < %{version}-%{release} +Provides: mysql-client = %{version}-%{release} +Obsoletes: mysql-client < %{version}-%{release} +Obsoletes: mariadb +Conflicts: otherproviders(mysql-client) + +%description client +This package contains the standard MySQL clients and administration +tools. + +%package common +Summary: MySQL database common files for server and client libs +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-common < %{version}-%{release} +%endif +Provides: mysql-common = %{version}-%{release} + +%description common +This packages contains common files needed by MySQL client library, +MySQL database server, and MySQL embedded server. + + +%package test +Summary: Test suite for the MySQL database server +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-test-advanced = %{version}-%{release} +Obsoletes: MySQL-test-advanced < %{version}-%{release} +Obsoletes: mysql-community-test < %{version}-%{release} +Requires: mysql-commercial-server = %{version}-%{release} +%else +Provides: MySQL-test = %{version}-%{release} +Requires: mysql-community-server = %{version}-%{release} +%endif +Obsoletes: MySQL-test < %{version}-%{release} +Obsoletes: mysql-test < %{version}-%{release} +Obsoletes: mariadb-test +Provides: mysql-test = %{version}-%{release} +Conflicts: otherproviders(mysql-test) + +%description test +This package contains the MySQL regression test suite for MySQL +database server. + + +%package bench +Summary: MySQL benchmark suite +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-bench < %{version}-%{release} +Requires: mysql-commercial-server = %{version}-%{release} +%else +Requires: mysql-community-server = %{version}-%{release} +%endif +Obsoletes: mariadb-bench +Obsoletes: community-mysql-bench < %{version}-%{release} +Obsoletes: mysql-bench < %{version}-%{release} +Provides: mysql-bench = %{version}-%{release} +Conflicts: otherproviders(mysql-bench) + +%description bench +This package contains the MySQL Benchmark Suite for MySQL database +server. + +%package devel +Summary: Development header files and libraries for MySQL database client applications +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-devel-advanced = %{version}-%{release} +Obsoletes: MySQL-devel-advanced < %{version}-%{release} +Obsoletes: mysql-community-devel < %{version}-%{release} +Requires: mysql-commercial-libs = %{version}-%{release} +%else +Provides: MySQL-devel = %{version}-%{release} +Requires: mysql-community-libs = %{version}-%{release} +%endif +Obsoletes: MySQL-devel < %{version}-%{release} +Obsoletes: mysql-devel < %{version}-%{release} +Obsoletes: mariadb-devel +Obsoletes: libmysqlclient-devel < %{version}-%{release} +Provides: mysql-devel = %{version}-%{release} +Provides: libmysqlclient-devel = %{version}-%{release} + +%description devel +This package contains the development header files and libraries necessary +to develop MySQL client applications. + +%package libs +Summary: Shared libraries for MySQL database client applications +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-shared-advanced = %{version}-%{release} +Obsoletes: MySQL-shared-advanced < %{version}-%{release} +Obsoletes: mysql-community-libs < %{version}-%{release} +Requires: mysql-commercial-common = %{version}-%{release} +%else +Provides: MySQL-shared = %{version}-%{release} +Requires: mysql-community-common = %{version}-%{release} +%endif +Obsoletes: MySQL-shared < %{version}-%{release} +Obsoletes: mysql-libs < %{version}-%{release} +Obsoletes: mariadb-libs +Obsoletes: libmysqlclient18 < %{version}-%{release} +Obsoletes: libmysqlclient_r18 < %{version}-%{release} +Provides: mysql-libs = %{version}-%{release} +Provides: libmysqlclient18 = %{version}-%{release} +Provides: libmysqlclient_r18 = %{version}-%{release} + +%description libs +This package contains the shared libraries for MySQL client +applications. + +%package embedded +Summary: MySQL embedded library +Group: Applications/Databases +%if 0%{?commercial} +Provides: MySQL-embedded-advanced = %{version}-%{release} +Obsoletes: MySQL-embedded-advanced < %{version}-%{release} +Obsoletes: mysql-community-embedded < %{version}-%{release} +Requires: mysql-commercial-common = %{version}-%{release} +%else +Provides: MySQL-embedded = %{version}-%{release} +Requires: mysql-community-common = %{version}-%{release} +%endif +Obsoletes: mariadb-embedded +Obsoletes: MySQL-embedded < %{version}-%{release} +Obsoletes: mysql-embedded < %{version}-%{release} +Provides: mysql-embedded = %{version}-%{release} + +%description embedded +This package contains the MySQL server as an embedded library. + +The embedded MySQL server library makes it possible to run a full-featured +MySQL server inside the client application. The main benefits are increased +speed and more simple management for embedded applications. + +The API is identical for the embedded MySQL version and the +client/server version. + +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ + +%package embedded-devel +Summary: Development header files and libraries for MySQL as an embeddable library +Group: Applications/Databases +%if 0%{?commercial} +Obsoletes: mysql-community-embedded-devel < %{version}-%{release} +Requires: mysql-commercial-devel = %{version}-%{release} +Requires: mysql-commercial-embedded = %{version}-%{release} +%else +Requires: mysql-community-devel = %{version}-%{release} +Requires: mysql-community-embedded = %{version}-%{release} +%endif +Obsoletes: mariadb-embedded-devel +Obsoletes: mysql-embedded-devel < %{version}-%{release} +Provides: mysql-embedded-devel = %{version}-%{release} + +%description embedded-devel +This package contains files needed for developing applications using +the embedded version of the MySQL server. + +%prep +%setup -q -T -a 0 -c -n %{src_dir} +pushd %{src_dir} + +%build +# Fail quickly and obviously if user tries to build as root +%if 0%{?runselftest} +if [ "x$(id -u)" = "x0" ] ; then + echo "The MySQL regression tests may fail if run as root." + echo "If you really need to build the RPM as root, use" + echo "--define='runselftest 0' to skip the regression tests." + exit 1 +fi +%endif + + +# Build debug versions of mysqld and libmysqld.a +mkdir debug +( + cd debug + # Attempt to remove any optimisation flags from the debug build + optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /') + cmake ../%{src_dir} \ + -DBUILD_CONFIG=mysql_release \ + -DINSTALL_LAYOUT=RPM \ + -DCMAKE_BUILD_TYPE=Debug \ + -DENABLE_DTRACE=OFF \ + -DCMAKE_C_FLAGS="$optflags" \ + -DCMAKE_CXX_FLAGS="$optflags" \ + -DINSTALL_LIBDIR="%{_lib}/mysql" \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_SQLBENCHDIR=share \ + -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ + -DFEATURE_SET="%{feature_set}" \ + -DWITH_EMBEDDED_SERVER=1 \ + -DWITH_EMBEDDED_SHARED_LIBRARY=1 \ + %{?ssl_option} \ + -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ + -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" + echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG + make %{?_smp_mflags} VERBOSE=1 +) + +# Build full release +mkdir release +( + cd release + cmake ../%{src_dir} \ + -DBUILD_CONFIG=mysql_release \ + -DINSTALL_LAYOUT=RPM \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DENABLE_DTRACE=OFF \ + -DCMAKE_C_FLAGS="%{optflags}" \ + -DCMAKE_CXX_FLAGS="%{optflags}" \ + -DINSTALL_LIBDIR="%{_lib}/mysql" \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_SQLBENCHDIR=share \ + -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ + -DFEATURE_SET="%{feature_set}" \ + -DWITH_EMBEDDED_SERVER=1 \ + -DWITH_EMBEDDED_SHARED_LIBRARY=1 \ + %{?ssl_option} \ + -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ + -DMYSQL_SERVER_SUFFIX="%{?server_suffix}" + echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG + make %{?_smp_mflags} VERBOSE=1 +) + +%install +MBD=$RPM_BUILD_DIR/%{src_dir} + +# Ensure that needed directories exists +install -d -m 0755 %{buildroot}/var/lib/mysql +install -d -m 0755 %{buildroot}/var/run/mysql +install -d -m 0660 %{buildroot}/var/log/mysql + +# Install all binaries +cd $MBD/release +make DESTDIR=%{buildroot} install + +# Install logrotate and autostart +install -D -m 0644 $MBD/release/support-files/mysql-log-rotate %{buildroot}%{_sysconfdir}/logrotate.d/mysql +install -D -m 0644 $MBD/release/packaging/rpm-sles/my.cnf %{buildroot}%{_sysconfdir}/my.cnf +install -d %{buildroot}%{_sysconfdir}/my.cnf.d +%if 0%{?systemd} +install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/mysql-systemd-start +install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/mysqld.service +%else +install -D -m 0755 $MBD/release/packaging/rpm-sles/mysql.init %{buildroot}%{_sysconfdir}/init.d/mysql +%endif +install -D -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/mysql.conf + +# Make library links +install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d +echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf + +# multiarch support +%ifarch %{multiarchs} +mv %{buildroot}/%{_includedir}/mysql/my_config.h \ + %{buildroot}/%{_includedir}/mysql/my_config_%{_arch}.h +install -p -m 0644 %{SOURCE4} %{buildroot}/%{_includedir}/mysql/my_config.h +%endif + +# Remove files pages we explicitly do not want to package +rm -rf %{buildroot}%{_infodir}/mysql.info* +rm -rf %{buildroot}%{_datadir}/mysql/binary-configure +rm -rf %{buildroot}%{_datadir}/mysql/mysql.server +rm -rf %{buildroot}%{_datadir}/mysql/mysqld_multi.server +rm -f %{buildroot}%{_datadir}/mysql/{ndb-config-2-node,config*}.ini +rm -f %{buildroot}%{_datadir}/mysql/my-*.cnf +%if 0%{?systemd} +rm -rf %{buildroot}%{_sysconfdir}/init.d/mysql +%endif +rm -rf %{buildroot}%{_bindir}/mysql_embedded +rm -rf %{buildroot}%{_bindir}/mysql_setpermission +rm -rf %{buildroot}%{_mandir}/man1/mysql_setpermission.1* + +# rcmysql symlink +install -d %{buildroot}%{_sbindir} +ln -sf %{_initrddir}/mysql %{buildroot}%{_sbindir}/rcmysql + +%check +%if 0%{?runselftest} +pushd release +make test VERBOSE=1 +export MTR_BUILD_THREAD=auto +pushd mysql-test +./mtr \ + --mem --parallel=auto --force --retry=0 \ + --mysqld=--binlog-format=mixed \ + --suite-timeout=720 --testcase-timeout=30 \ + --clean-vardir +rm -r $(readlink var) var +%endif + +%pre server +/usr/sbin/groupadd -r mysql >/dev/null 2>&1 || : +/usr/sbin/useradd -g mysql -o -r -d /var/lib/mysql -s /bin/false \ + -c "MySQL Server" -u 60 mysql >/dev/null 2>&1 || : + +%post server +datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p') +/bin/chmod 0755 "$datadir" +/bin/touch /var/log/mysql/mysqld.log +%if 0%{?systemd} +%systemd_post mysqld.service +/sbin/service mysqld enable >/dev/null 2>&1 || : +%else +/sbin/insserv /etc/init.d/mysql +%endif + +%preun server +%if 0%{?systemd} +%systemd_preun mysqld.service +%else +if [ "$1" -eq 0 ]; then + /usr/sbin/rcmysql stop >/dev/null 2>&1 || : + /sbin/insserv /etc/init.d +fi +%endif + +%postun server +%if 0%{?systemd} +%systemd_postun_with_restart mysqld.service +%else +if [ $1 -ge 1 ]; then + /usr/sbin/rcmysql condrestart >/dev/null 2>&1 || : +fi +%endif + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%if 0%{?compatlib} +%post libs-compat -p /sbin/ldconfig + +%postun libs-compat -p /sbin/ldconfig +%endif + +%post embedded -p /sbin/ldconfig + +%postun embedded -p /sbin/ldconfig + +%files server +%defattr(-, root, root, -) +%doc %{?license_files_server} %{src_dir}/Docs/ChangeLog +%doc %{src_dir}/Docs/INFO_SRC* +%doc release/Docs/INFO_BIN* +%attr(644, root, root) %{_mandir}/man1/innochecksum.1* +%attr(644, root, root) %{_mandir}/man1/my_print_defaults.1* +%attr(644, root, root) %{_mandir}/man1/myisam_ftdump.1* +%attr(644, root, root) %{_mandir}/man1/myisamchk.1* +%attr(644, root, root) %{_mandir}/man1/myisamlog.1* +%attr(644, root, root) %{_mandir}/man1/myisampack.1* +%attr(644, root, root) %{_mandir}/man1/mysql_convert_table_format.1* +%attr(644, root, root) %{_mandir}/man1/mysql_fix_extensions.1* +%attr(644, root, root) %{_mandir}/man8/mysqld.8* +%attr(644, root, root) %{_mandir}/man1/mysqld_multi.1* +%attr(644, root, root) %{_mandir}/man1/mysqld_safe.1* +%attr(644, root, root) %{_mandir}/man1/mysqldumpslow.1* +%attr(644, root, root) %{_mandir}/man1/mysql_install_db.1* +%attr(644, root, root) %{_mandir}/man1/mysql_plugin.1* +%attr(644, root, root) %{_mandir}/man1/mysql_secure_installation.1* +%attr(644, root, root) %{_mandir}/man1/mysql_upgrade.1* +%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* +%attr(644, root, root) %{_mandir}/man1/perror.1* +%attr(644, root, root) %{_mandir}/man1/replace.1* +%attr(644, root, root) %{_mandir}/man1/resolve_stack_dump.1* +%attr(644, root, root) %{_mandir}/man1/resolveip.1* + +%config(noreplace) %{_sysconfdir}/my.cnf +%dir %{_sysconfdir}/my.cnf.d + +%attr(755, root, root) %{_bindir}/innochecksum +%attr(755, root, root) %{_bindir}/my_print_defaults +%attr(755, root, root) %{_bindir}/myisam_ftdump +%attr(755, root, root) %{_bindir}/myisamchk +%attr(755, root, root) %{_bindir}/myisamlog +%attr(755, root, root) %{_bindir}/myisampack +%attr(755, root, root) %{_bindir}/mysql_convert_table_format +%attr(755, root, root) %{_bindir}/mysql_fix_extensions +%attr(755, root, root) %{_bindir}/mysql_install_db +%attr(755, root, root) %{_bindir}/mysql_plugin +%attr(755, root, root) %{_bindir}/mysql_secure_installation +%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql +%attr(755, root, root) %{_bindir}/mysql_upgrade +%attr(755, root, root) %{_bindir}/mysql_zap +%attr(755, root, root) %{_bindir}/mysqlbug +%attr(755, root, root) %{_bindir}/mysqld_multi +%attr(755, root, root) %{_bindir}/mysqld_safe +%attr(755, root, root) %{_bindir}/mysqldumpslow +%attr(755, root, root) %{_bindir}/mysqlhotcopy +%attr(755, root, root) %{_bindir}/mysqltest +%attr(755, root, root) %{_bindir}/perror +%attr(755, root, root) %{_bindir}/replace +%attr(755, root, root) %{_bindir}/resolve_stack_dump +%attr(755, root, root) %{_bindir}/resolveip +%if 0%{?systemd} +%attr(755, root, root) %{_bindir}/mysql-systemd-start +%endif +%attr(755, root, root) %{_sbindir}/mysqld +%attr(755, root, root) %{_sbindir}/mysqld-debug +%attr(755, root, root) %{_sbindir}/rcmysql + +%dir %{_libdir}/mysql/plugin +%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so +%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so +%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so +%dir %{_libdir}/mysql/plugin/debug +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so +%if 0%{?commercial} +%attr(755, root, root) %{_libdir}/mysql/plugin/audit_log.so +%attr(755, root, root) %{_libdir}/mysql/plugin/authentication_pam.so +%attr(755, root, root) %{_libdir}/mysql/plugin/thread_pool.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/audit_log.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/authentication_pam.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/thread_pool.so +%endif +%attr(644, root, root) %{_datadir}/mysql/fill_help_tables.sql +%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables.sql +%attr(644, root, root) %{_datadir}/mysql/mysql_system_tables_data.sql +%attr(644, root, root) %{_datadir}/mysql/mysql_test_data_timezone.sql +%attr(644, root, root) %{_datadir}/mysql/mysql-log-rotate +%attr(644, root, root) %{_datadir}/mysql/magic +%attr(644, root, root) %{_prefix}/lib/tmpfiles.d/mysql.conf +%if 0%{?systemd} +%attr(644, root, root) %{_unitdir}/mysqld.service +%else +%attr(755, root, root) %{_sysconfdir}/init.d/mysql +%endif +%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql +%dir %attr(755, mysql, mysql) /var/lib/mysql +%dir %attr(755, mysql, mysql) /var/run/mysql +%dir %attr(660, mysql, mysql) /var/log/mysql + +%files common +%defattr(-, root, root, -) +%doc %{?license_files_server} +%{_datadir}/mysql/charsets/ +%{_datadir}/mysql/errmsg-utf8.txt +%{_datadir}/mysql/czech/ +%{_datadir}/mysql/danish/ +%{_datadir}/mysql/dutch/ +%{_datadir}/mysql/english/ +%{_datadir}/mysql/estonian/ +%{_datadir}/mysql/french/ +%{_datadir}/mysql/german/ +%{_datadir}/mysql/greek/ +%{_datadir}/mysql/hungarian/ +%{_datadir}/mysql/italian/ +%{_datadir}/mysql/japanese/ +%{_datadir}/mysql/korean/ +%{_datadir}/mysql/norwegian-ny/ +%{_datadir}/mysql/norwegian/ +%{_datadir}/mysql/polish/ +%{_datadir}/mysql/portuguese/ +%{_datadir}/mysql/romanian/ +%{_datadir}/mysql/russian/ +%{_datadir}/mysql/serbian/ +%{_datadir}/mysql/slovak/ +%{_datadir}/mysql/spanish/ +%{_datadir}/mysql/swedish/ +%{_datadir}/mysql/ukrainian/ + +%files client +%defattr(-, root, root, -) +%doc %{?license_files_server} +%attr(755, root, root) %{_bindir}/msql2mysql +%attr(755, root, root) %{_bindir}/mysql +%attr(755, root, root) %{_bindir}/mysql_find_rows +%attr(755, root, root) %{_bindir}/mysql_waitpid +%attr(755, root, root) %{_bindir}/mysqlaccess +# XXX: This should be moved to %{_sysconfdir} +%attr(644, root, root) %{_bindir}/mysqlaccess.conf +%attr(755, root, root) %{_bindir}/mysqladmin +%attr(755, root, root) %{_bindir}/mysqlbinlog +%attr(755, root, root) %{_bindir}/mysqlcheck +%attr(755, root, root) %{_bindir}/mysqldump +%attr(755, root, root) %{_bindir}/mysqlimport +%attr(755, root, root) %{_bindir}/mysqlshow +%attr(755, root, root) %{_bindir}/mysqlslap +%attr(755, root, root) %{_bindir}/mysql_config + +%attr(644, root, root) %{_mandir}/man1/msql2mysql.1* +%attr(644, root, root) %{_mandir}/man1/mysql.1* +%attr(644, root, root) %{_mandir}/man1/mysql_find_rows.1* +%attr(644, root, root) %{_mandir}/man1/mysql_waitpid.1* +%attr(644, root, root) %{_mandir}/man1/mysqlaccess.1* +%attr(644, root, root) %{_mandir}/man1/mysqladmin.1* +%attr(644, root, root) %{_mandir}/man1/mysqlbinlog.1* +%attr(644, root, root) %{_mandir}/man1/mysqlcheck.1* +%attr(644, root, root) %{_mandir}/man1/mysqldump.1* +%attr(644, root, root) %{_mandir}/man1/mysqlimport.1* +%attr(644, root, root) %{_mandir}/man1/mysqlshow.1* +%attr(644, root, root) %{_mandir}/man1/mysqlslap.1* + +%files devel +%defattr(-, root, root, -) +%doc %{?license_files_server} +%attr(644, root, root) %{_mandir}/man1/comp_err.1* +%attr(644, root, root) %{_mandir}/man1/mysql_config.1* +%attr(755, root, root) %{_bindir}/mysql_config +%{_includedir}/mysql +%{_datadir}/aclocal/mysql.m4 +%{_libdir}/mysql/libmysqlclient.a +%{_libdir}/mysql/libmysqlclient_r.a +%{_libdir}/mysql/libmysqlservices.a +%{_libdir}/mysql/libmysqlclient_r.so +%{_libdir}/mysql/libmysqlclient.so + +%files libs +%defattr(-, root, root, -) +%doc %{?license_files_server} +%dir %attr(755, root, root) %{_libdir}/mysql +%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf +%{_libdir}/mysql/libmysqlclient.so.18* +%{_libdir}/mysql/libmysqlclient_r.so.18* + +%if 0%{?compatlib} +%files libs-compat +%defattr(-, root, root, -) +%doc %{?license_files_server} +%dir %attr(755, root, root) %{_libdir}/mysql +%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf +%{_libdir}/mysql/libmysqlclient.so.%{compatlib} +%{_libdir}/mysql/libmysqlclient.so.%{compatlib}.0.0 +%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib} +%{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}.0.0 +%endif + +%files test +%defattr(-, root, root, -) +%doc %{?license_files_server} +%attr(-, root, root) %{_datadir}/mysql-test +%attr(755, root, root) %{_bindir}/mysql_client_test +%attr(755, root, root) %{_bindir}/mysql_client_test_embedded +%attr(755, root, root) %{_bindir}/mysqltest +%attr(755, root, root) %{_bindir}/mysqltest_embedded + +%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so +%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so +%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} +%{_datadir}/sql-bench + +%files embedded +%defattr(-, root, root, -) +%doc %{?license_files_server} +%dir %attr(755, root, root) %{_libdir}/mysql +%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf +%attr(755, root, root) %{_libdir}/mysql/libmysqld.so.* + +%files embedded-devel +%defattr(-, root, root, -) +%doc %{?license_files_server} +%attr(644, root, root) %{_libdir}/mysql/libmysqld.a +%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a +%attr(755, root, root) %{_libdir}/mysql/libmysqld.so + +%changelog +* Mon Oct 06 2014 Balasubramanian Kandasamy - 5.5.41-1 +- Backport to 5.5.41 + +* Mon Oct 06 2014 Balasubramanian Kandasamy - 5.7.6-0.2.m16 +- Include boost sources +- Add license info in each subpackage + +* Tue Sep 02 2014 Bjorn Munch - 5.7.6-0.1.m16 +- Updated for 5.7.6 + +* Mon Sep 01 2014 Balasubramanian Kandasamy - 5.7.5-0.2.m15 +- Added openssl_udf.so plugin to commercial packages + +* Mon Jun 30 2014 Balasubramanian Kandasamy - 5.7.5-0.1.m15 +- Port to SLES + +* Thu Jun 26 2014 Balasubramanian Kandasamy - 5.7.5-0.3.m15 +- Resolve embedded-devel conflict issue + +* Wed Jun 25 2014 Balasubramanian Kandasamy - 5.7.5-0.2.m15 +- Add bench package +- Enable dtrace + +* Thu Apr 24 2014 Balasubramanian Kandasamy - 5.7.5-0.1.m15 +- Updated for 5.7.5 + +* Mon Apr 07 2014 Balasubramanian Kandasamy - 5.7.4-0.5.m14 +- Fix Cflags for el7 + +* Mon Mar 31 2014 Balasubramanian Kandasamy - 5.7.4-0.4.m14 +- Support for enterprise packages +- Upgrade from MySQL-* packages + +* Wed Mar 12 2014 Balasubramanian Kandasamy - 5.7.4-0.3.m14 +- Resolve conflict with mysql-libs-compat + +* Thu Mar 06 2014 Balasubramanian Kandasamy - 5.7.4-0.2.m14 +- Resolve conflict issues during upgrade +- Add ha_example.so plugin which is now included + +* Fri Feb 07 2014 Balasubramanian Kandasamy - 5.7.4-0.1.m14 +- 5.7.4 +- Enable shared libmysqld by cmake option +- Move mysqltest and test plugins to test subpackage + +* Mon Nov 18 2013 Balasubramanian Kandasamy - 5.7.3-0.3.m13 +- Fixed isa_bits error + +* Fri Oct 25 2013 Balasubramanian Kandasamy - 5.7.3-0.1.m13 +- Initial 5.7 port + +* Fri Oct 25 2013 Balasubramanian Kandasamy - 5.6.15-1 +- Fixed uln advanced rpm libyassl.a error +- Updated to 5.6.15 + +* Wed Oct 16 2013 Balasubramanian Kandasamy - 5.6.14-3 +- Fixed mysql_install_db usage +- Improved handling of plugin directory + +* Fri Sep 27 2013 Balasubramanian Kandasamy - 5.6.14-2 +- Refresh mysql-install patch and service renaming + +* Mon Sep 16 2013 Balasubramanian Kandasamy - 5.6.14-1 +- Updated to 5.6.14 + +* Wed Sep 04 2013 Balasubramanian Kandasamy - 5.6.13-5 +- Support upgrade from 5.5 ULN packages to 5.6 + +* Tue Aug 27 2013 Balasubramanian Kandasamy - 5.6.13-4 +- Enhanced perl filtering +- Added openssl-devel to buildreq + +* Wed Aug 21 2013 Balasubramanian Kandasamy - 5.6.13-3 +- Removed mysql_embedded binary to resolve multilib conflict issue + +* Fri Aug 16 2013 Balasubramanian Kandasamy - 5.6.13-2 +- Fixed Provides and Obsoletes issues in server, test packages + +* Wed Aug 14 2013 Balasubramanian Kandasamy - 5.6.13-1 +- Updated to 5.6.13 + +* Mon Aug 05 2013 Balasubramanian Kandasamy - 5.6.12-9 +- Added files list to embedded packages + +* Thu Aug 01 2013 Balasubramanian Kandasamy - 5.6.12-8 +- Updated libmysqld.a with libmysqld.so in embedded package + +* Mon Jul 29 2013 Balasubramanian Kandasamy - 5.6.12-7 +- Updated test package dependency from client to server + +* Wed Jul 24 2013 Balasubramanian Kandasamy - 5.6.12-6 +- Added libs-compat dependency under libs package to resolve server + installation conflicts issue. + +* Wed Jul 17 2013 Balasubramanian Kandasamy - 5.6.12-5 +- Removed libmysqlclient.so.16 from libs package + +* Fri Jul 05 2013 Balasubramanian Kandasamy - 5.6.12-4 +- Adjusted to work on OEL6 + +* Wed Jun 26 2013 Balasubramanian Kandasamy - 5.6.12-3 +- Move libs to mysql/ +- Basic multi arch support +- Fix changelog dates + +* Thu Jun 20 2013 Balasubramanian Kandasamy - 5.6.12-2 +- Major cleanup + +* Tue Jun 04 2013 Balasubramanian Kandasamy - 5.6.12-1 +- Updated to 5.6.12 + +* Mon Nov 05 2012 Joerg Bruehe + +- Allow to override the default to use the bundled yaSSL by an option like + --define="with_ssl /path/to/ssl" + +* Wed Oct 10 2012 Bjorn Munch + +- Replace old my-*.cnf config file examples with template my-default.cnf + +* Fri Oct 05 2012 Joerg Bruehe + +- Let the installation use the new option "--random-passwords" of "mysql_install_db". + (Bug# 12794345 Ensure root password) +- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence + of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff). + +* Tue Jul 24 2012 Joerg Bruehe + +- Add a macro "runselftest": + if set to 1 (default), the test suite will be run during the RPM build; + this can be oveeridden via the command line by adding + --define "runselftest 0" + Failures of the test suite will NOT make the RPM build fail! + +* Mon Jul 16 2012 Joerg Bruehe + +- Add the man page for the "mysql_config_editor". + +* Mon Jun 11 2012 Joerg Bruehe + +- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging. + +* Wed Feb 29 2012 Brajmohan Saxena + +- Removal all traces of the readline library from mysql (BUG 13738013) + +* Wed Sep 28 2011 Joerg Bruehe + +- Fix duplicate mentioning of "mysql_plugin" and its manual page, + it is better to keep alphabetic order in the files list (merging!). + +* Wed Sep 14 2011 Joerg Bruehe + +- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace + the RPMs of any configuration (of the current or the preceding release series) + by the new ones. This is done by not using the implicitly generated capabilities + (which include the configuration name) and relying on more generic ones which + just list the function ("server", "client", ...). + The implicit generation cannot be prevented, so all these capabilities must be + explicitly listed in "Obsoletes:" + +* Tue Sep 13 2011 Jonathan Perkin + +- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to + changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install) + this necessitated a move of the libmygcc.a installation to the install + phase, which is probably where it belonged in the first place. + +* Tue Sep 13 2011 Joerg Bruehe + +- "make_win_bin_dist" and its manual are dropped, cmake does it different. + +* Thu Sep 08 2011 Daniel Fischer + +- Add mysql_plugin man page. + +* Tue Aug 30 2011 Tor Didriksen + +- Set CXX=g++ by default to add a dependency on libgcc/libstdc++. + Also, remove the use of the -fno-exceptions and -fno-rtti flags. + TODO: update distro_buildreq/distro_requires + +* Tue Aug 30 2011 Joerg Bruehe + +- Add the manual page for "mysql_plugin" to the server package. + +* Fri Aug 19 2011 Joerg Bruehe + +- Null-upmerge the fix of bug#37165: This spec file is not affected. +- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}". + +* Fri Aug 12 2011 Daniel Fischer + +- Source plugin library files list from cmake-generated file. + +* Mon Jul 25 2011 Chuck Bell + +- Added the mysql_plugin client - enables or disables plugins. + +* Thu Jul 21 2011 Sunanda Menon + +- Fix bug#12561297: Added the MySQL embedded binary + +* Thu Jul 07 2011 Joerg Bruehe + +- Fix bug#45415: "rpm upgrade recreates test database" + Let the creation of the "test" database happen only during a new installation, + not in an RPM upgrade. + This affects both the "mkdir" and the call of "mysql_install_db". + +* Wed Feb 09 2011 Joerg Bruehe + +- Fix bug#56581: If an installation deviates from the default file locations + ("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade) + should still work, and use these locations. + The problem was that the fix for bug#27072 did not check for local settings. + +* Mon Jan 31 2011 Joerg Bruehe + +- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN". + +* Tue Nov 23 2010 Jonathan Perkin + +- EXCEPTIONS-CLIENT has been deleted, remove it from here too +- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing + a '-j' argument to make. + +* Mon Nov 1 2010 Georgi Kodinov + +- Added test authentication (WL#1054) plugin binaries + +* Wed Oct 6 2010 Georgi Kodinov + +- Added example external authentication (WL#1054) plugin binaries + +* Wed Aug 11 2010 Joerg Bruehe + +- With a recent spec file cleanup, names have changed: A "-community" part was dropped. + Reflect that in the "Obsoletes" specifications. +- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM. +- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade". + +* Tue Jun 15 2010 Joerg Bruehe + +- Change the behaviour on installation and upgrade: + On installation, do not autostart the server. + *Iff* the server was stopped before the upgrade is started, this is taken as a + sign the administrator is handling that manually, and so the new server will + not be started automatically at the end of the upgrade. + The start/stop scripts will still be installed, so the server will be started + on the next machine boot. + This is the 5.5 version of fixing bug#27072 (RPM autostarting the server). + +* Tue Jun 1 2010 Jonathan Perkin + +- Implement SELinux checks from distribution-specific spec file. + +* Wed May 12 2010 Jonathan Perkin + +- Large number of changes to build using CMake +- Introduce distribution-specific RPMs +- Drop debuginfo, build all binaries with debug/symbols +- Remove __os_install_post, use native macro +- Remove _unpackaged_files_terminate_build, make it an error to have + unpackaged files +- Remove cluster RPMs + +* Wed Mar 24 2010 Joerg Bruehe + +- Add "--with-perfschema" to the configure options. + +* Mon Mar 22 2010 Joerg Bruehe + +- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64", + mask "rmdir" return code 1. +- Remove "ha_example.*" files from the list, they aren't built. + +* Wed Mar 17 2010 Joerg Bruehe + +- Fix a wrong path name in handling the debug plugins. + +* Wed Mar 10 2010 Joerg Bruehe + +- Take the result of the debug plugin build and put it into the optimized tree, + so that it becomes part of the final installation; + include the files in the packlist. Part of the fixes for bug#49022. + +* Mon Mar 01 2010 Joerg Bruehe + +- Set "Oracle and/or its affiliates" as the vendor and copyright owner, + accept upgrading from packages showing MySQL or Sun as vendor. + +* Fri Feb 12 2010 Joerg Bruehe + +- Formatting changes: + Have a consistent structure of separator lines and of indentation + (8 leading blanks => tab). +- Introduce the variable "src_dir". +- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence + over "CC" ("CXX"). +- Drop the old "with_static" argument analysis, this is not supported + in 5.1 since ages. +- Introduce variables to control the handlers individually, as well + as other options. +- Use the new "--with-plugin" notation for the table handlers. +- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql" + was done back in 2002 already. +- Make "--with-zlib-dir=bundled" the default, add an option to disable it. +- Add missing manual pages to the file list. +- Improve the runtime check for "libgcc.a", protect it against being tried + with the Intel compiler "icc". + +* Mon Jan 11 2010 Joerg Bruehe + +- Change RPM file naming: + - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc". + - Release counts from 1, not 0. + +* Wed Dec 23 2009 Joerg Bruehe + +- The "semisync" plugin file name has lost its introductory "lib", + adapt the file lists for the subpackages. + This is a part missing from the fix for bug#48351. +- Remove the "fix_privilege_tables" manual, it does not exist in 5.5 + (and likely, the whole script will go, too). + +* Mon Nov 16 2009 Joerg Bruehe + +- Fix some problems with the directives around "tcmalloc" (experimental), + remove erroneous traces of the InnoDB plugin (that is 5.1 only). + +* Tue Oct 06 2009 Magnus Blaudd + +- Removed mysql_fix_privilege_tables + +* Fri Oct 02 2009 Alexander Nozdrin + +- "mysqlmanager" got removed from version 5.4, all references deleted. + +* Fri Aug 28 2009 Joerg Bruehe + +- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin. + +* Thu Aug 27 2009 Joerg Bruehe + +- This version does not contain the "Instance manager", "mysqlmanager": + Remove it from the spec file so that packaging succeeds. + +* Mon Aug 24 2009 Jonathan Perkin + +- Add conditionals for bundled zlib and innodb plugin + +* Fri Aug 21 2009 Jonathan Perkin + +- Install plugin libraries in appropriate packages. +- Disable libdaemon_example and ftexample plugins. + +* Thu Aug 20 2009 Jonathan Perkin + +- Update variable used for mysql-test suite location to match source. + +* Fri Nov 07 2008 Joerg Bruehe + +- Correct yesterday's fix, so that it also works for the last flag, + and fix a wrong quoting: un-quoted quote marks must not be escaped. + +* Thu Nov 06 2008 Kent Boortz + +- Removed "mysql_upgrade_shell" +- Removed some copy/paste between debug and normal build + +* Thu Nov 06 2008 Joerg Bruehe + +- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized. + This should cover both gcc and icc flags. Fixes bug#40546. + +* Fri Aug 29 2008 Kent Boortz + +- Removed the "Federated" storage engine option, and enabled in all + +* Tue Aug 26 2008 Joerg Bruehe + +- Get rid of the "warning: Installed (but unpackaged) file(s) found:" + Some generated files aren't needed in RPMs: + - the "sql-bench/" subdirectory + Some files were missing: + - /usr/share/aclocal/mysql.m4 ("devel" subpackage) + - Manual "mysqlbug" ("server" subpackage) + - Program "innochecksum" and its manual ("server" subpackage) + - Manual "mysql_find_rows" ("client" subpackage) + - Script "mysql_upgrade_shell" ("client" subpackage) + - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage) + - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage) + +* Mon Mar 31 2008 Kent Boortz + +- Made the "Federated" storage engine an option +- Made the "Cluster" storage engine and sub packages an option + +* Wed Mar 19 2008 Joerg Bruehe + +- Add the man pages for "ndbd" and "ndb_mgmd". + +* Mon Feb 18 2008 Timothy Smith + +- Require a manual upgrade if the alread-installed mysql-server is + from another vendor, or is of a different major version. + +* Wed May 02 2007 Joerg Bruehe + +- "ndb_size.tmpl" is not needed any more, + "man1/mysql_install_db.1" lacked the trailing '*'. + +* Sat Apr 07 2007 Kent Boortz + +- Removed man page for "mysql_create_system_tables" + +* Wed Mar 21 2007 Daniel Fischer + +- Add debug server. + +* Mon Mar 19 2007 Daniel Fischer + +- Remove Max RPMs; the server RPMs contain a mysqld compiled with all + features that previously only were built into Max. + +* Fri Mar 02 2007 Joerg Bruehe + +- Add several man pages for NDB which are now created. + +* Fri Jan 05 2007 Kent Boortz + +- Put back "libmygcc.a", found no real reason it was removed. + +- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the + correct "libgcc.a" path is returned for the 32/64 bit architecture. + +* Mon Dec 18 2006 Joerg Bruehe + +- Fix the move of "mysqlmanager" to section 8: Directory name was wrong. + +* Thu Dec 14 2006 Joerg Bruehe + +- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql" + in the server RPM. +- The "mysqlmanager" man page got moved from section 1 to 8. + +* Thu Nov 30 2006 Joerg Bruehe + +- Call "make install" using "benchdir_root=%%{_datadir}", + because that is affecting the regression test suite as well. + +* Thu Nov 16 2006 Joerg Bruehe + +- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) + replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading + (bug#22081). + +* Mon Nov 13 2006 Joerg Bruehe + +- Add "--with-partition" t 2006 Joerg Bruehe + +- Use the Perl script to run the tests, because it will automatically check + whether the server is configured with SSL. + +* Tue Jun 27 2006 Joerg Bruehe + +- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216) + +- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade, + there are some more aspects which need to be solved before this is possible. + For now, just ensure the binary "mysql_upgrade" is delivered and installysql.com> + +- To run "mysql_upgrade", we need a running server; + start it in isolation and skip password checks. + +* Sat May 20 2006 Kent Boortz + +- Always compile for PIC, position independent code. + +* Wed May 10 2006 Kent Boortz + +- Use character set "all" when compiling with Cluster, to make Cluster + nodes independent on the character set directory, and the problem + that two RPM sub packages both wants to install this directory. + +* Mon May 01 2006 Kent Boortz + +- Use "./libtool --mode=execute" instead of searching for the + executable in current directory and ".libs". + +* Fri Apr 28 2006 Kent Boortz + +- Install and run "mysql_upgrade" + +* Wed Apr 12 2006 Jim Winstead + +- Remove sql-bench, and MySQL-bench RPM (will be built as an independent + project from the mysql-bench repository) + +* Tue Apr 11 2006 Jim Winstead + +- Remove old mysqltestmanager and related programs +* Sat Apr 01 2006 Kent Boortz + +- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS + +* Tue Mar 07 2006 Kent Boortz + +- Changed product name from "Community Edition" to "Community Server" + +* Mon Mar 06 2006 Kent Boortz + +- Fast mutexes is now disabled by default, but should be + used in Linux builds. + +* Mon Feb 20 2006 Kent Boortz + +- Reintroduced a max build +- Limited testing of 'debug' and 'max' servers +- Berkeley DB only in 'max' + +* Mon Feb 13 2006 Joerg Bruehe + +- Use "-i" on "make test-force"; + this is essential for later evaluation of this log file. + +* Thu Feb 09 2006 Kent Boortz + +- Pass '-static' to libtool, link static with our own libraries, dynamic + with system libraries. Link with the bundled zlib. + +* Wed Feb 08 2006 Kristian Nielsen + +- Modified RPM spec to match new 5.1 debug+max combined community packaging. + +* Sun Dec 18 2005 Kent Boortz + +- Added "client/mysqlslap" + +* Mon Dec 12 2005 Rodrigo Novo + +- Added zlib to the list of (static) libraries installed +- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld) +- Compile MySQL with bundled zlib +- Fixed %%packager name to "MySQL Production Engineering Team" + +* Mon Dec 05 2005 Joerg Bruehe + +- Avoid using the "bundled" zlib on "shared" builds: + As it is not installed (on the build system), this gives dependency + problems with "libtool" causing the build to fail. + (Change was done on Nov 11, but left uncommented.) + +* Tue Nov 22 2005 Joerg Bruehe + +- Extend the file existence check for "init.d/mysql" on un-install + to also guard the call to "insserv"/"chkconfig". + +* Thu Oct 27 2005 Lenz Grimmer + +- added more man pages + +* Wed Oct 19 2005 Kent Boortz + +- Made yaSSL support an option (off by default) + +* Wed Oct 19 2005 Kent Boortz + +- Enabled yaSSL support + +* Sat Oct 15 2005 Kent Boortz + +- Give mode arguments the same way in all places +lenz@mysql.com> + +- fixed the removing of the RPM_BUILD_ROOT in the %%clean section (the + $RBR variable did not get expanded, thus leaving old build roots behind) + +* Thu Aug 04 2005 Lenz Grimmer + +- Fixed the creation of the mysql user group account in the postinstall + section (BUG 12348) +- Fixed enabling the Archive storage engine in the Max binary + +* Tue Aug 02 2005 Lenz Grimmer + +- Fixed the Requires: tag for the server RPM (BUG 12233) + +* Fri Jul 15 2005 Lenz Grimmer + +- create a "mysql" user group and assign the mysql user account to that group + in the server postinstall section. (BUG 10984) + +* Tue Jun 14 2005 Lenz Grimmer + +- Do not build statically on i386 by default, only when adding either "--with + static" or "--define '_with_static 1'" to the RPM build options. Static + linking really only makes sense when linking against the specially patched + glibc 2.2.5. + +* Mon Jun 06 2005 Lenz Grimmer + +- added mysql_client_test to the "bench" subpackage (BUG 10676) +- added the libndbclient static and shared libraries (BUG 10676) + +* Wed Jun 01 2005 Lenz Grimmer + +- use "mysqldatadir" variable instead of hard-coding the path multiple times +- use the "mysqld_user" variable on all occasions a user name is referenced +- removed (incomplete) Brazilian translations +- removed redundant release tags from the subpackage descriptions + +* Wed May 25 2005 Joerg Bruehe + +- Added a "make clean" between separate calls to "BuildMySQL". + +* Thu May 12 2005 Guilhem Bichot + +- Removed the mysql_tableinfo script made obsolete by the information schema + +* Wed Apr 20 2005 Lenz Grimmer + +- Enabled the "blackhole" storage engine for the Max RPM + +* Wed Apr 13 2005 Lenz Grimmer + +- removed the MySQL manual files (html/ps/texi) - they have been removed + from the MySQL sources and are now available seperately. + +* Mon Apr 4 2005 Petr Chardin + +- old mysqlmanager, mysq* Mon Feb 7 2005 Tomas Ulin + +- enabled the "Ndbcluster" storage engine for the max binary +- added extra make install in ndb subdir after Max build to get ndb binaries +- added packages for ndbcluster storage engine + +* Fri Jan 14 2005 Lenz Grimmer + +- replaced obsoleted "BuildPrereq" with "BuildRequires" instead + +* Thu Jan 13 2005 Lenz Grimmer + +- enabled the "Federated" storage engine for the max binary + +* Tue Jan 04 2005 Petr Chardin + +- ISAM and merge storage engines were purged. As well as appropriate + tools and manpages (isamchk and isamlog) + +* Fri Dec 31 2004 Lenz Grimmer + +- enabled the "Archive" storage engine for the max binary +- enabled the "CSV" storage engine for the max binary +- enabled the "Example" storage engine for the max binary + +* Thu Aug 26 2004 Lenz Grimmer + +- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860) + +* Fri Aug 20 2004 Lenz Grimmer + +- do not link statically on IA64/AMD64 as these systems do not have + a patched glibc installed + +* Tue Aug 10 2004 Lenz Grimmer + +- Added libmygcc.a to the devel subpackage (required to link applications + against the the embedded server libmysqld.a) (BUG 4921) + +* Mon Aug 09 2004 Lenz Grimmer + +- Added EXCEPTIONS-CLIENT to the "devel" package + +* Thu Jul 29 2004 Lenz Grimmer + +- disabled OpenSSL in the Max binaries again (the RPM packages were the + only exception to this anyway) (BUG 1043) + +* Wed Jun 30 2004 Lenz Grimmer + +- fixed server postinstall (mysql_install_db was called with the wrong + parameter) + +* Thu Jun 24 2004 Lenz Grimmer + +- added mysql_tzinfo_to_sql to the server subpackage +- run "make clean" instead of "make distclean" + +* Mon Apr 05 2004 Lenz Grimmer + +- added ncurses-devel to the build prerequisites (BUG 3377) + +* Thu Feb 12 2004 Lenz Grimmer + +- when using gcc, _always_ use CXX=gcc +- replaced Copyright with License field (Copyright is obsolete) + +* Tue Feb 03 2004 Lenz Grimmer + +- added myisam_ftdump to the Server package + +* Tue Jan 13 2004 Lenz Grimmer + +- link the mysql client against libreadline instead of libedit (BUG 2289) + +* Mon Dec 22 2003 Lenz Grimmer + +- marked /etc/logrotate.d/mysql as a config file (BUG 2156) + +* Sat Dec 13 2003 Lenz Grimmer + +- fixed file permissions (BUG 1672) + +* Thu Dec 11 2003 Lenz Grimmer + +- made testing for gcc3 a bit more robust + +* Fri Dec 05 2003 Lenz Grimmer + +- added missing file mysql_create_system_tables to the server subpackage + +* Fri Nov 21 2003 Lenz Grimmer + +- removed dependency on MySQL-client from the MySQL-devel subpackage + as it is not really required. (BUG 1610) + +* Fri Aug 29 2003 Lenz Grimmer + +- Fixed BUG 1162 (removed macro names from the changelog) +- Really fixed BUG 998 (disable the checking for installed but + unpackaged files) + +* Tue Aug 05 2003 Lenz Grimmer + +- Fixed BUG 959 (libmysqld not being compiled properly) +- Fixed BUG 998 (RPM build errors): added missing files to the + distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow, + mysql_fix_privilege_tables.1), removed "-n" from install section. + +* Wed Jul 09 2003 Lenz Grimmer + +- removed the GIF Icon (file was not included in the sources anyway) +- removed unused variable shared_lib_version +- do not run automake before building the standard binary + (should not be necessary) +- add server suffix '-standard' to standard binary (to be in line + with the binary tarball distributions) +- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir, + _datadir, _includedir) throughout the spec file. +- allow overriding CC and CXX (required when building with other compilers) + +* Fri May 16 2003 Lenz Grimmer + +- re-enabled RAID again + +* Wed Apr 30 2003 Lenz Grimmer + +- disabled MyISAM RAID (--with-raid)- it throws an assertion which + needs to be investigated first. + +* Mon Mar 10 2003 Lenz Grimmer + +- added missing file mysql_secure_installation to server subpackage + (BUG 141) + +* Tue Feb 11 2003 Lenz Grimmer + +- re-added missing pre- and post(un)install scripts to server subpackage +- added config file /etc/my.cnf to the file list (just for completeness) +- make sure to create the datadir with 755 permissions + +* Mon Jan 27 2003 Lenz Grimmer + +- removed unusedql.com> + +- Reworked the build steps a little bit: the Max binary is supposed + to include OpenSSL, which cannot be linked statically, thus trying + to statically link against a special glibc is futile anyway +- because of this, it is not required to make yet another build run + just to compile the shared libs (saves a lot of time) +- updated package description of the Max subpackage +- clean up the BuildRoot directory afterwards + +* Mon Jul 15 2002 Lenz Grimmer + +- Updated Packager information +- Fixed the build options: the regular package is supposed to + include InnoDB and linked statically, while the Max package + should include BDB and SSL support + +* Fri May 03 2002 Lenz Grimmer + +- Use more RPM macros (e.g. infodir, mandir) to make the spec + file more portable +- reorganized the installation of documentation files: let RPM + take care of this +- reorganized the file list: actually install man pages along + with the binaries of the respective subpackage +- do not include libmysqld.a in the devel subpackage as well, if we + have a special "embedded" subpackage +- reworked the package descriptions + +* Mon Oct 8 2001 Monty + +- Added embedded server as a separate RPM + +* Fri Apr 13 2001 Monty + +- Added mysqld-max to the distribution + +* Tue Jan 2 2001 Monty + +- Added mysql-test to the bench package + +* Fri Aug 18 2000 Tim Smith + +- Added separate libmysql_r directory; now both a threaded + and non-threaded library is shipped. + +* Tue Sep 28 1999 David Axmark + +- Added the support-files/my-example.cnf to the docs directory. + +- Removed devel dependency on base since it is about client + development. + +* Wed Sep 8 1999 David Axmark + +- Cleaned up some for 3.23. + +* Thu Jul 1 1999 David Axmark + +- Added support for shared libraries in a separate sub + package. Original fix by David Fox (dsfox@cogsci.ucsd.edu) + +- The --enable-assembler switch is now automatically disables on + platforms there assembler code is unavailable. This should allow + building this RPM on non i386 systems. + +* Mon Feb 22 1999 David Axmark + +- Removed unportable cc switches from the spec file. The defaults can + now be overridden with environment variables. This feature is used + to compile the official RPM with optimal (but compiler version + specific) switches. + +- Removed the repetitive description parts for the sub rpms. Maybe add + again if RPM gets a multiline macro capability. + +- Added support for a pt_BR translation. Translation contributed by + Jorge Godoy . + +* Wed Nov 4 1998 David Axmark + +- A lot of changes in all the rpm and install scripts. This may even + be a working RPM :-) + +* Sun Aug 16 1998 David Axmark + +- A developers changelog for MySQL is available in the source RPM. And + there is a history of major user visible changed in the Reference + Manual. Only RPM specific changes will be documented here. diff --git a/packaging/rpm-sles/mysqld.service b/packaging/rpm-sles/mysqld.service new file mode 100644 index 00000000000..78ef3bffe60 --- /dev/null +++ b/packaging/rpm-sles/mysqld.service @@ -0,0 +1,48 @@ +# +# Simple MySQL systemd service file +# +# systemd supports lots of fancy features, look here (and linked docs) for a full list: +# http://www.freedesktop.org/software/systemd/man/systemd.exec.html +# +# Note: this file ( /usr/lib/systemd/system/mysql.service ) +# will be overwritten on package upgrade, please copy the file to +# +# /etc/systemd/system/mysql.service +# +# to make needed changes. +# +# systemd-delta can be used to check differences between the two mysql.service files. +# + +[Unit] +Description=MySQL Community Server +After=network.target +After=syslog.target + +[Install] +WantedBy=multi-user.target +Alias=mysql.service + +[Service] +User=mysql +Group=mysql + +# Execute pre and post scripts as root +PermissionsStartOnly=true + +# Needed to create system tables etc. +ExecStartPre=/usr/bin/mysql-systemd-start pre + +# Start main service +ExecStart=/usr/bin/mysqld_safe + +# Don't signal startup success before a ping works +ExecStartPost=/usr/bin/mysql-systemd-start post + +# Give up if ping don't get an answer +TimeoutSec=600 + +Restart=always +PrivateTmp=false + + From bafba78809ed898990d063cd67ba809a906dbea5 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Mon, 17 Nov 2014 13:20:47 -0500 Subject: [PATCH 036/201] DB-766 add reproducer --- mysql-test/suite/tokudb.bugs/r/db766.result | 7 +++++++ mysql-test/suite/tokudb.bugs/t/db766.test | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/db766.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db766.test diff --git a/mysql-test/suite/tokudb.bugs/r/db766.result b/mysql-test/suite/tokudb.bugs/r/db766.result new file mode 100644 index 00000000000..e109b0a7f15 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db766.result @@ -0,0 +1,7 @@ +set default_storage_engine=TokuDB; +drop table if exists t1; +CREATE TABLE t1(c1 INT,c2 CHAR)PARTITION BY KEY(c1) PARTITIONS 5; +insert INTO t1 values(1,1),(2,1),(2,2),(2,3); +ALTER TABLE t1 ADD UNIQUE INDEX i1(c1); +ERROR 23000: Can't write; duplicate key in table 't1' +drop table t1; diff --git a/mysql-test/suite/tokudb.bugs/t/db766.test b/mysql-test/suite/tokudb.bugs/t/db766.test new file mode 100644 index 00000000000..e7d082f4638 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db766.test @@ -0,0 +1,12 @@ +# reproducer for DB-766 +source include/have_tokudb.inc; +source include/have_partition.inc; +set default_storage_engine=TokuDB; +disable_warnings; +drop table if exists t1; +enable_warnings; +CREATE TABLE t1(c1 INT,c2 CHAR)PARTITION BY KEY(c1) PARTITIONS 5; +insert INTO t1 values(1,1),(2,1),(2,2),(2,3); +--error ER_DUP_KEY +ALTER TABLE t1 ADD UNIQUE INDEX i1(c1); +drop table t1; \ No newline at end of file From 7f7d86bb1f9e51ce06df70cab4d5dc17404ca9d3 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Mon, 17 Nov 2014 13:36:29 -0500 Subject: [PATCH 037/201] DB-768 test case for 5.6 crash --- mysql-test/suite/tokudb.bugs/r/db768.result | 10 ++++++++++ mysql-test/suite/tokudb.bugs/t/db768.test | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 mysql-test/suite/tokudb.bugs/r/db768.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db768.test diff --git a/mysql-test/suite/tokudb.bugs/r/db768.result b/mysql-test/suite/tokudb.bugs/r/db768.result new file mode 100644 index 00000000000..f302114b45c --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db768.result @@ -0,0 +1,10 @@ +set default_storage_engine='tokudb'; +drop table if exists t; +create table t (id int primary key); +set autocommit=OFF; +lock tables t write; +optimize table t; +Table Op Msg_type Msg_text +test.t optimize status OK +unlock tables; +drop table t; diff --git a/mysql-test/suite/tokudb.bugs/t/db768.test b/mysql-test/suite/tokudb.bugs/t/db768.test new file mode 100644 index 00000000000..be2155f5c18 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db768.test @@ -0,0 +1,12 @@ +# test case for DB-768 +source include/have_tokudb.inc; +set default_storage_engine='tokudb'; +disable_warnings; +drop table if exists t; +enable_warnings; +create table t (id int primary key); +set autocommit=OFF; +lock tables t write; +optimize table t; +unlock tables; +drop table t; From ea9bd89327d5fcbf30ca24b0c852e1fce03dd3da Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Mon, 17 Nov 2014 14:57:06 -0500 Subject: [PATCH 038/201] DB-770 tokudb::extra HA_EXTRA_NOT_USED should explicitly do nothing --- storage/tokudb/ha_tokudb.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index a7b81319b5e..e6b63b5e69e 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -5980,6 +5980,8 @@ int ha_tokudb::extra(enum ha_extra_function operation) { case HA_EXTRA_NO_IGNORE_NO_KEY: using_ignore_no_key = false; break; + case HA_EXTRA_NOT_USED: + break; // must do nothing and return 0 default: break; } From 412be21f5a7e20e1dbc54f941aebb864e4cbcb41 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 19 Nov 2014 12:31:34 -0500 Subject: [PATCH 039/201] DB-762 create tokudb trx when needed in tokudb::start_stmt --- mysql-test/suite/tokudb.bugs/r/db762.result | 7 +++++++ mysql-test/suite/tokudb.bugs/t/db762.test | 13 +++++++++++++ storage/tokudb/ha_tokudb.cc | 6 +++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/tokudb.bugs/r/db762.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db762.test diff --git a/mysql-test/suite/tokudb.bugs/r/db762.result b/mysql-test/suite/tokudb.bugs/r/db762.result new file mode 100644 index 00000000000..159957dba3e --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db762.result @@ -0,0 +1,7 @@ +drop table if exists t1,t2; +create table t1 (x int) engine=innodb; +lock table t1 read; +create temporary table t2 (x int) engine=tokudb; +insert into t2 values (1); +unlock tables; +drop table t1, t2; diff --git a/mysql-test/suite/tokudb.bugs/t/db762.test b/mysql-test/suite/tokudb.bugs/t/db762.test new file mode 100644 index 00000000000..4428e9df8ec --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db762.test @@ -0,0 +1,13 @@ +# test for DB-762 and DB-767 +source include/have_tokudb.inc; +source include/have_innodb.inc; +disable_warnings; +drop table if exists t1,t2; +enable_warnings; +create table t1 (x int) engine=innodb; +lock table t1 read; +create temporary table t2 (x int) engine=tokudb; +insert into t2 values (1); +unlock tables; +drop table t1, t2; + diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index e6b63b5e69e..d5168150298 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -6227,7 +6227,11 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) { int error = 0; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton); - DBUG_ASSERT(trx); + if (!trx) { + error = create_tokudb_trx_data_instance(&trx); + if (error) { goto cleanup; } + thd_set_ha_data(thd, tokudb_hton, trx); + } /* note that trx->stmt may have been already initialized as start_stmt() From c144cf38bd235904f3b4ada2f16327dee7b01d7a Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 20 Nov 2014 11:00:02 +0100 Subject: [PATCH 040/201] - Implement putting in memory the result set from an ODBC query. modified: storage/connect/odbconn.cpp storage/connect/odbconn.h storage/connect/tabodbc.cpp storage/connect/tabodbc.h - Moving the calls to VerifyConnect and GetConnectInfo into the try block in ODBConn::Open (potential crash in case of throw) modified: storage/connect/odbconn.cpp - Handling all ODBC data date types (91, 92, 93) modified: storage/connect/ha_connect.cc storage/connect/odbconn.cpp - Not assuming string results from ODBC catalog functions are zero terminated modified: storage/connect/odbconn.cpp --- storage/connect/ha_connect.cc | 1 + storage/connect/odbconn.cpp | 112 +++++++++++++++++++++++++++++++--- storage/connect/odbconn.h | 5 +- storage/connect/tabodbc.cpp | 88 ++++++++++++++++++++------ storage/connect/tabodbc.h | 5 ++ 5 files changed, 184 insertions(+), 27 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index ebf286a049b..1453c418025 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -5190,6 +5190,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, tm= NOT_NULL_FLAG; cnm= (char*)"noname"; dft= xtra= key= NULL; + v= ' '; #if defined(NEW_WAY) rem= ""; // cs= NULL; diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index bef735b4a6d..88b9978977a 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -146,18 +146,25 @@ int TranslateSQLType(int stp, int prec, int& len, char& v) type = TYPE_DOUBLE; break; case SQL_DATETIME: // 9 -// case SQL_DATE: // 9 + type = TYPE_DATE; + len = 19; + break; + case SQL_TYPE_DATE: // 91 type = TYPE_DATE; len = 10; + v = 'D'; break; case SQL_INTERVAL: // 10 -// case SQL_TIME: // 10 + case SQL_TYPE_TIME: // 92 type = TYPE_STRING; len = 8 + ((prec) ? (prec+1) : 0); + v = 'T'; break; case SQL_TIMESTAMP: // 11 + case SQL_TYPE_TIMESTAMP: // 93 type = TYPE_DATE; len = 19 + ((prec) ? (prec+1) : 0); + v = 'S'; break; case SQL_BIGINT: // (-5) type = TYPE_BIGINT; @@ -910,6 +917,7 @@ ODBConn::ODBConn(PGLOBAL g, TDBODBC *tdbp) m_UpdateOptions = 0; m_RowsetSize = (DWORD)((tdbp) ? tdbp->Rows : 10); m_Catver = (tdbp) ? tdbp->Catver : 0; + m_Rows = 0; m_Connect = NULL; m_Updatable = true; m_Transact = false; @@ -1068,6 +1076,9 @@ int ODBConn::Open(PSZ ConnectString, DWORD options) } // endif /*ver = GetStringInfo(SQL_DRIVER_ODBC_VER);*/ + // Verify support for required functionality and cache info +// VerifyConnect(); Deprecated + GetConnectInfo(); } catch(DBX *xp) { // strcpy(g->Message, xp->m_ErrMsg[0]); strcpy(g->Message, xp->GetErrorMessage(0)); @@ -1076,9 +1087,6 @@ int ODBConn::Open(PSZ ConnectString, DWORD options) return -1; } // end try-catch - // Verify support for required functionality and cache info - VerifyConnect(); - GetConnectInfo(); return 1; } // end of Open @@ -1500,6 +1508,10 @@ int ODBConn::Fetch() ThrowDBX(rc, "Fetch", m_hstmt); irc = (rc == SQL_NO_DATA_FOUND) ? 0 : (int)crow; + + if (m_Tdb->Memory == 1) + m_Rows += irc; + } catch(DBX *x) { if (trace) for (int i = 0; i < MAX_NUM_OF_MSG && x->m_ErrMsg[i]; i++) @@ -2150,6 +2162,7 @@ int ODBConn::GetCatInfo(CATPARM *cap) HSTMT hstmt = NULL; SQLLEN *vl, *vlen = NULL; PVAL *pval = NULL; + char* *pbuf = NULL; try { b = false; @@ -2226,6 +2239,7 @@ int ODBConn::GetCatInfo(CATPARM *cap) // Unconditional to handle STRBLK's pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL)); vlen = (SQLLEN *)PlugSubAlloc(g, NULL, n * sizeof(SQLLEN)); + pbuf = (char**)PlugSubAlloc(g, NULL, n * sizeof(char*)); // Now bind the column buffers for (n = 0, crp = qrp->Colresp; crp; crp = crp->Next) { @@ -2240,7 +2254,13 @@ int ODBConn::GetCatInfo(CATPARM *cap) } // endif len pval[n] = AllocateValue(g, crp->Type, len); - buffer = pval[n]->GetTo_Val(); + + if (crp->Type == TYPE_STRING) { + pbuf[n] = (char*)PlugSubAlloc(g, NULL, len); + buffer = pbuf[n]; + } else + buffer = pval[n]->GetTo_Val(); + vl = vlen + n; // n + 1 because column numbers begin with 1 @@ -2288,7 +2308,13 @@ int ODBConn::GetCatInfo(CATPARM *cap) } // endif rc for (n = 0, crp = qrp->Colresp; crp; n++, crp = crp->Next) { - pval[n]->SetNull(vlen[n] == SQL_NULL_DATA); + if (vlen[n] == SQL_NULL_DATA) + pval[n]->SetNull(true); + else if (crp->Type == TYPE_STRING && vlen[n] != SQL_NULL_DATA) + pval[n]->SetValue_char(pbuf[n], vlen[n]); + else + pval[n]->SetNull(false); + crp->Kdata->SetValue(pval[n], i); cap->Vlen[n][i] = vlen[n]; } // endfor crp @@ -2342,6 +2368,76 @@ int ODBConn::GetCatInfo(CATPARM *cap) return irc; } // end of GetCatInfo +/***********************************************************************/ +/* Allocate a CONNECT result structure from the ODBC result. */ +/***********************************************************************/ +PQRYRES ODBConn::AllocateResult(PGLOBAL g) + { +//char *fmt, v; + int n; + bool uns; + PODBCCOL colp; + PCOLRES *pcrp, crp; + PQRYRES qrp; + + if (!m_Rows) { + strcpy(g->Message, "Void result"); + return NULL; + } // endif m_Res + + /*********************************************************************/ + /* Allocate the result storage for future retrieval. */ + /*********************************************************************/ + qrp = (PQRYRES)PlugSubAlloc(g, NULL, sizeof(QRYRES)); + pcrp = &qrp->Colresp; + qrp->Continued = FALSE; + qrp->Truncated = FALSE; + qrp->Info = FALSE; + qrp->Suball = TRUE; + qrp->BadLines = 0; + qrp->Maxsize = m_Rows; + qrp->Maxres = m_Rows; + qrp->Nbcol = 0; + qrp->Nblin = 0; + qrp->Cursor = 0; + + for (n = 1, colp = (PODBCCOL)m_Tdb->Columns; colp; + colp = (PODBCCOL)colp->GetNext()) + if (!colp->IsSpecial()) { + *pcrp = (PCOLRES)PlugSubAlloc(g, NULL, sizeof(COLRES)); + crp = *pcrp; + pcrp = &crp->Next; + memset(crp, 0, sizeof(COLRES)); + crp->Ncol = ++qrp->Nbcol; + crp->Name = colp->GetName(); + crp->Type = colp->GetResultType(); + crp->Prec = colp->GetScale(); + crp->Length = colp->GetLength(); + crp->Clen = colp->GetBuflen(); + uns = colp->IsUnsigned(); + + if (!(crp->Kdata = AllocValBlock(g, NULL, crp->Type, m_Rows, + crp->Clen, 0, FALSE, TRUE, uns))) { + sprintf(g->Message, MSG(INV_RESULT_TYPE), + GetFormatType(crp->Type)); + return NULL; + } // endif Kdata + + if (!colp->IsNullable()) + crp->Nulls = NULL; + else { + crp->Nulls = (char*)PlugSubAlloc(g, NULL, m_Rows); + memset(crp->Nulls, ' ', m_Rows); + } // endelse Nullable + + colp->SetCrp(crp); + } // endif colp + + *pcrp = NULL; +//qrp->Nblin = n; + return qrp; + } // end of AllocateResult + /***********************************************************************/ /* Restart from beginning of result set */ /***********************************************************************/ @@ -2382,7 +2478,7 @@ void ODBConn::Close() rc = SQLFreeStmt(m_hstmt, SQL_DROP); m_hstmt = NULL; } // endif m_hstmt - + if (m_hdbc != SQL_NULL_HDBC) { if (m_Transact) { rc = SQLEndTran(SQL_HANDLE_DBC, m_hdbc, SQL_COMMIT); diff --git a/storage/connect/odbconn.h b/storage/connect/odbconn.h index 1dd2aa2c16e..13d58488b39 100644 --- a/storage/connect/odbconn.h +++ b/storage/connect/odbconn.h @@ -126,6 +126,7 @@ class ODBConn : public BLOCK { int Open(PSZ ConnectString, DWORD Options = 0); bool Rewind(char *sql, ODBCCOL *tocols); void Close(void); + PQRYRES AllocateResult(PGLOBAL g); // Attributes public: @@ -187,9 +188,11 @@ class ODBConn : public BLOCK { DWORD m_UpdateOptions; DWORD m_RowsetSize; char m_IDQuoteChar[2]; - int m_Catver; PSZ m_Connect; + int m_Catver; + int m_Rows; bool m_Updatable; bool m_Transact; bool m_Scrollable; + bool m_Memory; }; // end of ODBConn class definition diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index bbc17129aaf..cb21f33c1b1 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -134,6 +134,7 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) if ((Scrollable = GetBoolCatInfo("Scrollable", false))) Elemt = 0; // Not compatible with extended fetch + Memory = GetBoolCatInfo("Memory", false); Pseudo = 2; // FILID is Ok but not ROWID return false; } // end of DefineAM @@ -198,6 +199,7 @@ TDBODBC::TDBODBC(PODEF tdp) : TDBASE(tdp) Quoted = MY_MAX(0, tdp->GetQuoted()); Rows = tdp->GetElemt(); Catver = tdp->Catver; + Memory = (tdp->Memory) ? 1 : 0; Scrollable = tdp->Scrollable; } else { Connect = NULL; @@ -211,6 +213,7 @@ TDBODBC::TDBODBC(PODEF tdp) : TDBASE(tdp) Quoted = 0; Rows = 0; Catver = 0; + Memory = 0; Scrollable = false; } // endif tdp @@ -220,6 +223,7 @@ TDBODBC::TDBODBC(PODEF tdp) : TDBASE(tdp) //Where = NULL; MulConn = NULL; DBQ = NULL; + Qrp = NULL; Fpos = 0; AftRows = 0; CurNum = 0; @@ -238,6 +242,7 @@ TDBODBC::TDBODBC(PTDBODBC tdbp) : TDBASE(tdbp) Catalog = tdbp->Catalog; Srcdef = tdbp->Srcdef; Qrystr = tdbp->Qrystr; + Memory = tdbp->Memory; Scrollable = tdbp->Scrollable; Quote = tdbp->Quote; Query = tdbp->Query; @@ -256,6 +261,7 @@ TDBODBC::TDBODBC(PTDBODBC tdbp) : TDBASE(tdbp) Rbuf = tdbp->Rbuf; BufSize = tdbp->BufSize; Nparm = tdbp->Nparm; + Qrp = tdbp->Qrp; } // end of TDBODBC copy constructor // Method @@ -758,17 +764,23 @@ bool TDBODBC::OpenDB(PGLOBAL g) /*******************************************************************/ /* Table already open, just replace it at its beginning. */ /*******************************************************************/ -// if (To_Kindex) - /*****************************************************************/ - /* Table is to be accessed through a sorted index table. */ - /*****************************************************************/ -// To_Kindex->Reset(); + if (Memory == 1) { + if ((Qrp = Ocp->AllocateResult(g))) + Memory = 2; // Must be filled + else + Memory = 0; // Allocation failed, don't use it -// rewind(Stream); >>>>>>> Something to be done with Cursor <<<<<<< - if (Ocp->Rewind(Query, (PODBCCOL)Columns)) { - Ocp->Close(); - return true; - } // endif Rewind + } else if (Memory == 2) + Memory = 3; // Ok to use memory result + + if (Memory < 3) { + // Method will depend on cursor type + if (Ocp->Rewind(Query, (PODBCCOL)Columns)) { + Ocp->Close(); + return true; + } // endif Rewind + + } // endif Memory Fpos = 0; return false; @@ -877,13 +889,22 @@ int TDBODBC::ReadDB(PGLOBAL g) /* Now start the reading process. */ /* Here is the place to fetch the line(s). */ /*********************************************************************/ - if (++CurNum >= Rbuf) { - Rbuf = Ocp->Fetch(); - CurNum = 0; - } // endif CurNum + if (Memory != 3) { + if (++CurNum >= Rbuf) { + Rbuf = Ocp->Fetch(); + CurNum = 0; + } // endif CurNum - rc = (Rbuf > 0) ? RC_OK : (Rbuf == 0) ? RC_EF : RC_FX; - Fpos++; // Used for progress info + rc = (Rbuf > 0) ? RC_OK : (Rbuf == 0) ? RC_EF : RC_FX; + } else // Getting result from memory + rc = (Fpos < Qrp->Nblin) ? RC_OK : RC_EF; + + if (rc == RC_OK) { + if (Memory == 2) + Qrp->Nblin++; + + Fpos++; // Used for memory + } // endif rc if (trace > 1) htrc(" Read: Rbuf=%d rc=%d\n", Rbuf, rc); @@ -966,6 +987,7 @@ ODBCCOL::ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) } // endif cprec // Set additional ODBC access method information for column. + Crp = NULL; //Long = cdp->GetLong(); Long = Precision; //strcpy(F_Date, cdp->F_Date); @@ -987,6 +1009,7 @@ ODBCCOL::ODBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am) /***********************************************************************/ ODBCCOL::ODBCCOL(void) : COLBLK() { + Crp = NULL; Buf_Type = TYPE_INT; // This is a count(*) column // Set additional Dos access method information for column. Long = sizeof(int); @@ -1005,6 +1028,7 @@ ODBCCOL::ODBCCOL(void) : COLBLK() /***********************************************************************/ ODBCCOL::ODBCCOL(ODBCCOL *col1, PTDB tdbp) : COLBLK(col1, tdbp) { + Crp = col1->Crp; Long = col1->Long; //strcpy(F_Date, col1->F_Date); To_Val = col1->To_Val; @@ -1070,7 +1094,20 @@ bool ODBCCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) void ODBCCOL::ReadColumn(PGLOBAL g) { PTDBODBC tdbp = (PTDBODBC)To_Tdb; - int n = tdbp->CurNum; + int i = tdbp->Fpos - 1, n = tdbp->CurNum; + + if (tdbp->Memory == 3) { + // Get the value from the stored memory + if (Crp->Nulls && Crp->Nulls[i] == '*') { + Value->Reset(); + Value->SetNull(true); + } else { + Value->SetValue_pvblk(Crp->Kdata, i); + Value->SetNull(false); + } // endif Nulls + + return; + } // endif Memory if (StrLen[n] == SQL_NULL_DATA) { // Null value @@ -1078,7 +1115,7 @@ void ODBCCOL::ReadColumn(PGLOBAL g) Value->SetNull(true); Value->Reset(); - return; + goto put; } else Value->SetNull(false); @@ -1117,6 +1154,21 @@ void ODBCCOL::ReadColumn(PGLOBAL g) Name, tdbp->Rows, Bufp, Buf_Type, Value->GetCharString(buf)); } // endif Trace +put: + if (tdbp->Memory != 2) + return; + + /*********************************************************************/ + /* Fill the allocated result structure. */ + /*********************************************************************/ + if (Value->IsNull()) { + if (Crp->Nulls) + Crp->Nulls[i] = '*'; // Null value + + Crp->Kdata->Reset(i); + } else + Crp->Kdata->SetValue(Value, i); + } // end of ReadColumn /***********************************************************************/ diff --git a/storage/connect/tabodbc.h b/storage/connect/tabodbc.h index f042b0c73ca..da9d373add8 100644 --- a/storage/connect/tabodbc.h +++ b/storage/connect/tabodbc.h @@ -60,6 +60,7 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */ int Maxerr; /* Maxerr for an Exec table */ int Maxres; /* Maxres for a catalog table */ bool Scrollable; /* Use scrollable cursor */ + bool Memory; /* Put result set in memory */ bool Xsrc; /* Execution type */ }; // end of ODBCDEF @@ -143,7 +144,9 @@ class TDBODBC : public TDBASE { int Rbuf; // Number of lines read in buffer int BufSize; // Size of connect string buffer int Nparm; // The number of statement parameters + int Memory; // 0: No 1: Alloc 2: Put 3: Get bool Scrollable; // Use scrollable cursor + PQRYRES Qrp; // Points to storage result }; // end of class TDBODBC /***********************************************************************/ @@ -162,6 +165,7 @@ class ODBCCOL : public COLBLK { SQLLEN *GetStrLen(void) {return StrLen;} int GetRank(void) {return Rank;} // PVBLK GetBlkp(void) {return Blkp;} + void SetCrp(PCOLRES crp) {Crp = crp;} // Methods virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); @@ -178,6 +182,7 @@ class ODBCCOL : public COLBLK { // Members TIMESTAMP_STRUCT *Sqlbuf; // To get SQL_TIMESTAMP's + PCOLRES Crp; // To storage result void *Bufp; // To extended buffer PVBLK Blkp; // To Value Block //char F_Date[12]; // Internal Date format From d592f665780337065827881e886a4230adac0a42 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 20 Nov 2014 12:57:33 +0100 Subject: [PATCH 041/201] - Remove gcc warning on variable n set but not used modified: storage/connect/odbconn.cpp --- storage/connect/odbconn.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 88b9978977a..b68b4648616 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2373,8 +2373,6 @@ int ODBConn::GetCatInfo(CATPARM *cap) /***********************************************************************/ PQRYRES ODBConn::AllocateResult(PGLOBAL g) { -//char *fmt, v; - int n; bool uns; PODBCCOL colp; PCOLRES *pcrp, crp; @@ -2401,8 +2399,8 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g) qrp->Nblin = 0; qrp->Cursor = 0; - for (n = 1, colp = (PODBCCOL)m_Tdb->Columns; colp; - colp = (PODBCCOL)colp->GetNext()) + for (colp = (PODBCCOL)m_Tdb->Columns; colp; + colp = (PODBCCOL)colp->GetNext()) if (!colp->IsSpecial()) { *pcrp = (PCOLRES)PlugSubAlloc(g, NULL, sizeof(COLRES)); crp = *pcrp; From b2db891c1971a933104471b72877c90dd71aca53 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 20 Nov 2014 23:18:51 +0100 Subject: [PATCH 042/201] - Remove gcc warning (variable n is set and not used) modified: storage/connect/odbconn.cpp --- storage/connect/odbconn.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 88b9978977a..b68b4648616 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2373,8 +2373,6 @@ int ODBConn::GetCatInfo(CATPARM *cap) /***********************************************************************/ PQRYRES ODBConn::AllocateResult(PGLOBAL g) { -//char *fmt, v; - int n; bool uns; PODBCCOL colp; PCOLRES *pcrp, crp; @@ -2401,8 +2399,8 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g) qrp->Nblin = 0; qrp->Cursor = 0; - for (n = 1, colp = (PODBCCOL)m_Tdb->Columns; colp; - colp = (PODBCCOL)colp->GetNext()) + for (colp = (PODBCCOL)m_Tdb->Columns; colp; + colp = (PODBCCOL)colp->GetNext()) if (!colp->IsSpecial()) { *pcrp = (PCOLRES)PlugSubAlloc(g, NULL, sizeof(COLRES)); crp = *pcrp; From eb13e2b40d6a2fb847cf413fa29cf089e53e64d1 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 21 Nov 2014 07:13:07 -0500 Subject: [PATCH 043/201] DB-771 fix incorrect assert in update callback for varchar expansion --- mysql-test/suite/tokudb.bugs/r/db771.result | 11 +++++++++++ mysql-test/suite/tokudb.bugs/t/db771.test | 13 +++++++++++++ .../suite/tokudb/r/change_column_varchar.result | 1 + .../suite/tokudb/t/change_column_varchar.test | 1 + storage/tokudb/tokudb_update_fun.cc | 2 +- 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/tokudb.bugs/r/db771.result create mode 100644 mysql-test/suite/tokudb.bugs/t/db771.test diff --git a/mysql-test/suite/tokudb.bugs/r/db771.result b/mysql-test/suite/tokudb.bugs/r/db771.result new file mode 100644 index 00000000000..3fc012a732f --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/r/db771.result @@ -0,0 +1,11 @@ +set default_storage_engine=tokudb; +drop table if exists t1; +CREATE TABLE t1 (a int key, b varchar(32), c varchar(32)); +REPLACE t1 SET a = 4; +ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500); +update t1 set b='hi'; +update t1 set c='there'; +select * from t1; +a b c +4 hi there +drop table t1; diff --git a/mysql-test/suite/tokudb.bugs/t/db771.test b/mysql-test/suite/tokudb.bugs/t/db771.test new file mode 100644 index 00000000000..039ad7471c1 --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/db771.test @@ -0,0 +1,13 @@ +# test case for DB-771 +source include/have_tokudb.inc; +set default_storage_engine=tokudb; +disable_warnings; +drop table if exists t1; +enable_warnings; +CREATE TABLE t1 (a int key, b varchar(32), c varchar(32)); +REPLACE t1 SET a = 4; +ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500); +update t1 set b='hi'; +update t1 set c='there'; +select * from t1; +drop table t1; diff --git a/mysql-test/suite/tokudb/r/change_column_varchar.result b/mysql-test/suite/tokudb/r/change_column_varchar.result index a9cb5e57a36..2e7da5ed5ef 100644 --- a/mysql-test/suite/tokudb/r/change_column_varchar.result +++ b/mysql-test/suite/tokudb/r/change_column_varchar.result @@ -6,6 +6,7 @@ Table Create Table t CREATE TABLE `t` ( `a` varchar(1) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=latin1 +INSERT INTO t VALUES (null); ALTER TABLE t CHANGE COLUMN a a VARCHAR(2); ALTER TABLE t CHANGE COLUMN a a VARCHAR(2); ALTER TABLE t CHANGE COLUMN a a VARCHAR(3); diff --git a/mysql-test/suite/tokudb/t/change_column_varchar.test b/mysql-test/suite/tokudb/t/change_column_varchar.test index f2b4e3cbf78..6543952ad29 100644 --- a/mysql-test/suite/tokudb/t/change_column_varchar.test +++ b/mysql-test/suite/tokudb/t/change_column_varchar.test @@ -9,6 +9,7 @@ SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON; CREATE TABLE t (a VARCHAR(1)) ENGINE=TokuDB; SHOW CREATE TABLE t; +INSERT INTO t VALUES (null); # 1->1 let $i=1 diff --git a/storage/tokudb/tokudb_update_fun.cc b/storage/tokudb/tokudb_update_fun.cc index 3ab7510121a..9754dc989a2 100644 --- a/storage/tokudb/tokudb_update_fun.cc +++ b/storage/tokudb/tokudb_update_fun.cc @@ -851,7 +851,7 @@ static int tokudb_expand_variable_offsets( DBT new_val; memset(&new_val, 0, sizeof new_val); if (old_val != NULL) { - assert(offset_start + number_of_offsets < old_val->size); + assert(offset_start + number_of_offsets <= old_val->size); // compute the new val from the old val uchar *old_val_ptr = (uchar *)old_val->data; From 1d7f9ec24ce5cd0bb97873d9a996f155c6d17f99 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 21 Nov 2014 16:31:53 -0500 Subject: [PATCH 044/201] DB-775 binlog group commit for 5.6 --- storage/tokudb/hatoku_hton.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 903d15c7969..438643d13d5 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -772,16 +772,31 @@ static void tokudb_cleanup_handlers(tokudb_trx_data *trx, DB_TXN *txn) { } } +#if MYSQL_VERSION_ID >= 50600 +extern "C" enum durability_properties thd_get_durability_property(const MYSQL_THD thd); +#endif + +// Determine if an fsync is used when a transaction is committed. The MySQL durability property +// has precedence over the tokudb commit sync setting as it has a better idea of what is going on. +static bool tokudb_fsync_on_commit(THD *thd) { +#if MYSQL_VERSION_ID >= 50600 + if (thd_get_durability_property(thd) == HA_IGNORE_DURABILITY) + return false; + else +#endif + return THDVAR(thd, commit_sync) != 0; +} + static int tokudb_commit(handlerton * hton, THD * thd, bool all) { TOKUDB_DBUG_ENTER(""); DBUG_PRINT("trans", ("ending transaction %s", all ? "all" : "stmt")); - uint32_t syncflag = THDVAR(thd, commit_sync) ? 0 : DB_TXN_NOSYNC; + uint32_t syncflag = tokudb_fsync_on_commit(thd) ? 0 : DB_TXN_NOSYNC; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { if (tokudb_debug & TOKUDB_DEBUG_TXN) { - TOKUDB_TRACE("commit trx %u txn %p", all, this_txn); + TOKUDB_TRACE("commit trx %u txn %p syncflag %u", all, this_txn, syncflag); } // test hook to induce a crash on a debug build DBUG_EXECUTE_IF("tokudb_crash_commit_before", DBUG_SUICIDE();); From a726dbd634a6e1651ebdbc8e644812b50d50cffc Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 24 Nov 2014 02:53:45 +0400 Subject: [PATCH 045/201] MDEV-7157 plugins.server_audit fails sporadically in buildbot. Records can get to the different place in the log when multiple thread are logged. So the delay added to let the record be saved on the same place. --- mysql-test/suite/plugins/t/server_audit.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index f63c8022392..869fd944d51 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -43,6 +43,7 @@ show variables like 'server_audit%'; set global server_audit_mode=1; set global server_audit_events=''; create database sa_db; +--sleep 2 connect (con1,localhost,root,,test); connection con1; create table t1 (id2 int); From ef1ba3b1e6d6030f15ae1bdc36f124ac8da61680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 24 Nov 2014 15:26:47 +0200 Subject: [PATCH 046/201] MDEV-7164: innodb.innodb-alter-table-disk-full fails in buildbot on Windows Analysis: Test case uses Linux specific error codes. Fix: Can't run test case with Windows currently because requires to inject error to system. --- .../suite/innodb/t/innodb-alter-table-disk-full.test | 3 +++ storage/innobase/os/os0file.cc | 10 +++++----- storage/xtradb/os/os0file.cc | 10 ++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test index 4e3a7bfdae6..adeb2ef9fd2 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test +++ b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test @@ -1,5 +1,8 @@ # MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more --source include/have_innodb.inc +--source include/not_windows.inc +--source include/not_valgrind.inc +--source include/not_embedded.inc # DEBUG_SYNC must be compiled in. --source include/have_debug_sync.inc diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 162c51425f4..da2ae91763c 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -5455,12 +5455,12 @@ consecutive_loop: aio_slot->offset, total_len); } - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", - os_has_said_disk_full = FALSE;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", - ret = 0;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", + if (aio_slot->type == OS_FILE_WRITE) { + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28", + os_has_said_disk_full = FALSE; + ret = 0; errno = 28;); + } srv_set_io_thread_op_info(global_segment, "file i/o done"); diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 9ccfb39981d..dcab27370f5 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -5597,12 +5597,10 @@ consecutive_loop: aio_slot->offset, total_len); } - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", - os_has_said_disk_full = FALSE;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", - ret = 0;); - DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", - errno = 28;); + if (aio_slot->type == OS_FILE_WRITE) { + DBUG_EXECUTE_IF("ib_os_aio_func_io_failure_28_2", + os_has_said_disk_full = FALSE; ret = 0; errno = 28;); + } srv_set_io_thread_op_info(global_segment, "file i/o done"); From b7cee6251a528f2a35abc825aa8fb30ea1d07f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 24 Nov 2014 19:37:38 +0200 Subject: [PATCH 047/201] MDEV-7168: Tests innodb.innodb_stats_create_table innodb.innodb_stats_drop_locked fail and innodb.innodb_stats_fetch_nonexistent fails in buildbot on Windows Analysis: Problem is that innodb_stats_create_on_corrupted test renames mysql.innodb.index_stats and all the rest are dependend on this table. Fix: After rename back to original, restart mysqld to make sure that table is correct. --- .../innodb/r/innodb_stats_create_on_corrupted.result | 12 ++++++++++++ .../innodb/t/innodb_stats_create_on_corrupted.test | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result b/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result index 47c714bb0a6..c351b222496 100644 --- a/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result +++ b/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result @@ -17,4 +17,16 @@ avg_row_length 0 max_data_length 0 index_length 0 ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats; +SELECT seq_in_index, column_name, cardinality +FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted' +ORDER BY index_name, seq_in_index; +seq_in_index 1 +column_name a +cardinality 0 +SELECT table_rows, avg_row_length, max_data_length, index_length +FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted'; +table_rows 0 +avg_row_length 0 +max_data_length 0 +index_length 0 DROP TABLE test_ps_create_on_corrupted; diff --git a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test index 78c9334f800..de6026a23aa 100644 --- a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test +++ b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test @@ -33,4 +33,16 @@ FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted'; # restore the persistent storage ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats; +--source include/restart_mysqld.inc + +-- vertical_results + +# check again +SELECT seq_in_index, column_name, cardinality +FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted' +ORDER BY index_name, seq_in_index; + +SELECT table_rows, avg_row_length, max_data_length, index_length +FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted'; + DROP TABLE test_ps_create_on_corrupted; From 876106804edb57eb5f40656c0a21f41174e33ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 24 Nov 2014 20:25:17 +0200 Subject: [PATCH 048/201] MDEV-7169: innodb.innodb_bug14147491 fails in buildbot on Windows Problem is that test could open Microsoft C++ Client Debugger windows with abort exceptin. Lets not try to test this on windows. --- mysql-test/suite/innodb/t/innodb_bug14147491.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test index 050f7fbdd73..6f0bfca8e1d 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14147491.test +++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test @@ -12,6 +12,9 @@ source include/not_embedded.inc; source include/have_innodb.inc; # Require Debug for SET DEBUG source include/have_debug.inc; +# Test could open crash reporter on Windows +# if compiler set up +source include/not_windows.inc; CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); From 77a6abf31141f227202c78e88c7989e5946fa470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 24 Nov 2014 20:35:02 +0200 Subject: [PATCH 049/201] MDEV-7183: innodb-wl5522-debug-zip fails in buildbot on Windows Problem is different path separators. Fixed by replacing result. --- .../suite/innodb/r/innodb-wl5522-debug-zip.result | 6 +++--- .../suite/innodb/t/innodb-wl5522-debug-zip.test | 11 ++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result index a4e44be1c72..0e863f5849e 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result @@ -104,7 +104,7 @@ restore: t1 .ibd and .cfg files SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure"; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 44 'Tablespace not found' from ./test_wl5522/t1.ibd +ERROR HY000: Got error 44 't1.ibd SET SESSION debug_dbug="-d,ib_import_open_tablespace_failure"; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; @@ -537,7 +537,7 @@ ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,fil_space_create_failure"; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 11 'Generic error' from ./test_wl5522/t1.ibd +ERROR HY000: Got error 11 't1.ibd SET SESSION debug_dbug="-d,fil_space_create_failure"; DROP TABLE test_wl5522.t1; unlink: t1.ibd @@ -550,7 +550,7 @@ ERROR HY000: Tablespace has been discarded for table 't1' restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 39 'Data structure corruption' from ./test_wl5522/t1.ibd +ERROR HY000: Got error 39 't1.ibd SET SESSION debug_dbug="-d,dict_tf_to_fsp_flags_failure"; DROP TABLE test_wl5522.t1; unlink: t1.ibd diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test index 1290b9b5bb7..4b03ac008d2 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test @@ -22,7 +22,7 @@ let MYSQLD_DATADIR =`SELECT @@datadir`; let $innodb_file_per_table = `SELECT @@innodb_file_per_table`; let $innodb_file_format = `SELECT @@innodb_file_format`; let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`; -let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/; +let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/; SET GLOBAL innodb_file_per_table = 1; SELECT @@innodb_file_per_table; @@ -233,8 +233,7 @@ SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure"; # Test failure after attempting a tablespace open SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ---replace_regex /file: '.*t1.ibd'/'t1.ibd'/ - +--replace_regex /'.*[\/\\]/'/ --error ER_GET_ERRMSG ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; @@ -637,8 +636,7 @@ EOF SET SESSION debug_dbug="+d,fil_space_create_failure"; ---replace_regex $pathfix - +--replace_regex /'.*[\/\\]/'/ --error ER_GET_ERRMSG ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; @@ -669,8 +667,7 @@ EOF SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ---replace_regex $pathfix - +--replace_regex /'.*[\/\\]/'/ --error ER_GET_ERRMSG ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; From f3bdf9d7415bb498a32b42ef9ca10f9ac48a15fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 25 Nov 2014 11:38:01 +0200 Subject: [PATCH 050/201] MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) after Operating system error number 36 in a file operation. Analysis: os_file_get_status did not handle error ENAMETOOLONG correctly. Fix: Add correct handling for error ENAMETOOLONG. Note that on InnoDB case the error is not passed all the way up to server. That would be bigger rewamp. --- .../suite/innodb/r/innodb-mdev7046.result | 22 +++++++++++++ .../suite/innodb/t/innodb-mdev7046.test | 31 +++++++++++++++++++ storage/innobase/include/os0file.h | 1 + storage/innobase/os/os0file.cc | 8 +++-- storage/xtradb/include/os0file.h | 1 + storage/xtradb/os/os0file.cc | 8 +++-- 6 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/innodb/r/innodb-mdev7046.result create mode 100644 mysql-test/suite/innodb/t/innodb-mdev7046.test diff --git a/mysql-test/suite/innodb/r/innodb-mdev7046.result b/mysql-test/suite/innodb/r/innodb-mdev7046.result new file mode 100644 index 00000000000..db183346df5 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-mdev7046.result @@ -0,0 +1,22 @@ +call mtr.add_suppression("InnoDB: File ./test/t1*"); +call mtr.add_suppression("nnoDB: Error number*"); +USE test; +create table t1(f1 INT,f2 INT,f3 CHAR (10),primary key(f1,f2)) partition by range(f1) subpartition by hash(f2) subpartitions 2 (partition p1 values less than (0),partition p2 values less than (2),partition p3 values less than (2147483647)); +RENAME TABLE t1 TO `t2_new..............................................end`; +ERROR HY000: Error on rename of 't2_new' (Errcode: 36 "File name too long") +alter table t1 engine=innodb; +RENAME TABLE t1 TO `t2_new..............................................end`; +ERROR HY000: Error on rename of 't2_new' (errno: -1 "Internal error < 0 (Not system error)") +show warnings; +Level Code Message +Error 1025 Error on rename of 't2_new' (errno: -1 "Internal error < 0 (Not system error)") +drop table t1; +DROP DATABASE test; +CREATE DATABASE test; +USE test; +SET @@session.storage_engine=MYISAM; +CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); +ERROR HY000: Can't create/write to file '/tmp/not-existing/t1#P#p0#SP#sp0.MYI' (Errcode: 2 "No such file or directory") +CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); +ALTER TABLE t1 ENGINE=InnoDB; +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test new file mode 100644 index 00000000000..491b13dea90 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -0,0 +1,31 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +# Ignore OS errors +call mtr.add_suppression("InnoDB: File ./test/t1*"); +call mtr.add_suppression("nnoDB: Error number*"); + +# MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) +# after Operating system error number 36 in a file operation + +USE test; +create table t1(f1 INT,f2 INT,f3 CHAR (10),primary key(f1,f2)) partition by range(f1) subpartition by hash(f2) subpartitions 2 (partition p1 values less than (0),partition p2 values less than (2),partition p3 values less than (2147483647)); +--replace_regex /'.*t2_new.*'/'t2_new'/ +--error 7 +RENAME TABLE t1 TO `t2_new..............................................end`; +alter table t1 engine=innodb; +--replace_regex /'.*t2_new.*'/'t2_new'/ +--error 1025 +RENAME TABLE t1 TO `t2_new..............................................end`; +--replace_regex /'.*t2_new.*'/'t2_new'/ +show warnings; +drop table t1; + +DROP DATABASE test;CREATE DATABASE test;USE test; +SET @@session.storage_engine=MYISAM; +--error 1 +CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); +CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); +ALTER TABLE t1 ENGINE=InnoDB; + +drop table t1; diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 5fea0023220..74d3c6bbc7c 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -139,6 +139,7 @@ enum os_file_create_t { /* @} */ /** Error codes from os_file_get_last_error @{ */ +#define OS_FILE_NAME_TOO_LONG 36 #define OS_FILE_NOT_FOUND 71 #define OS_FILE_DISK_FULL 72 #define OS_FILE_ALREADY_EXISTS 73 diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index da2ae91763c..f94d6353431 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -467,6 +467,8 @@ os_file_get_last_error_low( return(OS_FILE_OPERATION_ABORTED); } else if (err == ERROR_ACCESS_DENIED) { return(OS_FILE_ACCESS_VIOLATION); + } else if (err == ERROR_BUFFER_OVERFLOW) { + return(OS_FILE_NAME_TOO_LONG); } else { return(OS_FILE_ERROR_MAX + err); } @@ -528,6 +530,8 @@ os_file_get_last_error_low( return(OS_FILE_NOT_FOUND); case EEXIST: return(OS_FILE_ALREADY_EXISTS); + case ENAMETOOLONG: + return(OS_FILE_NAME_TOO_LONG); case EXDEV: case ENOTDIR: case EISDIR: @@ -3049,7 +3053,7 @@ os_file_status( struct _stat64 statinfo; ret = _stat64(path, &statinfo); - if (ret && (errno == ENOENT || errno == ENOTDIR)) { + if (ret && (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG)) { /* file does not exist */ *exists = FALSE; return(TRUE); @@ -3077,7 +3081,7 @@ os_file_status( struct stat statinfo; ret = stat(path, &statinfo); - if (ret && (errno == ENOENT || errno == ENOTDIR)) { + if (ret && (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG)) { /* file does not exist */ *exists = FALSE; return(TRUE); diff --git a/storage/xtradb/include/os0file.h b/storage/xtradb/include/os0file.h index 0c9f634266a..e70ae05f7c4 100644 --- a/storage/xtradb/include/os0file.h +++ b/storage/xtradb/include/os0file.h @@ -144,6 +144,7 @@ enum os_file_create_t { /* @} */ /** Error codes from os_file_get_last_error @{ */ +#define OS_FILE_NAME_TOO_LONG 36 #define OS_FILE_NOT_FOUND 71 #define OS_FILE_DISK_FULL 72 #define OS_FILE_ALREADY_EXISTS 73 diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index dcab27370f5..d1724c378bd 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -565,6 +565,8 @@ os_file_get_last_error_low( return(OS_FILE_OPERATION_ABORTED); } else if (err == ERROR_ACCESS_DENIED) { return(OS_FILE_ACCESS_VIOLATION); + } else if (err == ERROR_BUFFER_OVERFLOW) { + return(OS_FILE_NAME_TOO_LONG); } else { return(OS_FILE_ERROR_MAX + err); } @@ -626,6 +628,8 @@ os_file_get_last_error_low( return(OS_FILE_NOT_FOUND); case EEXIST: return(OS_FILE_ALREADY_EXISTS); + case ENAMETOOLONG: + return(OS_FILE_NAME_TOO_LONG); case EXDEV: case ENOTDIR: case EISDIR: @@ -3219,7 +3223,7 @@ os_file_status( struct _stat64 statinfo; ret = _stat64(path, &statinfo); - if (ret && (errno == ENOENT || errno == ENOTDIR)) { + if (ret && (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG)) { /* file does not exist */ *exists = FALSE; return(TRUE); @@ -3247,7 +3251,7 @@ os_file_status( struct stat statinfo; ret = stat(path, &statinfo); - if (ret && (errno == ENOENT || errno == ENOTDIR)) { + if (ret && (errno == ENOENT || errno == ENOTDIR || errno == ENAMETOOLONG)) { /* file does not exist */ *exists = FALSE; return(TRUE); From b79685902d95df2c98544e8171b92cb09417328e Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 25 Nov 2014 12:19:48 +0100 Subject: [PATCH 051/201] MDEV-6903: gtid_slave_pos is incorrect after master crash When a master slave restarts, it logs a special restart format description event in its binlog. When the slave sees this event, it knows it needs to roll back any active partial transaction, in case the master crashed previously in the middle of writing such transaction to its binlog. However, there was a bug where this rollback did not reset rgi->pending_gtid. This caused the @@gtid_slave_pos to be updated incorrectly with the GTID of the partial transaction that was rolled back. Fix this by always clearing rgi->pending_gtid in cleanup_context(), hopefully preventing similar bugs from turning up in other special cases where a transaction is rolled back during replication. Thanks to Pavel Ivanov for tracking down the issue and providing a test case. --- mysql-test/suite/rpl/r/rpl_gtid_crash.result | 61 +++++++++++ mysql-test/suite/rpl/t/rpl_gtid_crash.test | 100 +++++++++++++++++++ sql/rpl_rli.cc | 5 + 3 files changed, 166 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index 3417ad561f4..bbe1dfc6c5f 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -133,9 +133,17 @@ SELECT @@GLOBAL.server_id; 3 SELECT * from t1 WHERE a > 10 ORDER BY a; a +gtid_check +Binlog pos ok # Wait 30 seconds for SQL thread to catch up with IO thread SELECT * from t1 WHERE a > 10 ORDER BY a; a +gtid_check +Binlog pos ok +gtid_check +Slave pos ok +gtid_check +Current pos ok # Repeat this with additional transactions on the master SET GLOBAL debug_dbug="+d,inject_error_writing_xid"; BEGIN; @@ -175,11 +183,21 @@ SELECT * from t1 WHERE a > 10 ORDER BY a; a 13 14 +gtid_check +Binlog pos ok +gtid_check +Current pos ok # Wait 30 seconds for SQL thread to catch up with IO thread SELECT * from t1 WHERE a > 10 ORDER BY a; a 13 14 +gtid_check +Binlog pos ok +gtid_check +Slave pos ok +gtid_check +Current pos ok # Repeat this with additional transactions on the master SET GLOBAL debug_dbug="+d,inject_error_writing_xid"; BEGIN; @@ -205,5 +223,48 @@ a 14 23 24 +# Repeat this with slave restart +SET GLOBAL debug_dbug="+d,inject_error_writing_xid"; +BEGIN; +INSERT INTO t1 VALUES (25); +COMMIT; +ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device") +SET GLOBAL debug_dbug="+d,crash_dispatch_command_before"; +COMMIT; +Got one of the listed errors +# Wait 30 seconds for IO thread to connect and SQL thread to catch up +# with IO thread. +include/stop_slave.inc +gtid_check +Binlog pos ok +gtid_check +Current pos ok +INSERT INTO t1 VALUES (26); +INSERT INTO t1 VALUES (27); +SELECT * from t1 WHERE a > 10 ORDER BY a; +a +13 +14 +23 +24 +26 +27 +include/save_master_gtid.inc +gtid_check +Binlog pos ok +gtid_check +Slave pos ok +gtid_check +Current pos ok +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * from t1 WHERE a > 10 ORDER BY a; +a +13 +14 +23 +24 +26 +27 DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index 0caad2a12fe..fed9b8256db 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -269,6 +269,7 @@ SET GLOBAL debug_dbug="+d,crash_before_writing_xid"; --connection server_1 INSERT INTO t1 VALUES (9), (10); +--let $saved_gtid=`SELECT @@last_gtid` --save_master_pos --connection server_2 @@ -333,6 +334,9 @@ EOF SELECT @@GLOBAL.server_id; SELECT * from t1 WHERE a > 10 ORDER BY a; +--disable_query_log +eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +--enable_query_log --echo # Wait 30 seconds for SQL thread to catch up with IO thread --connection server_2 @@ -357,6 +361,11 @@ if ($read_log_pos != $exec_log_pos) } SELECT * from t1 WHERE a > 10 ORDER BY a; +--disable_query_log +eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_slave_pos, '$saved_gtid'), "Slave pos ok", CONCAT("Unexpected slave pos: ", @@gtid_slave_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCAT("Unexpected current pos: ", @@gtid_current_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +--enable_query_log --echo # Repeat this with additional transactions on the master @@ -387,6 +396,7 @@ EOF SELECT @@GLOBAL.server_id; INSERT INTO t1 VALUES (13); INSERT INTO t1 VALUES (14); +--let $saved_gtid=`SELECT @@last_gtid` SELECT * from t1 WHERE a > 10 ORDER BY a; --source include/save_master_gtid.inc @@ -420,6 +430,10 @@ EOF SELECT @@GLOBAL.server_id; SELECT * from t1 WHERE a > 10 ORDER BY a; +--disable_query_log +eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCAT("Unexpected current pos: ", @@gtid_current_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +--enable_query_log --echo # Wait 30 seconds for SQL thread to catch up with IO thread --connection server_2 @@ -444,6 +458,11 @@ if ($read_log_pos != $exec_log_pos) } SELECT * from t1 WHERE a > 10 ORDER BY a; +--disable_query_log +eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_slave_pos, '$saved_gtid'), "Slave pos ok", CONCAT("Unexpected slave pos: ", @@gtid_slave_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCAT("Unexpected current pos: ", @@gtid_current_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +--enable_query_log --echo # Repeat this with additional transactions on the master @@ -472,6 +491,7 @@ EOF INSERT INTO t1 VALUES (23); INSERT INTO t1 VALUES (24); +--let $saved_gtid=`SELECT @@last_gtid` SELECT * from t1 WHERE a > 10 ORDER BY a; --source include/save_master_gtid.inc @@ -479,6 +499,86 @@ SELECT * from t1 WHERE a > 10 ORDER BY a; --source include/sync_with_master_gtid.inc SELECT * from t1 WHERE a > 10 ORDER BY a; +--echo # Repeat this with slave restart + +--connection server_1 +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF + +SET GLOBAL debug_dbug="+d,inject_error_writing_xid"; +BEGIN; +INSERT INTO t1 VALUES (25); +--error ER_ERROR_ON_WRITE +COMMIT; +SET GLOBAL debug_dbug="+d,crash_dispatch_command_before"; +--error 2006,2013 +COMMIT; + +--source include/wait_until_disconnected.inc + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF + +--connection server_1 +--enable_reconnect +--source include/wait_until_connected_again.inc + +--connection server_2 +--echo # Wait 30 seconds for IO thread to connect and SQL thread to catch up +--echo # with IO thread. +--let $wait_timeout= 300 +while ($wait_timeout != 0) +{ + --let $connected=`SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE State = 'Waiting for master to send event'` + if ($connected) + { + --let $read_log_pos= query_get_value('SHOW SLAVE STATUS', Read_Master_Log_Pos, 1) + --let $exec_log_pos= query_get_value('SHOW SLAVE STATUS', Exec_Master_Log_Pos, 1) + if ($read_log_pos == $exec_log_pos) + { + --let $wait_timeout= 0 + } + if ($read_log_pos != $exec_log_pos) + { + --sleep 0.1 + --dec $wait_timeout + } + } + if (!$connected) + { + --sleep 0.1 + --dec $wait_timeout + } +} +if (`SELECT NOT $connected OR $read_log_pos != $exec_log_pos`) +{ + --die Timeout wait for IO thread to connect and SQL thread to catch up with IO thread +} + +--source include/stop_slave.inc + +--connection server_1 +--disable_query_log +eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCAT("Unexpected current pos: ", @@gtid_current_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +--enable_query_log +INSERT INTO t1 VALUES (26); +INSERT INTO t1 VALUES (27); +SELECT * from t1 WHERE a > 10 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--disable_query_log +eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_slave_pos, '$saved_gtid'), "Slave pos ok", CONCAT("Unexpected slave pos: ", @@gtid_slave_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCAT("Unexpected current pos: ", @@gtid_current_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; +--enable_query_log +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * from t1 WHERE a > 10 ORDER BY a; + --connection server_1 DROP TABLE t1; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index d21ebd494c1..673a8c7ca4f 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1717,6 +1717,11 @@ void rpl_group_info::cleanup_context(THD *thd, bool error) trans_rollback_stmt(thd); // if a "statement transaction" /* trans_rollback() also resets OPTION_GTID_BEGIN */ trans_rollback(thd); // if a "real transaction" + /* + Now that we have rolled back the transaction, make sure we do not + errorneously update the GTID position. + */ + gtid_pending= false; } m_table_map.clear_tables(); slave_close_thread_tables(thd); From e79b7ca966040d5da910e823e98841efd7c3556b Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 25 Nov 2014 14:19:11 +0100 Subject: [PATCH 052/201] MDEV-7179: rpl.rpl_gtid_crash failed in buildbot with Warning: database page corruption or a failed I saw two test failures in rpl.rpl_gtid_crash where we get this in the error log: 141123 12:47:54 [Note] InnoDB: Restoring possible half-written data pages 141123 12:47:54 [Note] InnoDB: from the doublewrite buffer... InnoDB: Warning: database page corruption or a failed InnoDB: file read of space 6 page 3. InnoDB: Trying to recover it from the doublewrite buffer. 141123 12:47:54 [Note] InnoDB: Recovered the page from the doublewrite buffer. This test case deliberately crashes the server, and if this crash happens right in the middle of writing a buffer pool page to disk, it is not unexpected that we can get a half-written page. The page is recovered correctly from the doublewrite buffer. So this patch adds a suppression for this warning in the error log for this test case. --- mysql-test/suite/rpl/r/rpl_gtid_crash.result | 1 + mysql-test/suite/rpl/t/rpl_gtid_crash.test | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index bbe1dfc6c5f..75bd9d0cbb1 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -3,6 +3,7 @@ include/rpl_init.inc [topology=1->2] call mtr.add_suppression("Checking table:"); call mtr.add_suppression("client is using or hasn't closed the table properly"); call mtr.add_suppression("Table .* is marked as crashed and should be repaired"); +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); flush tables; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index fed9b8256db..a6d07ed69f0 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -12,6 +12,11 @@ call mtr.add_suppression("Checking table:"); call mtr.add_suppression("client is using or hasn't closed the table properly"); call mtr.add_suppression("Table .* is marked as crashed and should be repaired"); +# We have seen this warning a couple of times in Buildbot. Since we crash the +# server deliberately, it seems possible that we could in rare cases crash in +# the middle of a page write. The page is recovered from the doublewrite +# buffer ("[Note] InnoDB: Recovered the page from the doublewrite buffer."). +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); flush tables; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; From 06d0d090770571f8cd290d075f8195a7e8d18d7c Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Wed, 26 Nov 2014 11:07:32 +0100 Subject: [PATCH 053/201] MDEV-6582: DEBUG_SYNC does not reset mysys_var->current_mutex, causes assertion "Trying to unlock mutex that wasn't locked" The bug was in DEBUG_SYNC. When waiting, debug_sync_execute() temporarily sets thd->mysys_var->current_mutex to a new value while waiting. However, if the old value of current_mutex was NULL, it was not restored, current_mutex remained set to the temporary value (debug_sync_global.ds_mutex). This made possible the following race: Thread T1 goes to KILL thread T2. In THD::awake(), T1 loads T2->mysys_var->current_mutex, it is set to ds_mutex, T1 locks this mutex. Now T2 runs, it does ENTER_COND, it sets T2->mysys_var->current_mutex to LOCK_wait_commit (for example). Then T1 resumes, it reloads mysys_var->current_mutex, now it is set to LOCK_wait_commit, T1 unlocks this mutex instead of the ds_mutex that it locked previously. This causes safe_mutex to assert with the message: "Trying to unlock mutex LOCK_wait_commit that wasn't locked". The fix is to ensure that DEBUG_SYNC also will restore mysys_var->current_mutex in the case where the original value was NULL. --- sql/debug_sync.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 2980ecd7dbf..5802d726aa2 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1394,8 +1394,9 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) if (action->wait_for.length()) { - mysql_mutex_t *old_mutex; + mysql_mutex_t *old_mutex= NULL; mysql_cond_t *old_cond= NULL; + bool restore_current_mutex; int error= 0; struct timespec abstime; @@ -1412,11 +1413,12 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) { old_mutex= thd->mysys_var->current_mutex; old_cond= thd->mysys_var->current_cond; + restore_current_mutex = true; thd->mysys_var->current_mutex= &debug_sync_global.ds_mutex; thd->mysys_var->current_cond= &debug_sync_global.ds_cond; } else - old_mutex= NULL; + restore_current_mutex = false; set_timespec(abstime, action->timeout); DBUG_EXECUTE("debug_sync_exec", { @@ -1476,7 +1478,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action) is locked. (See comment in THD::exit_cond().) */ mysql_mutex_unlock(&debug_sync_global.ds_mutex); - if (old_mutex) + if (restore_current_mutex) { mysql_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= old_mutex; From 43054872be83c42c852d6e2e0c3efd7d87aeeed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 26 Nov 2014 14:33:55 +0200 Subject: [PATCH 054/201] MDEV-7214: Test failure in main.partition_innodb Problem is on test it tried to verify that no files were left on test database. Fix: There's no need to list other file types, it can only list *.par files --- mysql-test/t/partition_innodb.test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 1e2aacd474a..cb7ad4262cc 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -581,7 +581,7 @@ CREATE INDEX i1 ON t1 (a); DROP TABLE t1; # Before the fix it should show extra file like #sql-2405_2.par ---list_files $MYSQLD_DATADIR/test/ * +--list_files $MYSQLD_DATADIR/test/ *.par --disable_parsing --echo # @@ -616,7 +616,7 @@ ALTER TABLE t1 REORGANIZE PARTITION pMAX INTO SHOW WARNINGS; #Contents of the 'test' database directory: ---list_files $MYSQLD_DATADIR/test +--list_files $MYSQLD_DATADIR/test/ *.par disconnect con1; connection default; @@ -638,6 +638,7 @@ SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 ); DROP TABLE t1; +--remove_file $MYSQLD_DATADIR/test/db.opt --enable_parsing --echo # From e15a83c0c7853a44cad031a3558607cb421461d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 26 Nov 2014 16:41:28 +0200 Subject: [PATCH 055/201] Better comments part 2 with proof and simplified implementation. Thanks to Daniel Black. --- storage/innobase/btr/btr0cur.cc | 53 ++++++++++++++++++++++++--------- storage/xtradb/btr/btr0cur.cc | 52 +++++++++++++++++++++++--------- 2 files changed, 77 insertions(+), 28 deletions(-) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index ea97468a8f1..acc3a4d1c98 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -3844,7 +3844,7 @@ btr_estimate_number_of_different_key_vals( ib_uint64_t* n_diff; ib_uint64_t* n_not_null; ibool stats_null_not_equal; - ullint n_sample_pages; /* number of pages to sample */ + ullint n_sample_pages = 1; /* number of pages to sample */ ulint not_empty_flag = 0; ulint total_external_size = 0; ulint i; @@ -3897,8 +3897,6 @@ btr_estimate_number_of_different_key_vals( if (srv_stats_transient_sample_pages > index->stat_index_size) { if (index->stat_index_size > 0) { n_sample_pages = index->stat_index_size; - } else { - n_sample_pages = 1; } } else { n_sample_pages = srv_stats_transient_sample_pages; @@ -3906,17 +3904,44 @@ btr_estimate_number_of_different_key_vals( } else { /* New logaritmic number of pages that are estimated. Number of pages estimated should be between 1 and - index->stat_index_size. We pick index->stat_index_size - as maximum and log2(index->stat_index_size)*sr_stats_transient_sample_pages - if between range as minimum.*/ - if (index->stat_index_size > 0) { - n_sample_pages = ut_min(index->stat_index_size, - ut_max(ut_min(srv_stats_transient_sample_pages, - index->stat_index_size), - log2(index->stat_index_size) - *srv_stats_transient_sample_pages)); - } else { - n_sample_pages = 1; + index->stat_index_size. + + If we have only 0 or 1 index pages then we can only take 1 + sample. We have already initialized n_sample_pages to 1. + + So taking index size as I and sample as S and log(I)*S as L + + requirement 1) we want the out limit of the expression to not exceed I; + requirement 2) we want the ideal pages to be at least S; + so the current expression is min(I, max( min(S,I), L) + + looking for simplifications: + + case 1: assume S < I + min(I, max( min(S,I), L) -> min(I , max( S, L)) + + but since L=LOG2(I)*S and log2(I) >=1 L>S always so max(S,L) = L. + + so we have: min(I , L) + + case 2: assume I < S + min(I, max( min(S,I), L) -> min(I, max( I, L)) + + case 2a: L > I + min(I, max( I, L)) -> min(I, L) -> I + + case 2b: when L < I + min(I, max( I, L)) -> min(I, I ) -> I + + so taking all case2 paths is I, our expression is: + n_pages = S < I? min(I,L) : I + */ + if (index->stat_index_size > 1) { + n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? + ut_min(index->stat_index_size, + log2(index->stat_index_size)*srv_stats_transient_sample_pages) + : index->stat_index_size; + } } diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index 2bc1a7de13c..b13b196605e 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -4035,7 +4035,7 @@ btr_estimate_number_of_different_key_vals( ib_uint64_t* n_diff; ib_uint64_t* n_not_null; ibool stats_null_not_equal; - ullint n_sample_pages; /* number of pages to sample */ + ullint n_sample_pages=1; /* number of pages to sample */ ulint not_empty_flag = 0; ulint total_external_size = 0; ulint i; @@ -4088,8 +4088,6 @@ btr_estimate_number_of_different_key_vals( if (srv_stats_transient_sample_pages > index->stat_index_size) { if (index->stat_index_size > 0) { n_sample_pages = index->stat_index_size; - } else { - n_sample_pages = 1; } } else { n_sample_pages = srv_stats_transient_sample_pages; @@ -4097,18 +4095,44 @@ btr_estimate_number_of_different_key_vals( } else { /* New logaritmic number of pages that are estimated. Number of pages estimated should be between 1 and - index->stat_index_size. We pick index->stat_index_size - as maximum and log2(index->stat_index_size)*sr_stats_transient_sample_pages - if between range as minimum.*/ + index->stat_index_size. + + If we have only 0 or 1 index pages then we can only take 1 + sample. We have already initialized n_sample_pages to 1. + + So taking index size as I and sample as S and log(I)*S as L + + requirement 1) we want the out limit of the expression to not exceed I; + requirement 2) we want the ideal pages to be at least S; + so the current expression is min(I, max( min(S,I), L) + + looking for simplifications: + + case 1: assume S < I + min(I, max( min(S,I), L) -> min(I , max( S, L)) + + but since L=LOG2(I)*S and log2(I) >=1 L>S always so max(S,L) = L. + + so we have: min(I , L) + + case 2: assume I < S + min(I, max( min(S,I), L) -> min(I, max( I, L)) + + case 2a: L > I + min(I, max( I, L)) -> min(I, L) -> I + + case 2b: when L < I + min(I, max( I, L)) -> min(I, I ) -> I + + so taking all case2 paths is I, our expression is: + n_pages = S < I? min(I,L) : I + */ + if (index->stat_index_size > 1) { + n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? + ut_min(index->stat_index_size, + log2(index->stat_index_size)*srv_stats_transient_sample_pages) + : index->stat_index_size; - if (index->stat_index_size > 0) { - n_sample_pages = ut_min(index->stat_index_size, - ut_max(ut_min(srv_stats_transient_sample_pages, - index->stat_index_size), - log2(index->stat_index_size) - *srv_stats_transient_sample_pages)); - } else { - n_sample_pages = 1; } } From 5ae1639c02d1f31cf619f5a8d50ffd196f693db8 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 27 Nov 2014 11:47:22 +0400 Subject: [PATCH 056/201] Backporting a cleanup in boolean function from 10.1: Moving Item_bool_func2 and Item_func_opt_neg from Item_int_func to Item_bool_func. Now all functions that return is_bool_func()=true have a common root class Item_bool_func. This change is needed to fix MDEV-7149 properly. --- sql/item_cmpfunc.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index d4a1c6b1384..8e2b8a9fd6a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -122,6 +122,8 @@ public: Item_bool_func() :Item_int_func() {} Item_bool_func(Item *a) :Item_int_func(a) {} Item_bool_func(Item *a,Item *b) :Item_int_func(a,b) {} + Item_bool_func(Item *a, Item *b, Item *c) :Item_int_func(a, b, c) {} + Item_bool_func(List &list) :Item_int_func(list) { } Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {} bool is_bool_func() { return 1; } void fix_length_and_dec() { decimals=0; max_length=1; } @@ -364,7 +366,7 @@ public: virtual bool l_op() const { return 1; } }; -class Item_bool_func2 :public Item_int_func +class Item_bool_func2 :public Item_bool_func { /* Bool with 2 string args */ protected: Arg_comparator cmp; @@ -372,7 +374,7 @@ protected: public: Item_bool_func2(Item *a,Item *b) - :Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1), + :Item_bool_func(a,b), cmp(tmp_arg, tmp_arg+1), abort_on_null(FALSE) { sargable= TRUE; } void fix_length_and_dec(); int set_cmp_func() @@ -389,14 +391,12 @@ public: } bool is_null() { return MY_TEST(args[0]->is_null() || args[1]->is_null()); } - bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; } - uint decimal_precision() const { return 1; } void top_level_item() { abort_on_null= TRUE; } Arg_comparator *get_comparator() { return &cmp; } void cleanup() { - Item_int_func::cleanup(); + Item_bool_func::cleanup(); cmp.cleanup(); } @@ -646,16 +646,16 @@ public: */ -class Item_func_opt_neg :public Item_int_func +class Item_func_opt_neg :public Item_bool_func { public: bool negated; /* <=> the item represents NOT */ bool pred_level; /* <=> [NOT] is used on a predicate level */ public: Item_func_opt_neg(Item *a, Item *b, Item *c) - :Item_int_func(a, b, c), negated(0), pred_level(0) {} + :Item_bool_func(a, b, c), negated(0), pred_level(0) {} Item_func_opt_neg(List &list) - :Item_int_func(list), negated(0), pred_level(0) {} + :Item_bool_func(list), negated(0), pred_level(0) {} public: inline void negate() { negated= !negated; } inline void top_level_item() { pred_level= 1; } @@ -686,9 +686,7 @@ public: bool fix_fields(THD *, Item **); void fix_length_and_dec(); virtual void print(String *str, enum_query_type query_type); - bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; } - uint decimal_precision() const { return 1; } bool eval_not_null_tables(uchar *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); bool count_sargable_conds(uchar *arg); @@ -1316,7 +1314,6 @@ public: longlong val_int(); bool fix_fields(THD *, Item **); void fix_length_and_dec(); - uint decimal_precision() const { return 1; } void cleanup() { uint i; @@ -1337,7 +1334,6 @@ public: enum Functype functype() const { return IN_FUNC; } const char *func_name() const { return " IN "; } bool nulls_in_row(); - bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; } bool eval_not_null_tables(uchar *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); From 74e581b7c408d1babef19334dfd465783fd9d038 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 27 Nov 2014 09:34:41 +0100 Subject: [PATCH 057/201] MDEV-7037: MariaDB 10.0 does not build on Debian / kfreebsd-i386/amd64 due to MTR failure: multi_source.gtid MDEV-7106: Sporadic test failure in multi_source.gtid MDEV-7153: Yet another sporadic failure of multi_source.gtid in buildbot This patch fixes three races in the multi_source.gtid test case that could cause sporadic failures: 1. Do not put SHOW ALL SLAVES STATUS in the output, the output is not stable. 2. Ensure that slave1 has replicated as far as expected, before stopping its connection to master1 (otherwise the following wait will time out due to rows not replicated from master1). 3. Ensure that slave2 has replicated far enough before connecting slave1 to it (otherwise we get an error during connect that slave1 is ahead of slave2). --- mysql-test/suite/multi_source/gtid.result | 55 +---------------------- mysql-test/suite/multi_source/gtid.test | 11 ++++- 2 files changed, 11 insertions(+), 55 deletions(-) diff --git a/mysql-test/suite/multi_source/gtid.result b/mysql-test/suite/multi_source/gtid.result index ce926ddc995..28ac1e7429e 100644 --- a/mysql-test/suite/multi_source/gtid.result +++ b/mysql-test/suite/multi_source/gtid.result @@ -26,59 +26,6 @@ SET SQL_LOG_BIN=0; CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)); SET SQL_LOG_BIN=1; INSERT INTO t3 VALUES (201, "initial 2"); -SHOW ALL SLAVES STATUS; -Connection_name -Slave_SQL_State Slave has read all relay log; waiting for the slave I/O thread to update it -Slave_IO_State Waiting for master to send event -Master_Host 127.0.0.1 -Master_User root -Master_Port MYPORT_3 -Connect_Retry 60 -Master_Log_File server3-bin.000001 -Read_Master_Log_Pos 1501 -Relay_Log_File mysqld-relay-bin.000002 -Relay_Log_Pos 1790 -Relay_Master_Log_File server3-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos 1501 -Relay_Log_Space 2088 -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master 0 -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 3 -Master_SSL_Crl -Master_SSL_Crlpath -Using_Gtid No -Gtid_IO_Pos -Retried_transactions 0 -Max_relay_log_size 1073741824 -Executed_log_entries 25 -Slave_received_heartbeats 0 -Slave_heartbeat_period 60.000 -Gtid_Slave_Pos 1-1-4,2-2-3 *** Now move slave2 to replicate from both master1 and master2 instead of just slave1 *** STOP ALL SLAVES; Warnings: @@ -102,9 +49,11 @@ INSERT INTO t1 VALUES (3, "switch 2"); INSERT INTO t3 VALUES (103, "switch 2 a"); INSERT INTO t2 VALUES (3, "switch 2"); INSERT INTO t3 VALUES (203, "switch 2 b"); +include/save_master_gtid.inc STOP SLAVE 'slave2'; INSERT INTO t2 VALUES (4, "switch 3"); INSERT INTO t3 VALUES (204, "switch 3 b"); +include/sync_with_master_gtid.inc CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos; START SLAVE; SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test index 7a085823693..bebee66068f 100644 --- a/mysql-test/suite/multi_source/gtid.test +++ b/mysql-test/suite/multi_source/gtid.test @@ -58,8 +58,6 @@ INSERT INTO t3 VALUES (201, "initial 2"); --source include/wait_condition.inc --let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=1 AND (SELECT COUNT(*) FROM t2)=1 AND (SELECT COUNT(*) FROM t3)=2 --source include/wait_condition.inc ---replace_result $SERVER_MYPORT_3 MYPORT_3 -query_vertical SHOW ALL SLAVES STATUS; --echo *** Now move slave2 to replicate from both master1 and master2 instead of just slave1 *** STOP ALL SLAVES; @@ -93,6 +91,8 @@ set default_master_connection = ''; --connection slave1 # Set up so that slave1 will have to start from two different positions # in the slave2 binlog (one for each domain_id). +--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=2 AND (SELECT COUNT(*) FROM t2)=2 AND (SELECT COUNT(*) FROM t3)=4 +--source include/wait_condition.inc STOP SLAVE 'slave1'; --connection master1 @@ -106,6 +106,7 @@ INSERT INTO t3 VALUES (103, "switch 2 a"); --connection master2 INSERT INTO t2 VALUES (3, "switch 2"); INSERT INTO t3 VALUES (203, "switch 2 b"); +--source include/save_master_gtid.inc --connection slave1 --let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=2 AND (SELECT COUNT(*) FROM t2)=3 AND (SELECT COUNT(*) FROM t3)=5 @@ -116,6 +117,12 @@ STOP SLAVE 'slave2'; INSERT INTO t2 VALUES (4, "switch 3"); INSERT INTO t3 VALUES (204, "switch 3 b"); +--connection slave2 +# Make sure that slave2 has replicated far enough before connecting slave1 to +# it (otherwise we get an error that slave1 requested to start from a GTID +# which is not in slave2's binlogs). +--source include/sync_with_master_gtid.inc + --connection slave1 --replace_result $SERVER_MYPORT_4 MYPORT_4 eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos; From f8e1952be4cb0736d89a8aed57e872b242a7a2c1 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 28 Nov 2014 18:11:58 +0400 Subject: [PATCH 058/201] MDEV-7149 Constant propagation erroneously applied for LIKE Simply disallowing equality propagation into LIKE. A more delicate fix is be possible, but it would need too many changes, which is not desirable in 10.0 at this point. --- .../include/ctype_like_cond_propagation.inc | 39 +++ ...type_like_cond_propagation_utf8_german.inc | 16 ++ mysql-test/r/ctype_binary.result | 95 ++++++ mysql-test/r/ctype_latin1.result | 192 +++++++++++++ mysql-test/r/ctype_uca.result | 270 ++++++++++++++++++ mysql-test/r/ctype_ucs.result | 193 +++++++++++++ mysql-test/r/ctype_utf8.result | 229 +++++++++++++++ mysql-test/t/ctype_binary.test | 12 + mysql-test/t/ctype_latin1.test | 7 + mysql-test/t/ctype_uca.test | 8 + mysql-test/t/ctype_ucs.test | 6 + mysql-test/t/ctype_utf8.test | 7 + sql/item_cmpfunc.h | 37 ++- 13 files changed, 1110 insertions(+), 1 deletion(-) create mode 100644 mysql-test/include/ctype_like_cond_propagation.inc create mode 100644 mysql-test/include/ctype_like_cond_propagation_utf8_german.inc diff --git a/mysql-test/include/ctype_like_cond_propagation.inc b/mysql-test/include/ctype_like_cond_propagation.inc new file mode 100644 index 00000000000..023cf2b1b30 --- /dev/null +++ b/mysql-test/include/ctype_like_cond_propagation.inc @@ -0,0 +1,39 @@ +--echo # +--echo # MDEV-7149 Constant condition propagation erroneously applied for LIKE +--echo # + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +DROP TABLE t1; diff --git a/mysql-test/include/ctype_like_cond_propagation_utf8_german.inc b/mysql-test/include/ctype_like_cond_propagation_utf8_german.inc new file mode 100644 index 00000000000..2cfa89448bc --- /dev/null +++ b/mysql-test/include/ctype_like_cond_propagation_utf8_german.inc @@ -0,0 +1,16 @@ +--echo # +--echo # MDEV-7149 Constant condition propagation erroneously applied for LIKE +--echo # + +CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ae'),('ä'); +SELECT * FROM t1 WHERE c1='ä'; +SELECT * FROM t1 WHERE c1 LIKE 'ae'; +SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +SELECT * FROM t1 WHERE CONCAT(c1)='ä'; +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae'; +SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 550c47ccdaa..f35e6fd8265 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2915,3 +2915,98 @@ SET sql_mode=default; # # End of 5.5 tests # +# +# Start of 10.0 tests +# +SET NAMES binary; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 0 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 0 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 0 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varbinary(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`)) +DROP TABLE t1; +# +# End of 10.0 tests +# diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index fac9824401f..970c067b25c 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -7659,6 +7659,198 @@ DROP FUNCTION mysql_real_escape_string_generated; DROP FUNCTION iswellformed; DROP TABLE allbytes; # End of ctype_backslash.inc +SET NAMES latin1; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +SET NAMES latin1 COLLATE latin1_bin; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; # # MDEV-6752 Trailing incomplete characters are not replaced to question marks on conversion # diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index c947689ef81..94db9d8f783 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -7700,6 +7700,276 @@ DROP TABLE t1; # Start of MariaDB-10.0 tests # +SET NAMES utf8 COLLATE utf8_unicode_ci; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('ae'),('ä'); +SELECT * FROM t1 WHERE c1='ä'; +c1 +ä +SELECT * FROM t1 WHERE c1 LIKE 'ae'; +c1 +ae +SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((`test`.`t1`.`c1` = 'ä') and (`test`.`t1`.`c1` like 'ae')) +SELECT * FROM t1 WHERE CONCAT(c1)='ä'; +c1 +ä +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae'; +c1 +ae +SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'ä') and (concat(`test`.`t1`.`c1`) like 'ae')) +DROP TABLE IF EXISTS t1; +SET NAMES utf8 COLLATE utf8_german2_ci; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_german2_ci NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('ae'),('ä'); +SELECT * FROM t1 WHERE c1='ä'; +c1 +ae +ä +SELECT * FROM t1 WHERE c1 LIKE 'ae'; +c1 +ae +SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +c1 +ae +EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((`test`.`t1`.`c1` = 'ä') and (`test`.`t1`.`c1` like 'ae')) +SELECT * FROM t1 WHERE CONCAT(c1)='ä'; +c1 +ae +ä +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae'; +c1 +ae +SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +c1 +ae +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'ä') and (concat(`test`.`t1`.`c1`) like 'ae')) +DROP TABLE IF EXISTS t1; # # MDEV-4929 Myanmar collation # diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 3cfc076b8a0..68435f3f41c 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -5326,6 +5326,199 @@ DROP TABLE t1; # # Start of 10.0 tests # +SET NAMES latin1, collation_connection=ucs2_bin; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +SET NAMES latin1, collation_connection=ucs2_general_ci; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +SET NAMES latin1; # # MDEV-6661 PI() does not work well in UCS2/UTF16/UTF32 context # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 43f3aa4b6c9..c752024ec7f 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5936,6 +5936,235 @@ set max_sort_length=default; # # Start of 10.0 tests # +SET NAMES utf8 COLLATE utf8_bin; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +SET NAMES utf8; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE CONCAT(c1)='a'; +c1 +a +a +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; +c1 +a +SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'a') and (concat(`test`.`t1`.`c1`) like 'a ')) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT * FROM t1 WHERE 'a'=CONCAT(c1); +c1 +a +a +SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); +c1 +a +SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +c1 +a +EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('a' = concat(`test`.`t1`.`c1`)) and ('a ' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '% '=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('% ' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('%'),('% '); +SELECT * FROM t1 WHERE '%'=CONCAT(c1); +c1 +% +% +SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); +c1 +% +SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +c1 +% +EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) +DROP TABLE t1; +# +# MDEV-7149 Constant condition propagation erroneously applied for LIKE +# +CREATE TABLE t1 AS SELECT REPEAT('a',10) AS c1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('ae'),('ä'); +SELECT * FROM t1 WHERE c1='ä'; +c1 +ä +SELECT * FROM t1 WHERE c1 LIKE 'ae'; +c1 +ae +SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((`test`.`t1`.`c1` = 'ä') and (`test`.`t1`.`c1` like 'ae')) +SELECT * FROM t1 WHERE CONCAT(c1)='ä'; +c1 +ä +SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae'; +c1 +ae +SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +c1 +EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ((concat(`test`.`t1`.`c1`) = 'ä') and (concat(`test`.`t1`.`c1`) like 'ae')) +DROP TABLE IF EXISTS t1; # # MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string) # diff --git a/mysql-test/t/ctype_binary.test b/mysql-test/t/ctype_binary.test index 8b57854de83..4a2646d1db5 100644 --- a/mysql-test/t/ctype_binary.test +++ b/mysql-test/t/ctype_binary.test @@ -10,3 +10,15 @@ set names binary; --echo # --echo # End of 5.5 tests --echo # + + +--echo # +--echo # Start of 10.0 tests +--echo # + +SET NAMES binary; +--source include/ctype_like_cond_propagation.inc + +--echo # +--echo # End of 10.0 tests +--echo # diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 5da1534029b..336d8ca761d 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -210,6 +210,13 @@ set names latin1; let $ctype_unescape_combinations=selected; --source include/ctype_unescape.inc +SET NAMES latin1; +--source include/ctype_like_cond_propagation.inc + +SET NAMES latin1 COLLATE latin1_bin; +--source include/ctype_like_cond_propagation.inc + + --echo # --echo # MDEV-6752 Trailing incomplete characters are not replaced to question marks on conversion --echo # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 79f163d7e5d..fa33535c9b1 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -571,6 +571,14 @@ SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci; --echo # --echo +SET NAMES utf8 COLLATE utf8_unicode_ci; +--source include/ctype_like_cond_propagation.inc +--source include/ctype_like_cond_propagation_utf8_german.inc + +SET NAMES utf8 COLLATE utf8_german2_ci; +--source include/ctype_like_cond_propagation.inc +--source include/ctype_like_cond_propagation_utf8_german.inc + --echo # --echo # MDEV-4929 Myanmar collation --echo # diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index d269fb35dfe..33d41e9bc4c 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -897,6 +897,12 @@ DROP TABLE t1; --echo # Start of 10.0 tests --echo # +SET NAMES latin1, collation_connection=ucs2_bin; +--source include/ctype_like_cond_propagation.inc +SET NAMES latin1, collation_connection=ucs2_general_ci; +--source include/ctype_like_cond_propagation.inc +SET NAMES latin1; + --echo # --echo # MDEV-6661 PI() does not work well in UCS2/UTF16/UTF32 context --echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index e02d5a915b7..1e9047cca8e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1658,6 +1658,13 @@ set max_sort_length=default; --echo # Start of 10.0 tests --echo # +SET NAMES utf8 COLLATE utf8_bin; +--source include/ctype_like_cond_propagation.inc +SET NAMES utf8; +--source include/ctype_like_cond_propagation.inc +--source include/ctype_like_cond_propagation_utf8_german.inc + + --echo # --echo # MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string) --echo # diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 8e2b8a9fd6a..affed52cfd2 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1486,7 +1486,42 @@ public: longlong val_int(); enum Functype functype() const { return LIKE_FUNC; } optimize_type select_optimize() const; - cond_result eq_cmp_result() const { return COND_TRUE; } + cond_result eq_cmp_result() const + { + /** + We cannot always rewrite conditions as follows: + from: WHERE expr1=const AND expr1 LIKE expr2 + to: WHERE expr1=const AND const LIKE expr2 + or + from: WHERE expr1=const AND expr2 LIKE expr1 + to: WHERE expr1=const AND expr2 LIKE const + + because LIKE works differently comparing to the regular "=" operator: + + 1. LIKE performs a stricter one-character-to-one-character comparison + and does not recognize contractions and expansions. + Replacing "expr1" to "const in LIKE would make the condition + stricter in case of a complex collation. + + 2. LIKE does not ignore trailing spaces and thus works differently + from the "=" operator in case of "PAD SPACE" collations + (which are the majority in MariaDB). So, for "PAD SPACE" collations: + + - expr1=const - ignores trailing spaces + - const LIKE expr2 - does not ignore trailing spaces + - expr2 LIKE const - does not ignore trailing spaces + + Allow only "binary" for now. + It neither ignores trailing spaces nor has contractions/expansions. + + TODO: + We could still replace "expr1" to "const" in "expr1 LIKE expr2" + in case of a "PAD SPACE" collation, but only if "expr2" has '%' + at the end. + */ + return ((Item_func_like *)this)->compare_collation() == &my_charset_bin ? + COND_TRUE : COND_OK; + } const char *func_name() const { return "like"; } bool fix_fields(THD *thd, Item **ref); void cleanup(); From 52b25934d7fcf552a955078ccb6b19bef18e99d8 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Mon, 1 Dec 2014 13:53:57 +0100 Subject: [PATCH 059/201] MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave The replication relay log position was sometimes updated incorrectly at the end of a transaction in parallel replication. This happened because the relay log file name was taken from the current Relay_log_info (SQL driver thread), not the correct value for the transaction in question. The result was that if a transaction was applied while the SQL driver thread was at least one relay log file ahead, _and_ the SQL thread was subsequently stopped before applying any events from the most recent relay log file, then the relay log position would be incorrect - wrong relay log file name. Thus, when the slave was started again, usually a relay log read error would result, or in rare cases, if the position happened to be readable, the slave might even skip arbitrary amounts of events. In GTID mode, the relay log position is reset when both slave threads are restarted, so this bug would only be seen in non-GTID mode, or in GTID mode when only the SQL thread, not the IO thread, was stopped. --- mysql-test/suite/rpl/r/rpl_parallel.result | 48 +++++++++++ mysql-test/suite/rpl/t/rpl_parallel.test | 93 ++++++++++++++++++++++ sql/rpl_parallel.cc | 8 ++ sql/rpl_rli.cc | 4 +- 4 files changed, 151 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result index ac21e7a3e01..e1672872386 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-test/suite/rpl/r/rpl_parallel.result @@ -972,6 +972,54 @@ SET GLOBAL binlog_format= @old_format; SET GLOBAL slave_parallel_threads=0; SET GLOBAL slave_parallel_threads=10; include/start_slave.inc +*** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave *** +INSERT INTO t2 VALUES (40); +include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=no; +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100"; +SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +INSERT INTO t2 VALUES (41); +INSERT INTO t2 VALUES (42); +DELETE FROM t2 WHERE a=40; +INSERT INTO t2 VALUES (43); +INSERT INTO t2 VALUES (44); +FLUSH LOGS; +INSERT INTO t2 VALUES (45); +SET gtid_seq_no=100; +INSERT INTO t2 VALUES (46); +BEGIN; +SELECT * FROM t2 WHERE a=40 FOR UPDATE; +a +40 +include/start_slave.inc +SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100'; +STOP SLAVE; +SET debug_sync= 'now WAIT_FOR wait_for_done_waiting'; +ROLLBACK; +include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t2 WHERE a >= 40 ORDER BY a; +a +41 +42 +include/start_slave.inc +SELECT * FROM t2 WHERE a >= 40 ORDER BY a; +a +41 +42 +43 +44 +45 +46 +include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET DEBUG_SYNC= 'RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=slave_pos; +include/start_slave.inc include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index d3ec08f5508..b1b8792acf6 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -1535,6 +1535,99 @@ SET GLOBAL slave_parallel_threads=10; --source include/start_slave.inc +--echo *** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave *** +--connection server_1 +INSERT INTO t2 VALUES (40); +--save_master_pos + +--connection server_2 +--sync_with_master +--source include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=no; +SET @old_dbug= @@GLOBAL.debug_dbug; +# This DBUG injection causes a DEBUG_SYNC signal "scheduled_gtid_0_x_100" when +# GTID 0-1-100 has been scheduled for and fetched by a worker thread. +SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100"; +# This DBUG injection causes a DEBUG_SYNC signal "wait_for_done_waiting" when +# STOP SLAVE has signalled all worker threads to stop. +SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; +# Reset worker threads to make DBUG setting catch on. +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; + + +--connection server_1 +# Setup some transaction for the slave to replicate. +INSERT INTO t2 VALUES (41); +INSERT INTO t2 VALUES (42); +DELETE FROM t2 WHERE a=40; +INSERT INTO t2 VALUES (43); +INSERT INTO t2 VALUES (44); +# Force the slave to switch to a new relay log file. +FLUSH LOGS; +INSERT INTO t2 VALUES (45); +# Inject a GTID 0-1-100, which will trigger a DEBUG_SYNC signal when this +# transaction has been fetched by a worker thread. +SET gtid_seq_no=100; +INSERT INTO t2 VALUES (46); +--save_master_pos + +--connection con_temp2 +# Temporarily block the DELETE on a=40 from completing. +BEGIN; +SELECT * FROM t2 WHERE a=40 FOR UPDATE; + + +--connection server_2 +--source include/start_slave.inc + +# The DBUG injection set above will make the worker thread signal the following +# debug_sync when the GTID 0-1-100 has been reached by a worker thread. +# Thus, at this point, the SQL driver thread has reached the next +# relay log file name, while a worker thread is still processing a +# transaction in the previous relay log file, blocked on the SELECT FOR +# UPDATE. +SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100'; +# At this point, the SQL driver thread is in the new relay log file, while +# the DELETE from the old relay log file is not yet complete. We will stop +# the slave at this point. The bug was that the DELETE statement would +# update the slave position to the _new_ relay log file name instead of +# its own old file name. Thus, by stoping and restarting the slave at this +# point, we would get an error at restart due to incorrect position. (If +# we would let the slave catch up before stopping, the incorrect position +# would be corrected by a later transaction). + +send STOP SLAVE; + +--connection con_temp2 +# Wait for STOP SLAVE to have proceeded sufficiently that it has signalled +# all worker threads to stop; this ensures that we will stop after the DELETE +# transaction (and not after a later transaction that might have been able +# to set a fixed position). +SET debug_sync= 'now WAIT_FOR wait_for_done_waiting'; +# Now release the row lock that was blocking the replication of DELETE. +ROLLBACK; + +--connection server_2 +reap; +--source include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t2 WHERE a >= 40 ORDER BY a; +# Now restart the slave. With the bug present, this would start at an +# incorrect relay log position, causing relay log read error (or if unlucky, +# silently skip a number of events). +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t2 WHERE a >= 40 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET DEBUG_SYNC= 'RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=slave_pos; +--source include/start_slave.inc + + +# Clean up. --connection server_2 --source include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 7c273d51a19..53b37e82cdb 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -631,6 +631,14 @@ handle_rpl_parallel_thread(void *arg) PSI_stage_info old_stage; uint64 wait_count; + DBUG_EXECUTE_IF("rpl_parallel_scheduled_gtid_0_x_100", { + if (rgi->current_gtid.domain_id == 0 && + rgi->current_gtid.seq_no == 100) { + debug_sync_set_action(thd, + STRING_WITH_LEN("now SIGNAL scheduled_gtid_0_x_100")); + } + }); + in_event_group= true; /* If the standalone flag is set, then this event group consists of a diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 673a8c7ca4f..629e046ed0a 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -986,11 +986,11 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos, if (rgi->is_parallel_exec) { /* In case of parallel replication, do not update the position backwards. */ - int cmp= strcmp(group_relay_log_name, event_relay_log_name); + int cmp= strcmp(group_relay_log_name, rgi->event_relay_log_name); if (cmp < 0) { group_relay_log_pos= rgi->future_event_relay_log_pos; - strmake_buf(group_relay_log_name, event_relay_log_name); + strmake_buf(group_relay_log_name, rgi->event_relay_log_name); notify_group_relay_log_name_update(); } else if (cmp == 0 && group_relay_log_pos < rgi->future_event_relay_log_pos) group_relay_log_pos= rgi->future_event_relay_log_pos; From 912bbfda128bbfa049eb0d8fc7789eebe8553e6b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 22 Nov 2014 11:56:29 +0100 Subject: [PATCH 060/201] MDEV-7144 Warnings "bytes lost" during server shutdown after running connect.part_file test in buildbot --- sql/sql_update.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d676ec11ad0..6c4d864e75a 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -603,7 +603,10 @@ int mysql_update(THD *thd, if (query_plan.index == MAX_KEY || (select && select->quick)) { if (init_read_record(&info, thd, table, select, 0, 1, FALSE)) + { + close_cached_file(&tempfile); goto err; + } } else init_read_record_idx(&info, thd, table, 1, query_plan.index, reverse); From e3108e6d2b71eb27fcad0e32a049a91313aa7c79 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 22 Nov 2014 18:43:53 +0100 Subject: [PATCH 061/201] silence stderr correctly --- mysql-test/suite.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm index ac4068a6373..bef37ac4d04 100644 --- a/mysql-test/suite.pm +++ b/mysql-test/suite.pm @@ -53,7 +53,7 @@ sub skip_combinations { $skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok(); $skip{'t/openssl_6975.test'} = 'no or too old openssl' - unless ! IS_WINDOWS and ! system "openssl ciphers TLSv1.2 2>&1 >/dev/null"; + unless ! IS_WINDOWS and ! system "openssl ciphers TLSv1.2 >/dev/null 2>&1"; %skip; } From 6211708a95a64728350ad8d0d3cc374388d49307 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 23 Nov 2014 16:12:26 +0100 Subject: [PATCH 062/201] - Fix a bug causing the day always printed as Sunday for date columns with a date format specifying DDD or DDDD. modified: storage/connect/ha_connect.cc storage/connect/value.cpp --- storage/connect/ha_connect.cc | 1 + storage/connect/value.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 1453c418025..957c28abd28 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1326,6 +1326,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) datm.tm_mday= 12; datm.tm_mon= 11; datm.tm_year= 112; + mktime(&datm); // to get proper day name len= strftime(buf, 256, pdtp->OutFmt, &datm); } else len= 0; diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 81d00862703..11793a7b141 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -2484,8 +2484,10 @@ char *DTVAL::GetCharString(char *p) size_t n = 0; struct tm tm, *ptm= GetGmTime(&tm); - if (ptm) + if (ptm) { + mktime(ptm); // Populate tm_wday and tm_yday to get day name n = strftime(Sdate, Len + 1, Pdtp->OutFmt, ptm); + } // endif ptm if (!n) { *Sdate = '\0'; @@ -2511,6 +2513,8 @@ char *DTVAL::ShowValue(char *buf, int len) if (!Null) { size_t m, n = 0; struct tm tm, *ptm = GetGmTime(&tm); + + if (Len < len) { p = buf; @@ -2520,8 +2524,10 @@ char *DTVAL::ShowValue(char *buf, int len) m = Len + 1; } // endif Len - if (ptm) + if (ptm) { + mktime(ptm); // Populate tm_wday and tm_yday to get day name n = strftime(p, m, Pdtp->OutFmt, ptm); + } // endif ptm if (!n) { *p = '\0'; From c89b8a38de20c00bb6d9d822f7f027ce9fcf51d8 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 24 Nov 2014 18:26:44 +0100 Subject: [PATCH 063/201] - Enhance the implementation of ODBC tables when using scrollable cursor modified: storage/connect/odbconn.cpp storage/connect/odbconn.h storage/connect/tabodbc.cpp --- storage/connect/odbconn.cpp | 22 ++++++++++++---------- storage/connect/odbconn.h | 2 +- storage/connect/tabodbc.cpp | 8 +++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index b68b4648616..e614980a57a 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2439,29 +2439,31 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g) /***********************************************************************/ /* Restart from beginning of result set */ /***********************************************************************/ -bool ODBConn::Rewind(char *sql, ODBCCOL *tocols) +int ODBConn::Rewind(char *sql, ODBCCOL *tocols) { - RETCODE rc; + int rc, rbuf = -1; if (!m_hstmt) - return false; + return rbuf; if (m_Scrollable) { + SQLULEN crow; + try { - rc = SQLFetchScroll(m_hstmt, SQL_FETCH_ABSOLUTE, 0); + rc = SQLExtendedFetch(m_hstmt, SQL_FETCH_FIRST, 1, &crow, NULL); - if (rc != SQL_NO_DATA_FOUND) - ThrowDBX(rc, "SQLFetchScroll", m_hstmt); + if (!Check(rc)) + ThrowDBX(rc, "SQLExtendedFetch", m_hstmt); + rbuf = (int)crow; } catch(DBX *x) { strcpy(m_G->Message, x->GetErrorMessage(0)); - return true; } // end try/catch - } else if (ExecDirectSQL(sql, tocols) < 0) - return true; + } else if (ExecDirectSQL(sql, tocols) >= 0) + rbuf = 0; - return false; + return rbuf; } // end of Rewind /***********************************************************************/ diff --git a/storage/connect/odbconn.h b/storage/connect/odbconn.h index 13d58488b39..ff8357c4591 100644 --- a/storage/connect/odbconn.h +++ b/storage/connect/odbconn.h @@ -124,7 +124,7 @@ class ODBConn : public BLOCK { forceOdbcDialog = 0x0010}; // Always display ODBC connect dialog int Open(PSZ ConnectString, DWORD Options = 0); - bool Rewind(char *sql, ODBCCOL *tocols); + int Rewind(char *sql, ODBCCOL *tocols); void Close(void); PQRYRES AllocateResult(PGLOBAL g); diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index cb21f33c1b1..6608083f1b4 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -130,10 +130,7 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Quoted = GetIntCatInfo("Quoted", 0); Options = ODBConn::noOdbcDialog; //Options = ODBConn::noOdbcDialog | ODBConn::useCursorLib; - - if ((Scrollable = GetBoolCatInfo("Scrollable", false))) - Elemt = 0; // Not compatible with extended fetch - + Scrollable = GetBoolCatInfo("Scrollable", false); Memory = GetBoolCatInfo("Memory", false); Pseudo = 2; // FILID is Ok but not ROWID return false; @@ -775,13 +772,14 @@ bool TDBODBC::OpenDB(PGLOBAL g) if (Memory < 3) { // Method will depend on cursor type - if (Ocp->Rewind(Query, (PODBCCOL)Columns)) { + if ((Rbuf = Ocp->Rewind(Query, (PODBCCOL)Columns)) < 0) { Ocp->Close(); return true; } // endif Rewind } // endif Memory + CurNum = 0; Fpos = 0; return false; } // endif use From c3b0894f7d25a397aa7ec9af9c9afcbe129ae4fa Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 24 Nov 2014 18:32:44 +0100 Subject: [PATCH 064/201] - Make the fix for getting day names of dates more general modified: storage/connect/ha_connect.cc storage/connect/value.cpp --- storage/connect/ha_connect.cc | 2 +- storage/connect/value.cpp | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 957c28abd28..ae8f7f0efa8 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1326,7 +1326,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) datm.tm_mday= 12; datm.tm_mon= 11; datm.tm_year= 112; - mktime(&datm); // to get proper day name + mktime(&datm); // set other fields get proper day name len= strftime(buf, 256, pdtp->OutFmt, &datm); } else len= 0; diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 11793a7b141..0f2cf0ee936 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -2190,7 +2190,8 @@ static void TIME_to_localtime(struct tm *tm, const MYSQL_TIME *ltime) tm->tm_hour= ltime->hour; tm->tm_min= ltime->minute; tm->tm_sec= ltime->second; -} + mktime(tm); // set other tm fields to get proper day name (OB) +} // end of TIME_to_localtime // Added by Alexander Barkov static struct tm *gmtime_mysql(const time_t *timep, struct tm *tm) @@ -2199,7 +2200,7 @@ static struct tm *gmtime_mysql(const time_t *timep, struct tm *tm) thd_gmt_sec_to_TIME(current_thd, <ime, (my_time_t) *timep); TIME_to_localtime(tm, <ime); return tm; -} +} // end of gmtime_mysql /***********************************************************************/ /* GetGmTime: returns a pointer to a static tm structure obtained */ @@ -2484,10 +2485,8 @@ char *DTVAL::GetCharString(char *p) size_t n = 0; struct tm tm, *ptm= GetGmTime(&tm); - if (ptm) { - mktime(ptm); // Populate tm_wday and tm_yday to get day name + if (ptm) n = strftime(Sdate, Len + 1, Pdtp->OutFmt, ptm); - } // endif ptm if (!n) { *Sdate = '\0'; @@ -2524,10 +2523,8 @@ char *DTVAL::ShowValue(char *buf, int len) m = Len + 1; } // endif Len - if (ptm) { - mktime(ptm); // Populate tm_wday and tm_yday to get day name + if (ptm) n = strftime(p, m, Pdtp->OutFmt, ptm); - } // endif ptm if (!n) { *p = '\0'; @@ -2602,7 +2599,7 @@ bool DTVAL::WeekNum(PGLOBAL g, int& nval) /***********************************************************************/ bool DTVAL::FormatValue(PVAL vp, char *fmt) { - char *buf = (char*)vp->GetTo_Val(); // Should be big enough + char *buf = (char*)vp->GetTo_Val(); // Should be big enough struct tm tm, *ptm = GetGmTime(&tm); if (trace > 1) From e5802c38f9fc9329276ac9096c10a8176a283cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 25 Nov 2014 08:06:41 +0200 Subject: [PATCH 065/201] Better comments and add a test case. --- .../suite/innodb/r/innodb-stats-sample.result | 4 + .../suite/innodb/t/innodb-stats-sample.test | 78 +++++++++++++++++++ storage/innobase/btr/btr0cur.c | 18 +++-- storage/xtradb/btr/btr0cur.c | 18 +++-- 4 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 mysql-test/suite/innodb/r/innodb-stats-sample.result create mode 100644 mysql-test/suite/innodb/t/innodb-stats-sample.test diff --git a/mysql-test/suite/innodb/r/innodb-stats-sample.result b/mysql-test/suite/innodb/r/innodb-stats-sample.result new file mode 100644 index 00000000000..a049a1d82c1 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-stats-sample.result @@ -0,0 +1,4 @@ +Variable_name Value +innodb_stats_sample_pages 1 +Variable_name Value +innodb_stats_traditional OFF diff --git a/mysql-test/suite/innodb/t/innodb-stats-sample.test b/mysql-test/suite/innodb/t/innodb-stats-sample.test new file mode 100644 index 00000000000..35d35bfa382 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-stats-sample.test @@ -0,0 +1,78 @@ +--source include/have_innodb.inc +# +# Test that mysqld does not crash when running ANALYZE TABLE with +# different values of the parameter innodb_stats_sample_pages. +# + +# we care only that the following SQL commands do not produce errors +# and do not crash the server +-- disable_query_log +-- disable_result_log +-- enable_warnings + +let $sample_pages=`select @@innodb_stats_sample_pages`; +let $traditional=`select @@innodb_stats_traditional`; +SET GLOBAL innodb_stats_sample_pages=0; +#use new method to calculate statistics +SET GLOBAL innodb_stats_traditional=0; + +# check that the value has been adjusted to 1 +-- enable_result_log +SHOW VARIABLES LIKE 'innodb_stats_sample_pages'; +SHOW VARIABLES LIKE 'innodb_stats_traditional'; +-- disable_result_log + +CREATE TABLE innodb_analyze ( + a INT, + b INT, + c char(50), + KEY(a), + KEY(b,a) +) ENGINE=InnoDB; + +# test with empty table +ANALYZE TABLE innodb_analyze; + +SET GLOBAL innodb_stats_sample_pages=2; +ANALYZE TABLE innodb_analyze; + +SET GLOBAL innodb_stats_sample_pages=1; +ANALYZE TABLE innodb_analyze; + +SET GLOBAL innodb_stats_sample_pages=8000; +ANALYZE TABLE innodb_analyze; + +delimiter //; +create procedure innodb_insert_proc (repeat_count int) +begin + declare current_num int; + set current_num = 0; + while current_num < repeat_count do + insert into innodb_analyze values(current_num, current_num*100,substring(MD5(RAND()), -44)); + set current_num = current_num + 1; + end while; +end// +delimiter ;// +commit; + +set autocommit=0; +call innodb_insert_proc(7000); +commit; +set autocommit=1; + +SET GLOBAL innodb_stats_sample_pages=1; +ANALYZE TABLE innodb_analyze; + +SET GLOBAL innodb_stats_sample_pages=8; +ANALYZE TABLE innodb_analyze; + +SET GLOBAL innodb_stats_sample_pages=16; +ANALYZE TABLE innodb_analyze; + +SET GLOBAL innodb_stats_sample_pages=8000; +ANALYZE TABLE innodb_analyze; + +DROP PROCEDURE innodb_insert_proc; +DROP TABLE innodb_analyze; +EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages; +EVAL SET GLOBAL innodb_stats_traditional=$traditional; \ No newline at end of file diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 4e10ea54126..a0fddd7212d 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -3777,18 +3777,24 @@ btr_estimate_number_of_different_key_vals( n_sample_pages = srv_stats_sample_pages; } } else { - /* New logaritmic number of pages that are estimated. We - first pick minimun from srv_stats_sample_pages and number of - pages on index. Then we pick maximum from previous number of - pages and log2(number of index pages) * srv_stats_sample_pages. */ + /* New logaritmic number of pages that are estimated. + Number of pages estimated should be between 1 and + index->stat_index_size. We pick index->stat_index_size + as maximum and log2(index->stat_index_size)*sr_stats_sample_pages + if between range as minimum.*/ if (index->stat_index_size > 0) { - n_sample_pages = ut_max(ut_min(srv_stats_sample_pages, index->stat_index_size), - log2(index->stat_index_size)*srv_stats_sample_pages); + n_sample_pages = ut_min(index->stat_index_size, + ut_max(ut_min(srv_stats_sample_pages, + index->stat_index_size), + log2(index->stat_index_size)*srv_stats_sample_pages)); } else { n_sample_pages = 1; } } + /* Sanity check */ + ut_ad(n_sample_pages > 0 && n_sample_pages < (index->stat_index_size <= 1 ? 1 : index->stat_index_size)); + /* We sample some pages in the index to get an estimate */ for (i = 0; i < n_sample_pages; i++) { diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c index b7bafd5b5a8..703b0cf6043 100644 --- a/storage/xtradb/btr/btr0cur.c +++ b/storage/xtradb/btr/btr0cur.c @@ -3957,18 +3957,24 @@ btr_estimate_number_of_different_key_vals( n_sample_pages = srv_stats_sample_pages; } } else { - /* New logaritmic number of pages that are estimated. We - first pick minimun from srv_stats_sample_pages and number of - pages on index. Then we pick maximum from previous number of - pages and log2(number of index pages) * srv_stats_sample_pages. */ + /* New logaritmic number of pages that are estimated. + Number of pages estimated should be between 1 and + index->stat_index_size. We pick index->stat_index_size + as maximum and log2(index->stat_index_size)*sr_stats_sample_pages + if between range as minimum.*/ if (index->stat_index_size > 0) { - n_sample_pages = ut_max(ut_min(srv_stats_sample_pages, index->stat_index_size), - log2(index->stat_index_size)*srv_stats_sample_pages); + n_sample_pages = ut_min(index->stat_index_size, + ut_max(ut_min(srv_stats_sample_pages, + index->stat_index_size), + log2(index->stat_index_size)*srv_stats_sample_pages)); } else { n_sample_pages = 1; } } + /* Sanity check */ + ut_ad(n_sample_pages > 0 && n_sample_pages <= (index->stat_index_size < 1 ? 1 : index->stat_index_size)); + /* We sample some pages in the index to get an estimate */ for (i = 0; i < n_sample_pages; i++) { From e3ded84b83a501185eaa7ecc9acc346d9ec605c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 25 Nov 2014 08:22:10 +0200 Subject: [PATCH 066/201] Fix typo. --- storage/innobase/btr/btr0cur.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index a0fddd7212d..d9884b22da4 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -3793,7 +3793,7 @@ btr_estimate_number_of_different_key_vals( } /* Sanity check */ - ut_ad(n_sample_pages > 0 && n_sample_pages < (index->stat_index_size <= 1 ? 1 : index->stat_index_size)); + ut_ad(n_sample_pages > 0 && n_sample_pages <= (index->stat_index_size <= 1 ? 1 : index->stat_index_size)); /* We sample some pages in the index to get an estimate */ From 89a3628b0bbecb7b810e6c9b43b4f6f33b84600d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 25 Nov 2014 12:04:32 +0200 Subject: [PATCH 067/201] Better comments part 2 with proof and simplified implementation. Thanks to Daniel Black. --- storage/innobase/btr/btr0cur.c | 56 +++++++++++++++++++++++++--------- storage/xtradb/btr/btr0cur.c | 52 +++++++++++++++++++++++-------- 2 files changed, 80 insertions(+), 28 deletions(-) diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index d9884b22da4..51dcb498327 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -3718,8 +3718,8 @@ btr_estimate_number_of_different_key_vals( ib_int64_t* n_diff; ib_int64_t* n_not_null; ibool stats_null_not_equal; - ullint n_sample_pages; /* number of pages to sample */ - ulint not_empty_flag = 0; + ullint n_sample_pages = 1; /* number of pages to sample */ + ulint not_empty_flag = 0; ulint total_external_size = 0; ulint i; ulint j; @@ -3770,8 +3770,6 @@ btr_estimate_number_of_different_key_vals( if (srv_stats_sample_pages > index->stat_index_size) { if (index->stat_index_size > 0) { n_sample_pages = index->stat_index_size; - } else { - n_sample_pages = 1; } } else { n_sample_pages = srv_stats_sample_pages; @@ -3779,18 +3777,46 @@ btr_estimate_number_of_different_key_vals( } else { /* New logaritmic number of pages that are estimated. Number of pages estimated should be between 1 and - index->stat_index_size. We pick index->stat_index_size - as maximum and log2(index->stat_index_size)*sr_stats_sample_pages - if between range as minimum.*/ - if (index->stat_index_size > 0) { - n_sample_pages = ut_min(index->stat_index_size, - ut_max(ut_min(srv_stats_sample_pages, - index->stat_index_size), - log2(index->stat_index_size)*srv_stats_sample_pages)); - } else { - n_sample_pages = 1; + index->stat_index_size. + + If we have only 0 or 1 index pages then we can only take 1 + sample. We have already initialized n_sample_pages to 1. + + So taking index size as I and sample as S and log(I)*S as L + + requirement 1) we want the out limit of the expression to not exceed I; + requirement 2) we want the ideal pages to be at least S; + so the current expression is min(I, max( min(S,I), L) + + looking for simplifications: + + case 1: assume S < I + min(I, max( min(S,I), L) -> min(I , max( S, L)) + + but since L=LOG2(I)*S and log2(I) >=1 L>S always so max(S,L) = L. + + so we have: min(I , L) + + case 2: assume I < S + min(I, max( min(S,I), L) -> min(I, max( I, L)) + + case 2a: L > I + min(I, max( I, L)) -> min(I, L) -> I + + case 2b: when L < I + min(I, max( I, L)) -> min(I, I ) -> I + + so taking all case2 paths is I, our expression is: + n_pages = S < I? min(I,L) : I + */ + if (index->stat_index_size > 1) { + n_sample_pages = (srv_stats_sample_pages < index->stat_index_size) ? + ut_min(index->stat_index_size, + log2(index->stat_index_size)*srv_stats_sample_pages) + : index->stat_index_size; + } - } + } /* Sanity check */ ut_ad(n_sample_pages > 0 && n_sample_pages <= (index->stat_index_size <= 1 ? 1 : index->stat_index_size)); diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c index 703b0cf6043..be12bf62abd 100644 --- a/storage/xtradb/btr/btr0cur.c +++ b/storage/xtradb/btr/btr0cur.c @@ -3898,7 +3898,7 @@ btr_estimate_number_of_different_key_vals( ib_int64_t* n_diff; ib_int64_t* n_not_null; ibool stats_null_not_equal; - ullint n_sample_pages; /* number of pages to sample */ + ullint n_sample_pages = 1; /* number of pages to sample */ ulint not_empty_flag = 0; ulint total_external_size = 0; ulint i; @@ -3950,8 +3950,6 @@ btr_estimate_number_of_different_key_vals( if (srv_stats_sample_pages > index->stat_index_size) { if (index->stat_index_size > 0) { n_sample_pages = index->stat_index_size; - } else { - n_sample_pages = 1; } } else { n_sample_pages = srv_stats_sample_pages; @@ -3959,16 +3957,44 @@ btr_estimate_number_of_different_key_vals( } else { /* New logaritmic number of pages that are estimated. Number of pages estimated should be between 1 and - index->stat_index_size. We pick index->stat_index_size - as maximum and log2(index->stat_index_size)*sr_stats_sample_pages - if between range as minimum.*/ - if (index->stat_index_size > 0) { - n_sample_pages = ut_min(index->stat_index_size, - ut_max(ut_min(srv_stats_sample_pages, - index->stat_index_size), - log2(index->stat_index_size)*srv_stats_sample_pages)); - } else { - n_sample_pages = 1; + index->stat_index_size. + + If we have only 0 or 1 index pages then we can only take 1 + sample. We have already initialized n_sample_pages to 1. + + So taking index size as I and sample as S and log(I)*S as L + + requirement 1) we want the out limit of the expression to not exceed I; + requirement 2) we want the ideal pages to be at least S; + so the current expression is min(I, max( min(S,I), L) + + looking for simplifications: + + case 1: assume S < I + min(I, max( min(S,I), L) -> min(I , max( S, L)) + + but since L=LOG2(I)*S and log2(I) >=1 L>S always so max(S,L) = L. + + so we have: min(I , L) + + case 2: assume I < S + min(I, max( min(S,I), L) -> min(I, max( I, L)) + + case 2a: L > I + min(I, max( I, L)) -> min(I, L) -> I + + case 2b: when L < I + min(I, max( I, L)) -> min(I, I ) -> I + + so taking all case2 paths is I, our expression is: + n_pages = S < I? min(I,L) : I + */ + if (index->stat_index_size > 1) { + n_sample_pages = (srv_stats_sample_pages < index->stat_index_size) ? + ut_min(index->stat_index_size, + log2(index->stat_index_size)*srv_stats_sample_pages) + : index->stat_index_size; + } } From 3985316b714b2262db398b3845fffb0a6008e84b Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 26 Nov 2014 14:45:40 -0500 Subject: [PATCH 068/201] update the README to include 7.5.3 and percona server --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index dc7362a5124..57ce296e0ef 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ TokuDB ====== -TokuDB is a high-performance, write optimized, transactional storage engine for MySQL and -MariaDB. For more details, see our [product page][products]. +TokuDB is a high-performance, write optimized, transactional storage engine for MySQL, MariaDB, and Percona Server. +For more details, see our [product page][products]. -This repository contains the MySQL plugin that uses the [TokuFT][tokuft] -core. +This repository contains the MySQL plugin that uses the [TokuFT][tokuft] core. There are also patches to the MySQL and MariaDB kernels, available in our forks of [mysql][mysql] and [mariadb][mariadb]. @@ -15,7 +14,6 @@ forks of [mysql][mysql] and [mariadb][mariadb]. [mysql]: http://github.com/Tokutek/mysql [mariadb]: http://github.com/Tokutek/mariadb - Building -------- @@ -24,14 +22,14 @@ working MySQL or MariaDB with Tokutek patches, and with the TokuDB storage engine, called `make.mysql.bash`. This script will download copies of the needed source code from github and build everything. -To build MySQL 5.5.39 with TokuDB 7.5.2: +To build MySQL 5.5.40 with TokuDB 7.5.3: ```sh -scripts/make.mysql.bash --mysqlbuild=mysql-5.5.39-tokudb-7.5.2-linux-x86_64 +scripts/make.mysql.bash --mysqlbuild=mysql-5.5.40-tokudb-7.5.3-linux-x86_64 ``` -To build MariaDB 5.5.39 with TokuDB 7.5.2: +To build MariaDB 5.5.40 with TokuDB 7.5.3: ```sh -scripts/make.mysql.bash --mysqlbuild=mariadb-5.5.39-tokudb-7.5.2-linux-x86_64 +scripts/make.mysql.bash --mysqlbuild=mariadb-5.5.40-tokudb-7.5.3-linux-x86_64 ``` Before you start, make sure you have a C++11-compatible compiler (GCC >= @@ -74,7 +72,7 @@ License TokuDB is available under the GPL version 2. See [COPYING][copying] -The TokuKV component of TokuDB is available under the GPL version 2, with +The TokuFT component of TokuDB is available under the GPL version 2, with slight modifications. See [README-TOKUDB][license]. [copying]: http://github.com/Tokutek/tokudb-engine/blob/master/COPYING From 1152fc8451c19bbf8a3125a18e9a0fbab7ac4a8f Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 26 Nov 2014 15:01:11 -0500 Subject: [PATCH 069/201] Add download links to README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 57ce296e0ef..70cda08b336 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,14 @@ forks of [mysql][mysql] and [mariadb][mariadb]. [mysql]: http://github.com/Tokutek/mysql [mariadb]: http://github.com/Tokutek/mariadb +Downloading +----------- + +* [MySQL 5.5.40 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) +* [MariaDB 5.5.40 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) +* [MariaDB 10.0.15 + TokuDB](https://downloads.mariadb.org/mariadb/10.0.15/) +* [Percona Server 5.6.21 + TokuDB](http://www.percona.com/downloads/) + Building -------- From 76d3acf759575d6db5e899469df8d8f885530ee5 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 26 Nov 2014 15:06:55 -0500 Subject: [PATCH 070/201] generalize download links --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 70cda08b336..2454295b1f0 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ forks of [mysql][mysql] and [mariadb][mariadb]. Downloading ----------- -* [MySQL 5.5.40 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) -* [MariaDB 5.5.40 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) -* [MariaDB 10.0.15 + TokuDB](https://downloads.mariadb.org/mariadb/10.0.15/) -* [Percona Server 5.6.21 + TokuDB](http://www.percona.com/downloads/) +* [MySQL 5.5 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) +* [MariaDB 5.5 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) +* [MariaDB 10.0 + TokuDB](https://downloads.mariadb.org/) +* [Percona Server 5.6 + TokuDB](http://www.percona.com/downloads/) Building -------- From 088a2585a6894329a7f58b4e2059379805c19db9 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 26 Nov 2014 16:09:21 -0500 Subject: [PATCH 071/201] point to JIRA for bugs --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2454295b1f0..2ab2e21a5a1 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,16 @@ forks of [mysql][mysql] and [mariadb][mariadb]. [mysql]: http://github.com/Tokutek/mysql [mariadb]: http://github.com/Tokutek/mariadb -Downloading ------------ +Download +-------- * [MySQL 5.5 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) * [MariaDB 5.5 + TokuDB](http://www.tokutek.com/tokudb-for-mysql/download-community/) * [MariaDB 10.0 + TokuDB](https://downloads.mariadb.org/) * [Percona Server 5.6 + TokuDB](http://www.percona.com/downloads/) -Building --------- +Build +----- The `scripts/` directory contains a script that can be used to build a working MySQL or MariaDB with Tokutek patches, and with the TokuDB storage @@ -60,10 +60,10 @@ scripts/make.mysql.debug.env.bash ``` -Contributing ------------- +Contribute +---------- -Please report bugs in TokuDB here on github. +Please report TokuDB bugs at https://tokutek.atlassian.net/browse/DB. We have two publicly accessible mailing lists: @@ -72,7 +72,7 @@ We have two publicly accessible mailing lists: - tokudb-dev@googlegroups.com is for discussion of the development of TokuDB. -We are also available on IRC on freenode.net, in the #tokutek channel. +We are on IRC on freenode.net, in the #tokutek channel. License From c88eed4b3ec1f8a2a35040dc01806bcca8c09ff4 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 28 Nov 2014 08:53:03 -0500 Subject: [PATCH 072/201] DB-755 speed up 5585.test --- mysql-test/suite/tokudb.bugs/t/5585-master.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/suite/tokudb.bugs/t/5585-master.opt diff --git a/mysql-test/suite/tokudb.bugs/t/5585-master.opt b/mysql-test/suite/tokudb.bugs/t/5585-master.opt new file mode 100644 index 00000000000..017432e797d --- /dev/null +++ b/mysql-test/suite/tokudb.bugs/t/5585-master.opt @@ -0,0 +1 @@ +--tokudb-cache-size=1000000000 --innodb-buffer-pool-size=1000000000 From e0c71a9ab85bbcf101442663baffbf78df928236 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Tue, 2 Dec 2014 01:31:49 +0400 Subject: [PATCH 073/201] MDEV-7169: innodb.innodb_bug14147491 fails in buildbot on Windows Applied the fix previously pushed into 10.0. Initial Jan's commit comment: Problem is that test could open Microsoft C++ Client Debugger windows with abort exception. Lets not try to test this on windows. --- mysql-test/suite/innodb/t/innodb_bug14147491.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test index 050f7fbdd73..6f0bfca8e1d 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14147491.test +++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test @@ -12,6 +12,9 @@ source include/not_embedded.inc; source include/have_innodb.inc; # Require Debug for SET DEBUG source include/have_debug.inc; +# Test could open crash reporter on Windows +# if compiler set up +source include/not_windows.inc; CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); From e544bcd16df5d8126abdac4cf0a26137787f1249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 2 Dec 2014 12:19:29 +0200 Subject: [PATCH 074/201] MDEV-7243: innodb-change-buffer-recovery fails on windows Problem is that on Windows command "perl" failed with error: 255 my_errno: 0 errno: 0. Do not run on Windows. --- mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test index f54189a5cad..83d2b07b725 100644 --- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test +++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test @@ -9,6 +9,8 @@ --source include/not_embedded.inc # DBUG_SUICIDE() hangs under valgrind --source include/not_valgrind.inc +# No windows, need perl +--source include/not_windows.inc # The flag innodb_change_buffering_debug is only available in debug builds. # It instructs InnoDB to try to evict pages from the buffer pool when From df20184c0385f6fe818689d8b3136a55f17e016c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 3 Dec 2014 13:38:39 +0200 Subject: [PATCH 075/201] MDEV-7252: Test failure on innodb.innodb_bug12400341 at Windows Problem is that there could be undo slots from previous runs. --- mysql-test/suite/innodb/t/innodb_bug12400341.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test index ab69e20c495..68daad46145 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -10,6 +10,8 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n # Don't test under valgrind, undo slots of the previous test might exist still # and cause unstable result. --source include/not_valgrind.inc +# undo slots of the previous test might exist still +--source include/not_windows.inc call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); From ed313e8a92a836422b9ae7b9ecf11c44ed4d5d66 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Mon, 1 Dec 2014 14:58:29 +0400 Subject: [PATCH 076/201] MDEV-7148 - Recurring: InnoDB: Failing assertion: !lock->recursive On PPC64 high-loaded server may crash due to assertion failure in InnoDB rwlocks code. This happened because load order between "recursive" and "writer_thread" wasn't properly enforced. --- storage/innobase/include/sync0rw.ic | 7 ++++++- storage/innobase/sync/sync0rw.c | 11 +++++++---- storage/xtradb/include/sync0rw.ic | 7 ++++++- storage/xtradb/sync/sync0rw.c | 11 +++++++---- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic index a25aa19d3aa..a7d81e4b031 100644 --- a/storage/innobase/include/sync0rw.ic +++ b/storage/innobase/include/sync0rw.ic @@ -438,6 +438,7 @@ rw_lock_x_lock_func_nowait( os_thread_id_t curr_thread = os_thread_get_curr_id(); ibool success; + ibool local_recursive= lock->recursive; #ifdef INNODB_RW_LOCKS_USE_ATOMICS success = os_compare_and_swap_lint(&lock->lock_word, X_LOCK_DECR, 0); @@ -452,10 +453,14 @@ rw_lock_x_lock_func_nowait( mutex_exit(&(lock->mutex)); #endif + /* Note: recursive must be loaded before writer_thread see + comment for rw_lock_set_writer_id_and_recursion_flag(). + To achieve this we load it before os_compare_and_swap_lint(), + which implies full memory barrier in current implementation. */ if (success) { rw_lock_set_writer_id_and_recursion_flag(lock, TRUE); - } else if (lock->recursive + } else if (local_recursive && os_thread_eq(lock->writer_thread, curr_thread)) { /* Relock: this lock_word modification is safe since no other threads can modify (lock, unlock, or reserve) lock_word while diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c index 50531455a4c..5600db855b4 100644 --- a/storage/innobase/sync/sync0rw.c +++ b/storage/innobase/sync/sync0rw.c @@ -566,6 +566,7 @@ rw_lock_x_lock_low( ulint line) /*!< in: line where requested */ { os_thread_id_t curr_thread = os_thread_get_curr_id(); + ibool local_recursive= lock->recursive; if (rw_lock_lock_word_decr(lock, X_LOCK_DECR)) { @@ -586,10 +587,12 @@ rw_lock_x_lock_low( file_name, line); } else { - if (!pass) - os_rmb; - /* Decrement failed: relock or failed lock */ - if (!pass && lock->recursive + /* Decrement failed: relock or failed lock + Note: recursive must be loaded before writer_thread see + comment for rw_lock_set_writer_id_and_recursion_flag(). + To achieve this we load it before rw_lock_lock_word_decr(), + which implies full memory barrier in current implementation. */ + if (!pass && local_recursive && os_thread_eq(lock->writer_thread, curr_thread)) { /* Relock */ lock->lock_word -= X_LOCK_DECR; diff --git a/storage/xtradb/include/sync0rw.ic b/storage/xtradb/include/sync0rw.ic index 08baee30670..031c57aff0d 100644 --- a/storage/xtradb/include/sync0rw.ic +++ b/storage/xtradb/include/sync0rw.ic @@ -438,6 +438,7 @@ rw_lock_x_lock_func_nowait( os_thread_id_t curr_thread = os_thread_get_curr_id(); ibool success; + ibool local_recursive= lock->recursive; #ifdef INNODB_RW_LOCKS_USE_ATOMICS success = os_compare_and_swap_lint(&lock->lock_word, X_LOCK_DECR, 0); @@ -452,10 +453,14 @@ rw_lock_x_lock_func_nowait( mutex_exit(&(lock->mutex)); #endif + /* Note: recursive must be loaded before writer_thread see + comment for rw_lock_set_writer_id_and_recursion_flag(). + To achieve this we load it before os_compare_and_swap_lint(), + which implies full memory barrier in current implementation. */ if (success) { rw_lock_set_writer_id_and_recursion_flag(lock, TRUE); - } else if (lock->recursive + } else if (local_recursive && os_thread_eq(lock->writer_thread, curr_thread)) { /* Relock: this lock_word modification is safe since no other threads can modify (lock, unlock, or reserve) lock_word while diff --git a/storage/xtradb/sync/sync0rw.c b/storage/xtradb/sync/sync0rw.c index a37190e83a6..156c3fd9ad5 100644 --- a/storage/xtradb/sync/sync0rw.c +++ b/storage/xtradb/sync/sync0rw.c @@ -563,6 +563,7 @@ rw_lock_x_lock_low( ulint line) /*!< in: line where requested */ { os_thread_id_t curr_thread = os_thread_get_curr_id(); + ibool local_recursive= lock->recursive; if (rw_lock_lock_word_decr(lock, X_LOCK_DECR)) { @@ -583,10 +584,12 @@ rw_lock_x_lock_low( file_name, line); } else { - if (!pass) - os_rmb; - /* Decrement failed: relock or failed lock */ - if (!pass && lock->recursive + /* Decrement failed: relock or failed lock + Note: recursive must be loaded before writer_thread see + comment for rw_lock_set_writer_id_and_recursion_flag(). + To achieve this we load it before rw_lock_lock_word_decr(), + which implies full memory barrier in current implementation. */ + if (!pass && local_recursive && os_thread_eq(lock->writer_thread, curr_thread)) { /* Relock */ lock->lock_word -= X_LOCK_DECR; From a4baf9b3ea323e3f7947cf6d4520b1243c77a7f4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 1 Dec 2014 13:52:49 +0100 Subject: [PATCH 077/201] test failure: make list_files more selective to prevent db.opt from showing up --- mysql-test/t/partition_innodb.test | 1 - mysql-test/t/partition_innodb_plugin.test | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index cb7ad4262cc..a74e95ab65b 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -638,7 +638,6 @@ SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 ); DROP TABLE t1; ---remove_file $MYSQLD_DATADIR/test/db.opt --enable_parsing --echo # diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test index 2eb9a2fa2a0..8044ae9ec5c 100644 --- a/mysql-test/t/partition_innodb_plugin.test +++ b/mysql-test/t/partition_innodb_plugin.test @@ -52,7 +52,7 @@ KEY_BLOCK_SIZE=4 PARTITION BY HASH(id) PARTITIONS 1; --replace_result #p# #P# ---list_files $MYSQLD_DATADIR/test +--list_files $MYSQLD_DATADIR/test t1* SHOW CREATE TABLE t1; SET GLOBAL innodb_file_per_table = OFF; @@ -71,14 +71,14 @@ LOCK TABLE t1 WRITE; ALTER TABLE t1 ADD PARTITION PARTITIONS 1; --replace_result #p# #P# ---list_files $MYSQLD_DATADIR/test +--list_files $MYSQLD_DATADIR/test t1* --echo # This SET is not needed to reproduce the bug, --echo # it is here just to make the test case more realistic SET innodb_strict_mode = OFF; ALTER TABLE t1 ADD PARTITION PARTITIONS 2; --replace_result #p# #P# ---list_files $MYSQLD_DATADIR/test +--list_files $MYSQLD_DATADIR/test t1* # really bug#56172 ALTER TABLE t1 REBUILD PARTITION p0; From 230132dc419c12f3f6b866b288f06446a84cd91b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 1 Dec 2014 14:38:41 +0100 Subject: [PATCH 078/201] bump the version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 846e8094fff..ea92dd078e5 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=0 -MYSQL_VERSION_PATCH=15 +MYSQL_VERSION_PATCH=16 From 4e9e04b28b1b65a40aaf3a5e1b5dd4f8a41e6792 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 1 Dec 2014 15:35:01 +0100 Subject: [PATCH 079/201] tests that require server restart cannot be run with --embedded --- mysql-test/include/restart_mysqld.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index 49f6dfd5364..3d53fada870 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -1,3 +1,4 @@ +--source include/not_embedded.inc if ($rpl_inited) { From ba076763ec904f9547a90ec4408498b491b839e2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 1 Dec 2014 22:24:58 +0100 Subject: [PATCH 080/201] remove ssl debugging report_errors() function that was sometimes destroying the state --- vio/viossl.c | 46 ------------------------------------------- vio/viosslfactories.c | 27 ------------------------- 2 files changed, 73 deletions(-) diff --git a/vio/viossl.c b/vio/viossl.c index 2bee31f66ab..0bc2c263336 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -40,41 +40,6 @@ #define SSL_errno(X,Y) ERR_get_error() #endif -#ifndef DBUG_OFF - -static void -report_errors(SSL* ssl) -{ - unsigned long l; - const char *file; - const char *data; - int line, flags; - char buf[512]; - - DBUG_ENTER("report_errors"); - - while ((l= ERR_get_error_line_data(&file,&line,&data,&flags))) - { - DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf), - file,line,(flags&ERR_TXT_STRING)?data:"")) ; - } - - if (ssl) - { -#ifndef DBUG_OFF - ulong error= SSL_errno(ssl, l); - DBUG_PRINT("error", ("error: %s (%lu)", - ERR_error_string(error, buf), error)); -#endif - } - - DBUG_PRINT("info", ("socket_errno: %d", socket_errno)); - DBUG_VOID_RETURN; -} - -#endif - - /** Obtain the equivalent system error status for the last SSL I/O operation. @@ -157,9 +122,6 @@ static my_bool ssl_should_retry(Vio *vio, int ret, enum enum_vio_io_event *event *event= VIO_IO_EVENT_WRITE; break; default: -#ifndef DBUG_OFF - report_errors(ssl); -#endif should_retry= FALSE; ssl_set_sys_error(ssl_error); break; @@ -195,10 +157,6 @@ size_t vio_ssl_read(Vio *vio, uchar *buf, size_t size) } } -#ifndef DBUG_OFF - if (ret < 0) - report_errors((SSL*) vio->ssl_arg); -#endif DBUG_PRINT("exit", ("%d", (int) ret)); DBUG_RETURN(ret < 0 ? -1 : ret); @@ -233,10 +191,6 @@ size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size) } } -#ifndef DBUG_OFF - if (ret < 0) - report_errors((SSL*) vio->ssl_arg); -#endif DBUG_RETURN(ret < 0 ? -1 : ret); } diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 20bed2b6728..ee944c68f92 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -51,27 +51,6 @@ static DH *get_dh512(void) } -static void -report_errors() -{ - unsigned long l; - const char* file; - const char* data; - int line,flags; - - DBUG_ENTER("report_errors"); - - while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) - { -#ifndef DBUG_OFF /* Avoid warning */ - char buf[200]; - DBUG_PRINT("error", ("OpenSSL: %s:%s:%d:%s\n", ERR_error_string(l,buf), - file,line,(flags & ERR_TXT_STRING) ? data : "")) ; -#endif - } - DBUG_VOID_RETURN; -} - static const char* ssl_error_string[] = { @@ -198,7 +177,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, { *error= SSL_INITERR_MEMFAIL; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); - report_errors(); my_free(ssl_fd); DBUG_RETURN(0); } @@ -215,7 +193,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, { *error= SSL_INITERR_CIPHERS; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); - report_errors(); SSL_CTX_free(ssl_fd->ssl_context); my_free(ssl_fd); DBUG_RETURN(0); @@ -232,7 +209,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, *error= SSL_INITERR_BAD_PATHS; DBUG_PRINT("error", ("SSL_CTX_load_verify_locations failed : %s", sslGetErrString(*error))); - report_errors(); SSL_CTX_free(ssl_fd->ssl_context); my_free(ssl_fd); DBUG_RETURN(0); @@ -243,7 +219,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, { *error= SSL_INITERR_BAD_PATHS; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); - report_errors(); SSL_CTX_free(ssl_fd->ssl_context); my_free(ssl_fd); DBUG_RETURN(0); @@ -266,7 +241,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("warning", ("X509_STORE_load_locations for CRL failed")); *error= SSL_INITERR_BAD_PATHS; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); - report_errors(); SSL_CTX_free(ssl_fd->ssl_context); my_free(ssl_fd); DBUG_RETURN(0); @@ -277,7 +251,6 @@ new_VioSSLFd(const char *key_file, const char *cert_file, if (vio_set_cert_stuff(ssl_fd->ssl_context, cert_file, key_file, error)) { DBUG_PRINT("error", ("vio_set_cert_stuff failed")); - report_errors(); SSL_CTX_free(ssl_fd->ssl_context); my_free(ssl_fd); DBUG_RETURN(0); From 433b28cede5863953a77029f4b276b3fc15b8f48 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 1 Dec 2014 23:56:36 +0100 Subject: [PATCH 081/201] add a proper cleanup to innodb.innodb-mdev7046 test --- mysql-test/suite/innodb/t/innodb-mdev7046.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index 491b13dea90..388885d214d 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -29,3 +29,6 @@ CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPAR ALTER TABLE t1 ENGINE=InnoDB; drop table t1; + +let $datadir=`select @@datadir`; +--remove_file $datadir/test/db.opt From 50b42441a666a53e466049845d779c2dca4f11c8 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 2 Dec 2014 09:27:22 +0100 Subject: [PATCH 082/201] MDEV-7241: rpl.rpl_parallel2 fails sporadically in buildbot There was a race, a small window between updating slave position and updating Seconds_Behind_Master, during which the test case could see the wrong value. Fix by waiting for the expected status to appear. --- mysql-test/suite/rpl/r/rpl_parallel2.result | 1 + mysql-test/suite/rpl/t/rpl_parallel2.test | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_parallel2.result b/mysql-test/suite/rpl/r/rpl_parallel2.result index 49be484f419..8bf8b9caf3b 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel2.result +++ b/mysql-test/suite/rpl/r/rpl_parallel2.result @@ -9,6 +9,7 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state INSERT INTO t1 VALUES (1,sleep(2)); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +include/wait_for_slave_param.inc [Seconds_Behind_Master] Seconds_Behind_Master should be zero here because the slave is fully caught up and idle. Seconds_Behind_Master = '0' include/stop_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel2.test b/mysql-test/suite/rpl/t/rpl_parallel2.test index 39b35063c7c..51c9e39a26a 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel2.test +++ b/mysql-test/suite/rpl/t/rpl_parallel2.test @@ -25,6 +25,13 @@ INSERT INTO t1 VALUES (1,sleep(2)); --connection server_2 --sync_with_master +# The slave position (which --sync_with_master waits for) is updated just +# before the Seconds_Behind_Master. So we have to wait for the zero status +# to appear, otherwise there is a small window between --sync_with_master +# and SHOW SLAVE STATUS where we can see a non-zero value. +--let $slave_param= Seconds_Behind_Master +--let $slave_param_value= 0 +--source include/wait_for_slave_param.inc --echo Seconds_Behind_Master should be zero here because the slave is fully caught up and idle. --let $status_items= Seconds_Behind_Master --source include/show_slave_status.inc From 0450623f73db36c1ba4857e202361401a9706e53 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 2 Dec 2014 12:10:21 +0100 Subject: [PATCH 083/201] MDEV-7236: rpl.rpl_gtid_basic failed in buildbot with wait_condition timeout Fix rare failures in test case rpl.rpl_gtid_basic: - Add another possible error code when a connection is killed. - Make sure that the IO thread has had time to complete its stop after START SLAVE UNTIL. Otherwise, START SLAVE might run before IO thread stop, leaving the test case with a stopped IO thread that eventually causes a wait timeout. --- mysql-test/suite/rpl/r/rpl_gtid_basic.result | 4 ++-- mysql-test/suite/rpl/t/rpl_gtid_basic.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result index e8e5bf36f84..465cc875af0 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result @@ -286,7 +286,7 @@ INSERT INTO t1 VALUES (4); master_gtid_wait('2-1-2') 0 KILL CONNECTION KILL_ID; -ERROR HY000: Lost connection to MySQL server during query +Got one of the listed errors SET gtid_domain_id=1; SET gtid_seq_no=4; INSERT INTO t1 VALUES (5); @@ -386,7 +386,7 @@ SET GLOBAL slave_ddl_exec_mode=STRICT; SET sql_slave_skip_counter=1; START SLAVE UNTIL master_gtid_pos="3-1-100"; include/sync_with_master_gtid.inc -include/wait_for_slave_sql_to_stop.inc +include/wait_for_slave_to_stop.inc SELECT * FROM t2; ERROR 42S02: Table 'test.t2' doesn't exist SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test index 5ecff519aef..19f90fce197 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test @@ -334,7 +334,7 @@ reap; eval KILL CONNECTION $kill2_id; --connection s6 ---error 2013 +--error 2013,ER_CONNECTION_KILLED reap; --connection server_1 @@ -456,7 +456,7 @@ SET sql_slave_skip_counter=1; START SLAVE UNTIL master_gtid_pos="3-1-100"; --let $master_pos=3-1-100 --source include/sync_with_master_gtid.inc ---source include/wait_for_slave_sql_to_stop.inc +--source include/wait_for_slave_to_stop.inc --error ER_NO_SUCH_TABLE SELECT * FROM t2; SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; From 1eed2748483bf4f8747e7c7c3f3ce95b0e105e45 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 2 Dec 2014 12:11:07 +0100 Subject: [PATCH 084/201] Fix wording in error log message, to be consistent with other messages ("IO thread" -> "I/O thread"). --- sql/slave.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/slave.cc b/sql/slave.cc index 0285318bf55..c83f09c7510 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5565,7 +5565,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) char str_buf[128]; String str(str_buf, sizeof(str_buf), system_charset_info); mi->rli.until_gtid_pos.to_string(&str); - sql_print_information("Slave IO thread stops because it reached its" + sql_print_information("Slave I/O thread stops because it reached its" " UNTIL master_gtid_pos %s", str.c_ptr_safe()); mi->abort_slave= true; } From d79cce86ab1ef998d2b46b2d0475e57a12983238 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Wed, 3 Dec 2014 15:49:31 +0100 Subject: [PATCH 085/201] MDEV-4393: show_explain.test times out randomly The problem was a race between the debug code in the server and the SHOW EXPLAIN FOR in the test case. The test case would wait for a query to reach the first point of interest (inside dbug_serve_apcs()), then send it a SHOW EXPLAIN FOR, then wait for the query to reach the next point of interest. However, the second wait was insufficient. It was possible for the the second wait to complete immediately, causing both the first and the second SHOW EXPLAIN FOR to hit the same invocation of dbug_server_apcs(). Then a later invocation would miss its intended SHOW EXPLAIN FOR and hang, and the test case would eventually time out. Fix is to make sure that the second wait can not trigger during the first invocation of dbug_server_apcs(). We do this by clearing the thd_proc_info (that the wait is looking for) before processing the SHOW EXPLAIN FOR; this way the second wait can not start until the thd_proc_info from the first invocation has been cleared. --- sql/sql_select.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8f68c929a9e..2e8ed7c5dbd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -291,18 +291,18 @@ static double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, void dbug_serve_apcs(THD *thd, int n_calls) { const char *save_proc_info= thd->proc_info; - /* This is so that mysqltest knows we're ready to serve requests: */ - thd_proc_info(thd, "show_explain_trap"); /* Busy-wait for n_calls APC requests to arrive and be processed */ int n_apcs= thd->apc_target.n_calls_processed + n_calls; while (thd->apc_target.n_calls_processed < n_apcs) { - my_sleep(300); + /* This is so that mysqltest knows we're ready to serve requests: */ + thd_proc_info(thd, "show_explain_trap"); + my_sleep(30000); + thd_proc_info(thd, save_proc_info); if (thd->check_killed()) break; } - thd_proc_info(thd, save_proc_info); } From 6cd78eedea6f11f7995700fd9da3a4ca8cab77c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 2 Dec 2014 13:26:45 +0200 Subject: [PATCH 086/201] MDEV-7242: innodb.innodb-mdev7046 fails in various ways on buildbot Problem with test is that test causes OS failures that change. Idea with test is just to test that server does not crash, no other output is necessary. --- .../suite/innodb/r/innodb-mdev7046.result | 23 +------------------ .../suite/innodb/t/innodb-mdev7046.test | 11 +++++++++ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-mdev7046.result b/mysql-test/suite/innodb/r/innodb-mdev7046.result index db183346df5..d00491fd7e5 100644 --- a/mysql-test/suite/innodb/r/innodb-mdev7046.result +++ b/mysql-test/suite/innodb/r/innodb-mdev7046.result @@ -1,22 +1 @@ -call mtr.add_suppression("InnoDB: File ./test/t1*"); -call mtr.add_suppression("nnoDB: Error number*"); -USE test; -create table t1(f1 INT,f2 INT,f3 CHAR (10),primary key(f1,f2)) partition by range(f1) subpartition by hash(f2) subpartitions 2 (partition p1 values less than (0),partition p2 values less than (2),partition p3 values less than (2147483647)); -RENAME TABLE t1 TO `t2_new..............................................end`; -ERROR HY000: Error on rename of 't2_new' (Errcode: 36 "File name too long") -alter table t1 engine=innodb; -RENAME TABLE t1 TO `t2_new..............................................end`; -ERROR HY000: Error on rename of 't2_new' (errno: -1 "Internal error < 0 (Not system error)") -show warnings; -Level Code Message -Error 1025 Error on rename of 't2_new' (errno: -1 "Internal error < 0 (Not system error)") -drop table t1; -DROP DATABASE test; -CREATE DATABASE test; -USE test; -SET @@session.storage_engine=MYISAM; -CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); -ERROR HY000: Can't create/write to file '/tmp/not-existing/t1#P#p0#SP#sp0.MYI' (Errcode: 2 "No such file or directory") -CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); -ALTER TABLE t1 ENGINE=InnoDB; -drop table t1; +1 diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index 388885d214d..cdf63147d02 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -1,6 +1,10 @@ --source include/have_innodb.inc --source include/have_partition.inc +--disable_query_log +--disable_result_log +--disable_warnings + # Ignore OS errors call mtr.add_suppression("InnoDB: File ./test/t1*"); call mtr.add_suppression("nnoDB: Error number*"); @@ -32,3 +36,10 @@ drop table t1; let $datadir=`select @@datadir`; --remove_file $datadir/test/db.opt + +--enable_query_log +--enable_result_log +--enable_warnings + +--echo 1 + From 5fc2814698bdac10fddcc5db4a42c971471dd4f5 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 2 Dec 2014 18:11:05 +0100 Subject: [PATCH 087/201] MDEV-7251: Test failure in rpl.rpl_parallel There was a race. The test case was expecting the slave to start processing a particular DELETE statement, then the test would stop the slave at this point. But there was missing something to wait until the slave would actually reach this point; thus depending on timing it was possible that the slave would be stopped too early, causing .result file difference. Fixed by adding an appropriate wait to the test case. --- mysql-test/suite/rpl/r/rpl_parallel.result | 3 +++ mysql-test/suite/rpl/t/rpl_parallel.test | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result index e1672872386..a3b423a49c9 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-test/suite/rpl/r/rpl_parallel.result @@ -983,7 +983,10 @@ SET GLOBAL slave_parallel_threads=0; SET GLOBAL slave_parallel_threads=10; INSERT INTO t2 VALUES (41); INSERT INTO t2 VALUES (42); +SET @old_format= @@binlog_format; +SET binlog_format= statement; DELETE FROM t2 WHERE a=40; +SET binlog_format= @old_format; INSERT INTO t2 VALUES (43); INSERT INTO t2 VALUES (44); FLUSH LOGS; diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index b1b8792acf6..a56d45848a5 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -1560,7 +1560,11 @@ SET GLOBAL slave_parallel_threads=10; # Setup some transaction for the slave to replicate. INSERT INTO t2 VALUES (41); INSERT INTO t2 VALUES (42); +# Need to log the DELETE in statement format, so we can see it in processlist. +SET @old_format= @@binlog_format; +SET binlog_format= statement; DELETE FROM t2 WHERE a=40; +SET binlog_format= @old_format; INSERT INTO t2 VALUES (43); INSERT INTO t2 VALUES (44); # Force the slave to switch to a new relay log file. @@ -1581,6 +1585,11 @@ SELECT * FROM t2 WHERE a=40 FOR UPDATE; --connection server_2 --source include/start_slave.inc +# Wait for a worker thread to start on the DELETE that will be blocked +# temporarily by the SELECT FOR UPDATE. +--let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%' +--source include/wait_condition.inc + # The DBUG injection set above will make the worker thread signal the following # debug_sync when the GTID 0-1-100 has been reached by a worker thread. # Thus, at this point, the SQL driver thread has reached the next From b3aed01ae93a31571a31804e35ff3b430b6efb8f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 2 Dec 2014 19:15:16 +0100 Subject: [PATCH 088/201] fix include/not_embedded.inc to be independent from the environment in particular, not fail with --vertical_results --- mysql-test/include/not_embedded.inc | 7 +++---- mysql-test/r/not_embedded.require | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 mysql-test/r/not_embedded.require diff --git a/mysql-test/include/not_embedded.inc b/mysql-test/include/not_embedded.inc index c3a9c3e12c8..88185af3b15 100644 --- a/mysql-test/include/not_embedded.inc +++ b/mysql-test/include/not_embedded.inc @@ -4,8 +4,7 @@ # # The test below is redundant --- require r/not_embedded.require -disable_query_log; -select version() like '%embedded%' as 'have_embedded'; -enable_query_log; +if (`select version() like '%embedded%'`) { + This should never happen; +} diff --git a/mysql-test/r/not_embedded.require b/mysql-test/r/not_embedded.require deleted file mode 100644 index b2ea98bcd0a..00000000000 --- a/mysql-test/r/not_embedded.require +++ /dev/null @@ -1,2 +0,0 @@ -have_embedded -0 From 2b5db1d5bcd7b46b654d59a07fc119ef6a6b8651 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 2 Dec 2014 20:35:45 +0100 Subject: [PATCH 089/201] put at least some output-generating statement in the test otherwise mysqltest complains "No queries executed but non-empty result file found!" --- mysql-test/r/change_user_notembedded.result | 1 + mysql-test/t/change_user_notembedded.test | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mysql-test/r/change_user_notembedded.result b/mysql-test/r/change_user_notembedded.result index 60579d15ec2..896a6045481 100644 --- a/mysql-test/r/change_user_notembedded.result +++ b/mysql-test/r/change_user_notembedded.result @@ -3,3 +3,4 @@ ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO) ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES) ERROR 08S01: Unknown command ERROR 08S01: Unknown command +that's all diff --git a/mysql-test/t/change_user_notembedded.test b/mysql-test/t/change_user_notembedded.test index bf5d1956cd5..19421c6dd33 100644 --- a/mysql-test/t/change_user_notembedded.test +++ b/mysql-test/t/change_user_notembedded.test @@ -22,3 +22,5 @@ change_user; disconnect test; connection default; +--echo that's all + From cc06415fd64af404eda1518e0f5f9c1defd1707b Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Wed, 3 Dec 2014 19:53:40 +0400 Subject: [PATCH 090/201] MDEV-7255 Failures in engines/* tests, part 1 In 10.0 output of SHOW DATABASES appears to be sorted, while in result files it is not. Added sorted_result for certainty and updated result files. --- mysql-test/suite/engines/funcs/r/db_create_drop.result | 8 ++++---- mysql-test/suite/engines/funcs/r/db_create_error.result | 2 +- .../suite/engines/funcs/r/db_create_if_not_exists.result | 4 ++-- mysql-test/suite/engines/funcs/r/db_drop_error.result | 2 +- mysql-test/suite/engines/funcs/r/db_use_error.result | 2 +- mysql-test/suite/engines/funcs/t/db_create_drop.test | 4 ++++ mysql-test/suite/engines/funcs/t/db_create_error.test | 2 ++ .../suite/engines/funcs/t/db_create_if_not_exists.test | 2 ++ mysql-test/suite/engines/funcs/t/db_drop_error.test | 1 + mysql-test/suite/engines/funcs/t/db_use_error.test | 1 + 10 files changed, 19 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/engines/funcs/r/db_create_drop.result b/mysql-test/suite/engines/funcs/r/db_create_drop.result index 89c3b3ce991..85a871cf135 100644 --- a/mysql-test/suite/engines/funcs/r/db_create_drop.result +++ b/mysql-test/suite/engines/funcs/r/db_create_drop.result @@ -2,8 +2,8 @@ DROP DATABASE IF EXISTS d1; CREATE DATABASE d1; SHOW DATABASES; Database -information_schema d1 +information_schema mtr mysql performance_schema @@ -13,8 +13,8 @@ Database (d%) d1 SHOW DATABASES LIKE '%'; Database (%) -information_schema d1 +information_schema mtr mysql performance_schema @@ -24,8 +24,8 @@ DROP DATABASE d1; CREATE SCHEMA d1; SHOW SCHEMAS; Database -information_schema d1 +information_schema mtr mysql performance_schema @@ -35,8 +35,8 @@ Database (d%) d1 SHOW SCHEMAS LIKE '%'; Database (%) -information_schema d1 +information_schema mtr mysql performance_schema diff --git a/mysql-test/suite/engines/funcs/r/db_create_error.result b/mysql-test/suite/engines/funcs/r/db_create_error.result index 35d5d4abfeb..d18fe7ee5fd 100644 --- a/mysql-test/suite/engines/funcs/r/db_create_error.result +++ b/mysql-test/suite/engines/funcs/r/db_create_error.result @@ -2,8 +2,8 @@ DROP DATABASE IF EXISTS d4; CREATE DATABASE d4; SHOW DATABASES; Database -information_schema d4 +information_schema mtr mysql performance_schema diff --git a/mysql-test/suite/engines/funcs/r/db_create_if_not_exists.result b/mysql-test/suite/engines/funcs/r/db_create_if_not_exists.result index c9e31817910..2637087da5b 100644 --- a/mysql-test/suite/engines/funcs/r/db_create_if_not_exists.result +++ b/mysql-test/suite/engines/funcs/r/db_create_if_not_exists.result @@ -5,8 +5,8 @@ Warnings: Note 1007 Can't create database 'd2'; database exists SHOW DATABASES; Database -information_schema d2 +information_schema mtr mysql performance_schema @@ -22,8 +22,8 @@ Warnings: Note 1007 Can't create database 'd2'; database exists SHOW DATABASES; Database -information_schema d2 +information_schema mtr mysql performance_schema diff --git a/mysql-test/suite/engines/funcs/r/db_drop_error.result b/mysql-test/suite/engines/funcs/r/db_drop_error.result index 8db8cb598af..24a51768103 100644 --- a/mysql-test/suite/engines/funcs/r/db_drop_error.result +++ b/mysql-test/suite/engines/funcs/r/db_drop_error.result @@ -2,8 +2,8 @@ DROP DATABASE IF EXISTS d5; CREATE DATABASE d5; SHOW DATABASES; Database -information_schema d5 +information_schema mtr mysql performance_schema diff --git a/mysql-test/suite/engines/funcs/r/db_use_error.result b/mysql-test/suite/engines/funcs/r/db_use_error.result index 2051b56b19e..c2fce4f0acf 100644 --- a/mysql-test/suite/engines/funcs/r/db_use_error.result +++ b/mysql-test/suite/engines/funcs/r/db_use_error.result @@ -2,8 +2,8 @@ DROP DATABASE IF EXISTS d6; CREATE DATABASE d6; SHOW DATABASES; Database -information_schema d6 +information_schema mtr mysql performance_schema diff --git a/mysql-test/suite/engines/funcs/t/db_create_drop.test b/mysql-test/suite/engines/funcs/t/db_create_drop.test index 119db90293c..a807c146206 100644 --- a/mysql-test/suite/engines/funcs/t/db_create_drop.test +++ b/mysql-test/suite/engines/funcs/t/db_create_drop.test @@ -2,14 +2,18 @@ DROP DATABASE IF EXISTS d1; --enable_warnings CREATE DATABASE d1; +--sorted_result SHOW DATABASES; SHOW DATABASES LIKE 'd%'; +--sorted_result SHOW DATABASES LIKE '%'; USE d1; DROP DATABASE d1; CREATE SCHEMA d1; +--sorted_result SHOW SCHEMAS; SHOW SCHEMAS LIKE 'd%'; +--sorted_result SHOW SCHEMAS LIKE '%'; USE d1; DROP SCHEMA d1; diff --git a/mysql-test/suite/engines/funcs/t/db_create_error.test b/mysql-test/suite/engines/funcs/t/db_create_error.test index d88ef846b4b..ca83e5f0806 100644 --- a/mysql-test/suite/engines/funcs/t/db_create_error.test +++ b/mysql-test/suite/engines/funcs/t/db_create_error.test @@ -2,9 +2,11 @@ DROP DATABASE IF EXISTS d4; --enable_warnings CREATE DATABASE d4; +--sorted_result SHOW DATABASES; --error 1007 CREATE DATABASE d4; DROP DATABASE d4; +--sorted_result SHOW DATABASES; diff --git a/mysql-test/suite/engines/funcs/t/db_create_if_not_exists.test b/mysql-test/suite/engines/funcs/t/db_create_if_not_exists.test index 4e631d5657a..7b130504308 100644 --- a/mysql-test/suite/engines/funcs/t/db_create_if_not_exists.test +++ b/mysql-test/suite/engines/funcs/t/db_create_if_not_exists.test @@ -3,12 +3,14 @@ DROP DATABASE IF EXISTS d2; --enable_warnings CREATE DATABASE d2; CREATE DATABASE IF NOT EXISTS d2; +--sorted_result SHOW DATABASES; USE d2; DROP DATABASE d2; DROP DATABASE IF EXISTS d2; CREATE SCHEMA d2; CREATE SCHEMA IF NOT EXISTS d2; +--sorted_result SHOW DATABASES; USE d2; DROP SCHEMA d2; diff --git a/mysql-test/suite/engines/funcs/t/db_drop_error.test b/mysql-test/suite/engines/funcs/t/db_drop_error.test index f21b8b4e817..7fd6738cf1f 100644 --- a/mysql-test/suite/engines/funcs/t/db_drop_error.test +++ b/mysql-test/suite/engines/funcs/t/db_drop_error.test @@ -6,5 +6,6 @@ SHOW DATABASES; --error 1008 DROP DATABASE nond5; DROP DATABASE d5; +--sorted_result SHOW DATABASES; diff --git a/mysql-test/suite/engines/funcs/t/db_use_error.test b/mysql-test/suite/engines/funcs/t/db_use_error.test index 00a411ed5cb..9220660f84e 100644 --- a/mysql-test/suite/engines/funcs/t/db_use_error.test +++ b/mysql-test/suite/engines/funcs/t/db_use_error.test @@ -6,5 +6,6 @@ SHOW DATABASES; --error 1064 USE DATABASE nond6; DROP DATABASE d6; +--sorted_result SHOW DATABASES; From aafdc4b16ec1d47278931750bff8b228fafc02b3 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 4 Dec 2014 01:52:03 +0400 Subject: [PATCH 091/201] MDEV-7255 Failures in engines/* tests, part 2 Result files updated according to bugfix for MySQL#55843 (Handled condition appears as not handled) --- .../suite/engines/funcs/r/sf_alter.result | 540 ------------------ .../suite/engines/funcs/r/sf_cursor.result | 9 - .../suite/engines/funcs/r/sp_alter.result | 120 ---- .../suite/engines/funcs/r/sp_cursor.result | 2 - 4 files changed, 671 deletions(-) diff --git a/mysql-test/suite/engines/funcs/r/sf_alter.result b/mysql-test/suite/engines/funcs/r/sf_alter.result index 8885b20d557..e89f529ba09 100644 --- a/mysql-test/suite/engines/funcs/r/sf_alter.result +++ b/mysql-test/suite/engines/funcs/r/sf_alter.result @@ -35,8 +35,6 @@ ALTER FUNCTION sf1 #DET# ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -54,8 +52,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -76,9 +72,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -105,8 +98,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -172,8 +163,6 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -191,8 +180,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -213,9 +200,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -242,8 +226,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -309,8 +291,6 @@ ALTER FUNCTION sf1 #DET# NO SQL ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -328,8 +308,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -350,9 +328,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -379,8 +354,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -446,8 +419,6 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -465,8 +436,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -487,9 +456,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -516,8 +482,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -583,8 +547,6 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -602,8 +564,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -624,9 +584,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -653,8 +610,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -720,8 +675,6 @@ ALTER FUNCTION sf1 #DET# COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -739,8 +692,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -761,9 +712,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -790,8 +738,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -857,8 +803,6 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -876,8 +820,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -898,9 +840,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -927,8 +866,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -994,8 +931,6 @@ ALTER FUNCTION sf1 #DET# NO SQL COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1013,8 +948,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1035,9 +968,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1064,8 +994,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1131,8 +1059,6 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1150,8 +1076,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1172,9 +1096,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1201,8 +1122,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1268,8 +1187,6 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1287,8 +1204,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1309,9 +1224,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1338,8 +1250,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1405,8 +1315,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1424,8 +1332,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1446,9 +1352,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1475,8 +1378,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1542,8 +1443,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1561,8 +1460,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1583,9 +1480,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1612,8 +1506,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1679,8 +1571,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1698,8 +1588,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1720,9 +1608,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1749,8 +1634,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1816,8 +1699,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1835,8 +1716,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1857,9 +1736,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1886,8 +1762,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1953,8 +1827,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1972,8 +1844,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1994,9 +1864,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2023,8 +1890,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2090,8 +1955,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2109,8 +1972,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2131,9 +1992,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2160,8 +2018,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2227,8 +2083,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2246,8 +2100,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2268,9 +2120,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2297,8 +2146,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2364,8 +2211,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2383,8 +2228,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2405,9 +2248,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2434,8 +2274,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2501,8 +2339,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2520,8 +2356,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2542,9 +2376,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2571,8 +2402,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2638,8 +2467,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2657,8 +2484,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2679,9 +2504,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2708,8 +2530,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2775,8 +2595,6 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2794,8 +2612,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2816,9 +2632,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2845,8 +2658,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2912,8 +2723,6 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2931,8 +2740,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2953,9 +2760,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2982,8 +2786,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3049,8 +2851,6 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3068,8 +2868,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3090,9 +2888,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3119,8 +2914,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3186,8 +2979,6 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3205,8 +2996,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3227,9 +3016,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3256,8 +3042,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3323,8 +3107,6 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3342,8 +3124,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3364,9 +3144,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3393,8 +3170,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3460,8 +3235,6 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY INVOKER COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3479,8 +3252,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3501,9 +3272,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3530,8 +3298,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3597,8 +3363,6 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT 'comment' SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3616,8 +3380,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3638,9 +3400,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3667,8 +3426,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3734,8 +3491,6 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3753,8 +3508,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3775,9 +3528,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3804,8 +3554,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3871,8 +3619,6 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY INVOKER COMMENT 'comment SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3890,8 +3636,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3912,9 +3656,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3941,8 +3682,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4008,8 +3747,6 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'comm SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4027,8 +3764,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4049,9 +3784,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4078,8 +3810,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4145,8 +3875,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4164,8 +3892,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4186,9 +3912,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4215,8 +3938,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4282,8 +4003,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4301,8 +4020,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4323,9 +4040,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4352,8 +4066,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4419,8 +4131,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4438,8 +4148,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4460,9 +4168,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4489,8 +4194,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4556,8 +4259,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4575,8 +4276,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4597,9 +4296,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4626,8 +4322,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4693,8 +4387,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4712,8 +4404,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4734,9 +4424,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4763,8 +4450,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4830,8 +4515,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY INVOKER COMMENT 'comment' SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4849,8 +4532,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4871,9 +4552,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4900,8 +4578,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4967,8 +4643,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -4986,8 +4660,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5008,9 +4680,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5037,8 +4706,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5104,8 +4771,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comm SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5123,8 +4788,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5145,9 +4808,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5174,8 +4834,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5241,8 +4899,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER COMME SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5260,8 +4916,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5282,9 +4936,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5311,8 +4962,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5378,8 +5027,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER CO SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5397,8 +5044,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5419,9 +5064,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5448,8 +5090,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5515,8 +5155,6 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5534,8 +5172,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5556,9 +5192,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5585,8 +5218,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5652,8 +5283,6 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5671,8 +5300,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5693,9 +5320,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5722,8 +5346,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5789,8 +5411,6 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5808,8 +5428,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5830,9 +5448,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5859,8 +5474,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5926,8 +5539,6 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5945,8 +5556,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5967,9 +5576,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -5996,8 +5602,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6063,8 +5667,6 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6082,8 +5684,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6104,9 +5704,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6133,8 +5730,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6200,8 +5795,6 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY DEFINER COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6219,8 +5812,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6241,9 +5832,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6270,8 +5858,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6337,8 +5923,6 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY DEFINER COMMENT 'comment' SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6356,8 +5940,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6378,9 +5960,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6407,8 +5986,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6474,8 +6051,6 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY DEFINER COMMENT 'comment' ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6493,8 +6068,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6515,9 +6088,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6544,8 +6114,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6611,8 +6179,6 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY DEFINER COMMENT 'commen SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6630,8 +6196,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6652,9 +6216,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6681,8 +6242,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6748,8 +6307,6 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER COMMENT 'com SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6767,8 +6324,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6789,9 +6344,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6818,8 +6370,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6885,8 +6435,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6904,8 +6452,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6926,9 +6472,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -6955,8 +6498,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7022,8 +6563,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7041,8 +6580,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7063,9 +6600,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7092,8 +6626,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7159,8 +6691,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7178,8 +6708,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7200,9 +6728,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7229,8 +6754,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7296,8 +6819,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER ; SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7315,8 +6836,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7337,9 +6856,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7366,8 +6882,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7433,8 +6947,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7452,8 +6964,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7474,9 +6984,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7503,8 +7010,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7570,8 +7075,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY DEFINER COMMENT 'comment' SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7589,8 +7092,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7611,9 +7112,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7640,8 +7138,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7707,8 +7203,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER COMMEN SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7726,8 +7220,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7748,9 +7240,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7777,8 +7266,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7844,8 +7331,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER COMMENT 'com SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7863,8 +7348,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7885,9 +7368,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7914,8 +7394,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -7981,8 +7459,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER COMM SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8000,8 +7476,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8022,9 +7496,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8051,8 +7522,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8118,8 +7587,6 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER C SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8137,8 +7604,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8159,9 +7624,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -8188,8 +7650,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 diff --git a/mysql-test/suite/engines/funcs/r/sf_cursor.result b/mysql-test/suite/engines/funcs/r/sf_cursor.result index e43bcaa50a3..2fe2171b39d 100644 --- a/mysql-test/suite/engines/funcs/r/sf_cursor.result +++ b/mysql-test/suite/engines/funcs/r/sf_cursor.result @@ -34,8 +34,6 @@ END// SELECT sf1(); sf1() 0 -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -53,8 +51,6 @@ id data 2 1 3 3 INSERT INTO t4 VALUES(sf1()); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -75,9 +71,6 @@ id data 3 3 3 3 UPDATE t4 SET i = sf1() + 1 WHERE i = sf1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -104,8 +97,6 @@ id data 3 3 3 3 DELETE FROM t4 WHERE i = sf1() + 1; -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 diff --git a/mysql-test/suite/engines/funcs/r/sp_alter.result b/mysql-test/suite/engines/funcs/r/sp_alter.result index 794a692edc4..22036fecde7 100644 --- a/mysql-test/suite/engines/funcs/r/sp_alter.result +++ b/mysql-test/suite/engines/funcs/r/sp_alter.result @@ -31,8 +31,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -82,8 +80,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# CONTAINS SQL ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -133,8 +129,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# NO SQL ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -184,8 +178,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# READS SQL DATA ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -235,8 +227,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -286,8 +276,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -337,8 +325,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# CONTAINS SQL COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -388,8 +374,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# NO SQL COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -439,8 +423,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# READS SQL DATA COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -490,8 +472,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -541,8 +521,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -592,8 +570,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -643,8 +619,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -694,8 +668,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -745,8 +717,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -796,8 +766,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -847,8 +815,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -898,8 +864,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -949,8 +913,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1000,8 +962,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1051,8 +1011,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1102,8 +1060,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1153,8 +1109,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1204,8 +1158,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1255,8 +1207,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1306,8 +1256,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1357,8 +1305,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1408,8 +1354,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1459,8 +1403,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1510,8 +1452,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1561,8 +1501,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1612,8 +1550,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1663,8 +1599,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1714,8 +1648,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1765,8 +1697,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1816,8 +1746,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1867,8 +1795,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1918,8 +1844,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -1969,8 +1893,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2020,8 +1942,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2071,8 +1991,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2122,8 +2040,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2173,8 +2089,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2224,8 +2138,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2275,8 +2187,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2326,8 +2236,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2377,8 +2285,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2428,8 +2334,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2479,8 +2383,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2530,8 +2432,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2581,8 +2481,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2632,8 +2530,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2683,8 +2579,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2734,8 +2628,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2785,8 +2677,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2836,8 +2726,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2887,8 +2775,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2938,8 +2824,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -2989,8 +2873,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 @@ -3040,8 +2922,6 @@ CLOSE cur2; END// ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ; CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 diff --git a/mysql-test/suite/engines/funcs/r/sp_cursor.result b/mysql-test/suite/engines/funcs/r/sp_cursor.result index 58383f8a9cb..6ce2aae030c 100644 --- a/mysql-test/suite/engines/funcs/r/sp_cursor.result +++ b/mysql-test/suite/engines/funcs/r/sp_cursor.result @@ -30,8 +30,6 @@ CLOSE cur1; CLOSE cur2; END// CALL sp1(); -Warnings: -Error 1329 No data - zero rows fetched, selected, or processed SELECT * FROM t1 ORDER BY id; id data 1 1 From 27ac97ef9e3d40656d550e263a4297b08157af14 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 4 Dec 2014 01:59:25 +0400 Subject: [PATCH 092/201] MDEV-7255 Failures in engines/* tests, part 3 Error message was changed along with CREATE OR REPLACE TABLE fixes --- mysql-test/suite/engines/funcs/r/sq_error.result | 8 ++++---- .../engines/iuds/r/update_delete_number.result | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/suite/engines/funcs/r/sq_error.result b/mysql-test/suite/engines/funcs/r/sq_error.result index c983ff73d12..2090f4b9cd4 100644 --- a/mysql-test/suite/engines/funcs/r/sq_error.result +++ b/mysql-test/suite/engines/funcs/r/sq_error.result @@ -16,7 +16,7 @@ SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data DROP TABLE t1; DROP TABLE t2; CREATE TABLE t1 (c1 INT, c2 VARCHAR(100),c3 FLOAT); @@ -35,7 +35,7 @@ SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data DROP TABLE t1; DROP TABLE t2; CREATE TABLE t1 (c1 INT, c2 BINARY(100),c3 FLOAT); @@ -54,7 +54,7 @@ SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data DROP TABLE t1; DROP TABLE t2; CREATE TABLE t1 (c1 INT, c2 VARBINARY(100),c3 FLOAT); @@ -73,6 +73,6 @@ SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result index 8e190870092..15de16ed714 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_number.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result @@ -740,7 +740,7 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2; SELECT * FROM t1,t2 WHERE t2.c1=t1.c2; c1 c2 c3 c1 c2 c3 DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data CREATE TABLE t3(c1 INT UNSIGNED NOT NULL PRIMARY KEY, c2 INT SIGNED NULL, c3 INT); CREATE TABLE t4(c1 INT UNSIGNED, c2 INT); INSERT INTO t3 VALUES(200,126,1),(250,-127,2); @@ -980,9 +980,9 @@ drop table mt1, mt2, mt3; create table mt1 (col1 int); create table mt2 (col1 int); update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1; -ERROR HY000: You can't specify target table 'mt1' for update in FROM clause +ERROR HY000: Table 'mt1' is specified twice, both as a target for 'UPDATE' and as a separate source for data delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1; -ERROR HY000: You can't specify target table 'mt1' for update in FROM clause +ERROR HY000: Table 'mt1' is specified twice, both as a target for 'DELETE' and as a separate source for data drop table mt1,mt2; CREATE TABLE IF NOT EXISTS `mt1` (`id` int(11) NOT NULL auto_increment, `tst` text, `tsmt1` text, PRIMARY KEY (`id`)); CREATE TABLE IF NOT EXISTS `mt2` (`ID` int(11) NOT NULL auto_increment, `ParId` int(11) default NULL, `tst` text, `tsmt1` text, PRIMARY KEY (`ID`), KEY `IX_ParId_mt2` (`ParId`), FOREIGN KEY (`ParId`) REFERENCES `mt1` (`id`)); @@ -1853,7 +1853,7 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2; SELECT * FROM t1,t2 WHERE t2.c1=t1.c2; c1 c2 c3 c1 c2 c3 DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data CREATE TABLE t3(c1 TINYINT UNSIGNED NOT NULL PRIMARY KEY, c2 TINYINT SIGNED NULL, c3 INT); CREATE TABLE t4(c1 TINYINT UNSIGNED, c2 INT); INSERT INTO t3 VALUES(200,126,1),(250,-127,2); @@ -2600,7 +2600,7 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2; SELECT * FROM t1,t2 WHERE t2.c1=t1.c2; c1 c2 c3 c1 c2 c3 DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data CREATE TABLE t3(c1 SMALLINT UNSIGNED NOT NULL PRIMARY KEY, c2 SMALLINT SIGNED NULL, c3 INT); CREATE TABLE t4(c1 SMALLINT UNSIGNED, c2 INT); INSERT INTO t3 VALUES(200,126,1),(250,-127,2); @@ -3347,7 +3347,7 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2; SELECT * FROM t1,t2 WHERE t2.c1=t1.c2; c1 c2 c3 c1 c2 c3 DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data CREATE TABLE t3(c1 MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, c2 MEDIUMINT SIGNED NULL, c3 INT); CREATE TABLE t4(c1 MEDIUMINT UNSIGNED, c2 INT); INSERT INTO t3 VALUES(200,126,1),(250,-127,2); @@ -4077,7 +4077,7 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2; SELECT * FROM t1,t2 WHERE t2.c1=t1.c2; c1 c2 c3 c1 c2 c3 DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1); -ERROR HY000: You can't specify target table 't1' for update in FROM clause +ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data CREATE TABLE t3(c1 BIGINT UNSIGNED NOT NULL PRIMARY KEY, c2 BIGINT SIGNED NULL, c3 INT); CREATE TABLE t4(c1 BIGINT UNSIGNED, c2 INT); INSERT INTO t3 VALUES(200,126,1),(250,-127,2); From d5f52fec77de0b3bffe1c86e94b959c0fdd5d7f1 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 4 Dec 2014 02:16:41 +0400 Subject: [PATCH 093/201] MDEV-7255 Failures in engines/* tests, part 4 Updated engines/* test results according to the bugfix MDEV-5894 (MySQL BUG#34750: Print database name in Unknown Table error message) --- .../suite/engines/funcs/r/ta_rename.result | 64 ++++----- .../r/strings_charsets_update_delete.result | Bin 112951 -> 113116 bytes .../iuds/r/strings_update_delete.result | 28 ++-- .../suite/engines/iuds/r/type_bit_iuds.result | 128 +++++++++--------- 4 files changed, 110 insertions(+), 110 deletions(-) diff --git a/mysql-test/suite/engines/funcs/r/ta_rename.result b/mysql-test/suite/engines/funcs/r/ta_rename.result index 892a49c9708..f9e78428f9e 100644 --- a/mysql-test/suite/engines/funcs/r/ta_rename.result +++ b/mysql-test/suite/engines/funcs/r/ta_rename.result @@ -14,7 +14,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -39,7 +39,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -64,7 +64,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -89,7 +89,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -114,7 +114,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -139,7 +139,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -164,7 +164,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -189,7 +189,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -214,7 +214,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -239,7 +239,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -264,7 +264,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -289,7 +289,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -314,7 +314,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -339,7 +339,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -364,7 +364,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -389,7 +389,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -414,7 +414,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -439,7 +439,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -464,7 +464,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -489,7 +489,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -514,7 +514,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -539,7 +539,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -564,7 +564,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -589,7 +589,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -614,7 +614,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -639,7 +639,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -664,7 +664,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -689,7 +689,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -714,7 +714,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -739,7 +739,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -764,7 +764,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -789,7 +789,7 @@ SHOW TABLES; Tables_in_test t2 DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +ERROR 42S02: Unknown table 'test.t1' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result b/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result index 08eecb1c17d52648b61184c98cfc97174e7be5cb..fdd1a4be2903e03704c4cf6ea2543c5905ce0ed2 100644 GIT binary patch delta 340 zcmdn~iS5p3wh5JNsl_FFC596(%CLY~(>HEsl!J&F!^9?@hl-d2MIdr!Ko%=l=j1>p zS%{bgO#S2pMmctfu?8@)=?Oa+<)MN`KtU)IWCzRz7i6J=AZx&mnQX`;4`KL28O^y& Y+jE&1HMYVu5#wwcJB$OMgRZ+ diff --git a/mysql-test/suite/engines/iuds/r/strings_update_delete.result b/mysql-test/suite/engines/iuds/r/strings_update_delete.result index 283f39efe84..159d2608ea1 100644 --- a/mysql-test/suite/engines/iuds/r/strings_update_delete.result +++ b/mysql-test/suite/engines/iuds/r/strings_update_delete.result @@ -70471,17 +70471,17 @@ SIZE DROP TABLE t17,t18; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18; Warnings: -Note 1051 Unknown table 't3' -Note 1051 Unknown table 't4' -Note 1051 Unknown table 't5' -Note 1051 Unknown table 't6' -Note 1051 Unknown table 't7' -Note 1051 Unknown table 't8' -Note 1051 Unknown table 't9' -Note 1051 Unknown table 't10' -Note 1051 Unknown table 't11' -Note 1051 Unknown table 't13' -Note 1051 Unknown table 't14' -Note 1051 Unknown table 't15' -Note 1051 Unknown table 't17' -Note 1051 Unknown table 't18' +Note 1051 Unknown table 'test.t3' +Note 1051 Unknown table 'test.t4' +Note 1051 Unknown table 'test.t5' +Note 1051 Unknown table 'test.t6' +Note 1051 Unknown table 'test.t7' +Note 1051 Unknown table 'test.t8' +Note 1051 Unknown table 'test.t9' +Note 1051 Unknown table 'test.t10' +Note 1051 Unknown table 'test.t11' +Note 1051 Unknown table 'test.t13' +Note 1051 Unknown table 'test.t14' +Note 1051 Unknown table 'test.t15' +Note 1051 Unknown table 'test.t17' +Note 1051 Unknown table 'test.t18' diff --git a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result index 7cfeb1958cf..b7a910f36e6 100644 --- a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result +++ b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result @@ -780,7 +780,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -1611,7 +1611,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -2461,7 +2461,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -3375,7 +3375,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -4574,7 +4574,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -5978,7 +5978,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -8049,7 +8049,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'0'; 0 + b'0' 0 @@ -11227,7 +11227,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -12009,7 +12009,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -12840,7 +12840,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -13690,7 +13690,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -14604,7 +14604,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -15803,7 +15803,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -17207,7 +17207,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -19278,7 +19278,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1'; 0 + b'1' 1 @@ -22456,7 +22456,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -23244,7 +23244,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -24081,7 +24081,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -24931,7 +24931,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -25845,7 +25845,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -27044,7 +27044,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -28448,7 +28448,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -30519,7 +30519,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'10'; 0 + b'10' 2 @@ -33697,7 +33697,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -34485,7 +34485,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -35322,7 +35322,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -36178,7 +36178,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -37092,7 +37092,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -38291,7 +38291,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -39695,7 +39695,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -41766,7 +41766,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010'; 0 + b'1010' 10 @@ -44944,7 +44944,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -45732,7 +45732,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -46569,7 +46569,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -47425,7 +47425,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -48345,7 +48345,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -49550,7 +49550,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -50954,7 +50954,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -53025,7 +53025,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'1010101010101010'; 0 + b'1010101010101010' 43690 @@ -56203,7 +56203,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -56993,7 +56993,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -57832,7 +57832,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -58690,7 +58690,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -59612,7 +59612,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -60819,7 +60819,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -62231,7 +62231,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -64304,7 +64304,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + b'101010101010101010101010101010'; 0 + b'101010101010101010101010101010' 715827882 @@ -67484,7 +67484,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<0); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<0) 9223372036854775807 @@ -68271,7 +68271,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<1); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<1) 18446744073709551614 @@ -69107,7 +69107,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<2); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<2) 18446744073709551612 @@ -69962,7 +69962,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<4); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<4) 18446744073709551600 @@ -70881,7 +70881,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<8); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<8) 18446744073709551360 @@ -72085,7 +72085,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<16); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<16) 18446744073709486080 @@ -73494,7 +73494,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<32); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<32) 18446744069414584320 @@ -75570,7 +75570,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<64); 0 + (1010101010101010101010101010101010101010101010101010101010101010<<64) 0 @@ -78747,7 +78747,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<0); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<0) 9223372036854775807 @@ -79534,7 +79534,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1) 18446744073709551614 @@ -80370,7 +80370,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<2); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<2) 18446744073709551612 @@ -81225,7 +81225,7 @@ hex(c1) hex(c2) DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<4); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<4) 18446744073709551600 @@ -82144,7 +82144,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<8); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<8) 18446744073709551360 @@ -83348,7 +83348,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<16); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<16) 18446744073709486080 @@ -84757,7 +84757,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<32); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<32) 18446744069414584320 @@ -86833,7 +86833,7 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<64); 0 + (10101010101010101010101010101010101010101010101010101010101010101<<64) 0 @@ -90016,4 +90016,4 @@ A A DELETE t5,t6 FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; Warnings: -Note 1051 Unknown table 't3' +Note 1051 Unknown table 'test.t3' From f02f06172c9fa32201ab36ddc9e35109e2ce1a88 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 4 Dec 2014 02:17:09 +0400 Subject: [PATCH 094/201] MDEV-7255 Failures in engines/* tests, part 5 RENAME TABLE on a non-existing table produces a better error message --- mysql-test/suite/engines/funcs/r/tc_rename_error.result | 2 +- mysql-test/suite/engines/funcs/t/tc_rename_error.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/engines/funcs/r/tc_rename_error.result b/mysql-test/suite/engines/funcs/r/tc_rename_error.result index bd1c2abc057..cd5108107fb 100644 --- a/mysql-test/suite/engines/funcs/r/tc_rename_error.result +++ b/mysql-test/suite/engines/funcs/r/tc_rename_error.result @@ -15,7 +15,7 @@ ERROR 42S01: Table 't1' already exists RENAME TABLE t3 TO t1; ERROR 42S01: Table 't1' already exists RENAME TABLE t3 TO doesnotexist.t1; -ERROR HY000: Can't find file: './test/t3.frm' (errno: 2 "No such file or directory") +ERROR 42S02: Table 'test.t3' doesn't exist SHOW TABLES; Tables_in_test t1 diff --git a/mysql-test/suite/engines/funcs/t/tc_rename_error.test b/mysql-test/suite/engines/funcs/t/tc_rename_error.test index 91efeacaeef..3fc4901a364 100644 --- a/mysql-test/suite/engines/funcs/t/tc_rename_error.test +++ b/mysql-test/suite/engines/funcs/t/tc_rename_error.test @@ -11,7 +11,7 @@ let $ENGINE=`select variable_value from information_schema.global_variables wher RENAME TABLE t2 TO t1; --error 1050 RENAME TABLE t3 TO t1; ---error 1017 +--error 1146 RENAME TABLE t3 TO doesnotexist.t1; SHOW TABLES; let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`; From c8f7f98737ca22b9f20cf835896f99e3ecc77495 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 4 Dec 2014 02:54:42 +0400 Subject: [PATCH 095/201] MDEV-7255 Failures in engines/* tests, part 6 Updated hardcoded event numbers according to current GTID logic --- mysql-test/suite/engines/funcs/t/rpl_row_until.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_until.test b/mysql-test/suite/engines/funcs/t/rpl_row_until.test index bf38bd487ea..7c1715b760e 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test @@ -11,18 +11,18 @@ INSERT INTO t1 VALUES (1),(2),(3),(4); DROP TABLE t1; # Save master log position for query DROP TABLE t1 save_master_pos; -let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7); -let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7); +let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 10); +let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 10); CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); # Save master log position for query CREATE TABLE t2 save_master_pos; -let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8); +let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 12); INSERT INTO t2 VALUES (1),(2); save_master_pos; # Save master log position for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12); +let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 17); sync_slave_with_master; # Save relay log position for query INSERT INTO t2 VALUES (1),(2); @@ -31,8 +31,8 @@ let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1); connection master; INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; -# Save master log position for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 17); +# Save master log position for query DROP TABLE t2; +let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 23); sync_slave_with_master; --source include/stop_slave.inc From 5bba1109b24596a7786356db0882277b32cc0a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 4 Dec 2014 14:10:41 +0200 Subject: [PATCH 096/201] Add possibility to success on Windows. --- mysql-test/suite/innodb/t/innodb-mdev7046.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index cdf63147d02..ce497a4de66 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -27,8 +27,9 @@ drop table t1; DROP DATABASE test;CREATE DATABASE test;USE test; SET @@session.storage_engine=MYISAM; ---error 1 +--error 1,0 CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); +drop table if exists t1; CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); ALTER TABLE t1 ENGINE=InnoDB; From 010724f6c5d6ff687aade00b4d267958a669c5a7 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 5 Dec 2014 14:23:24 +0400 Subject: [PATCH 097/201] Run engines tests for MyISAM and in-built InnoDB --- mysql-test/suite/engines/funcs/combinations | 11 +++++++++++ mysql-test/suite/engines/iuds/combinations | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 mysql-test/suite/engines/funcs/combinations create mode 100644 mysql-test/suite/engines/iuds/combinations diff --git a/mysql-test/suite/engines/funcs/combinations b/mysql-test/suite/engines/funcs/combinations new file mode 100644 index 00000000000..4d236d27b8f --- /dev/null +++ b/mysql-test/suite/engines/funcs/combinations @@ -0,0 +1,11 @@ +[innodb] +innodb +default-storage-engine=innodb +partition + +[myisam] +skip-innodb +default-storage-engine=myisam +partition + + diff --git a/mysql-test/suite/engines/iuds/combinations b/mysql-test/suite/engines/iuds/combinations new file mode 100644 index 00000000000..2077c41a7be --- /dev/null +++ b/mysql-test/suite/engines/iuds/combinations @@ -0,0 +1,8 @@ +[innodb] +innodb +default-storage-engine=innodb + +[myisam] +skip-innodb +default-storage-engine=myisam + From f7fed26390a2b7b114cf8d7fcc8625589fb02a12 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 5 Dec 2014 21:38:16 +0400 Subject: [PATCH 098/201] Storage engines tests: ALTER ONLINE works differently for MERGE in 10.0 --- .../storage_engine/alter_table_online.rdiff | 82 ++++++++++++++----- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff b/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff index c21211560e9..854a00cfd81 100644 --- a/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff +++ b/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff @@ -1,44 +1,82 @@ ---- suite/storage_engine/alter_table_online.result 2014-09-25 12:15:42.000000000 +0400 -+++ suite/storage_engine/alter_table_online.reject 2014-11-17 20:25:16.000000000 +0400 -@@ -9,20 +9,35 @@ - CREATE TEMPORARY TABLE t1 (a , b ) ENGINE= ; - INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +--- suite/storage_engine/alter_table_online.result 2014-11-12 05:27:00.000000000 +0400 ++++ suite/storage_engine/alter_table_online.reject 2014-12-05 20:42:25.000000000 +0400 +@@ -2,8 +2,35 @@ + CREATE TABLE t1 (a , b , c ) ENGINE= ; + INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); ALTER ONLINE TABLE t1 MODIFY b DEFAULT 5; --ERROR HY000: Can't execute the given 'ALTER' command as online -+# ERROR: Statement succeeded (expected results: ER_CANT_DO_ONLINE) ++ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ++# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) +# ------------ UNEXPECTED RESULT ------------ -+# The statement|command succeeded unexpectedly. ++# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. +# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +# Also, this problem may cause a chain effect (more errors of different kinds in the test). +# ------------------------------------------- ALTER ONLINE TABLE t1 CHANGE b new_name ; --ERROR HY000: Can't execute the given 'ALTER' command as online -+# ERROR: Statement succeeded (expected results: ER_CANT_DO_ONLINE) ++ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ++# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. ++# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- ALTER ONLINE TABLE t1 COMMENT 'new comment'; --ERROR HY000: Can't execute the given 'ALTER' command as online -+# ERROR: Statement succeeded (expected results: ER_CANT_DO_ONLINE) ++ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ++# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. ++# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- ALTER ONLINE TABLE t1 RENAME TO t2; --ERROR HY000: Can't execute the given 'ALTER' command as online -+# ERROR: Statement succeeded (expected results: ER_CANT_DO_ONLINE) - DROP TABLE t1; -+ERROR 42S02: Unknown table 't1' + ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. + DROP TABLE IF EXISTS t2; +@@ -12,10 +39,6 @@ + CREATE TEMPORARY TABLE t1 (a , b ) ENGINE= ; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + ALTER ONLINE TABLE t1 MODIFY b DEFAULT 5; +-Warnings: +-Warning 1366 Incorrect integer value: 'a' for column 'b' at row 1 +-Warning 1366 Incorrect integer value: 'b' for column 'b' at row 2 +-Warning 1366 Incorrect integer value: 'c' for column 'b' at row 3 + ALTER ONLINE TABLE t1 CHANGE b new_name ; + ALTER ONLINE TABLE t1 COMMENT 'new comment'; + ALTER ONLINE TABLE t1 RENAME TO t2; +@@ -23,12 +46,30 @@ CREATE TABLE t1 (a , b , c ) ENGINE= ; INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b ; --ERROR HY000: Can't execute the given 'ALTER' command as online -+# ERROR: Statement succeeded (expected results: ER_CANT_DO_ONLINE) ++ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ++# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) +# ------------ UNEXPECTED RESULT ------------ -+# The statement|command succeeded unexpectedly. ++# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. +# Functionality or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +# Also, this problem may cause a chain effect (more errors of different kinds in the test). +# ------------------------------------------- ALTER ONLINE TABLE t1 MODIFY b BIGINT ; --ERROR HY000: Can't execute the given 'ALTER' command as online -+# ERROR: Statement succeeded (expected results: ER_CANT_DO_ONLINE) +-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED. ++ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ++# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected results: ER_ALTER_OPERATION_NOT_SUPPORTED_REASON) ALTER ONLINE TABLE t1 ENGINE=MEMORY; - ERROR HY000: Can't execute the given 'ALTER' command as online + ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED. + DROP TABLE t1; + CREATE TABLE t1 (a , b , c ) ENGINE= ; + ALTER ONLINE TABLE t1 ADD INDEX (b); +-ALTER ONLINE TABLE t1 DROP INDEX b; ++ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. ++# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_ALTER_OPERATION_NOT_SUPPORTED. ++# Adding an index or ALTER ONLINE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- DROP TABLE t1; From 955cce52f65d119d9295384e5b4b8e657d324cc5 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sun, 7 Dec 2014 13:17:45 -0500 Subject: [PATCH 099/201] run on mariadb 10 with its safe malloc --- storage/tokudb/ha_tokudb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index d5168150298..578b6c01856 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -1731,7 +1731,7 @@ int ha_tokudb::initialize_share(const char* name, int mode) { // initialize cardinality info from the status dictionary share->n_rec_per_key = tokudb::compute_total_key_parts(table_share); - share->rec_per_key = (uint64_t *) tokudb_my_realloc(share->rec_per_key, share->n_rec_per_key * sizeof (uint64_t), MYF(MY_FAE)); + share->rec_per_key = (uint64_t *) tokudb_my_realloc(share->rec_per_key, share->n_rec_per_key * sizeof (uint64_t), MYF(MY_FAE + MY_ALLOW_ZERO_PTR)); error = tokudb::get_card_from_status(share->status_block, txn, share->n_rec_per_key, share->rec_per_key); if (error) { for (uint i = 0; i < share->n_rec_per_key; i++) From 76c3981e43cc6063f3611533881e4b67ff0389f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 10 Dec 2014 12:12:09 +0200 Subject: [PATCH 100/201] Fix test case to allow success on create table (Windows). --- mysql-test/suite/innodb/t/innodb-mdev7046.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index ce497a4de66..3c74ff64275 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -7,7 +7,7 @@ # Ignore OS errors call mtr.add_suppression("InnoDB: File ./test/t1*"); -call mtr.add_suppression("nnoDB: Error number*"); +call mtr.add_suppression("InnoDB: Error number*"); # MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) # after Operating system error number 36 in a file operation @@ -27,7 +27,7 @@ drop table t1; DROP DATABASE test;CREATE DATABASE test;USE test; SET @@session.storage_engine=MYISAM; ---error 1,0 +--error 0,1 CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); drop table if exists t1; CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); From 6c8963e9eabed623ecad1b385b4f8a0f0e970966 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Thu, 11 Dec 2014 19:59:48 -0500 Subject: [PATCH 101/201] relax the time constraints on the bulk fetch tests --- mysql-test/suite/tokudb/t/bf_create_select.test | 8 ++++---- .../suite/tokudb/t/bf_create_select_range_part.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_create_temp_select.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_delete.test | 7 +++---- mysql-test/suite/tokudb/t/bf_insert_select.test | 6 +++--- mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_replace_select.test | 6 +++--- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/mysql-test/suite/tokudb/t/bf_create_select.test b/mysql-test/suite/tokudb/t/bf_create_select.test index 20455da874f..c8ff2615c7c 100644 --- a/mysql-test/suite/tokudb/t/bf_create_select.test +++ b/mysql-test/suite/tokudb/t/bf_create_select.test @@ -65,8 +65,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least twice that whith bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo index $time_elapsed_on $time_elapsed_off; } @@ -94,8 +94,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least twice that whith bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo range $time_elapsed_on $time_elapsed_off; } diff --git a/mysql-test/suite/tokudb/t/bf_create_select_range_part.test b/mysql-test/suite/tokudb/t/bf_create_select_range_part.test index b66b2c42808..e2ec066aad1 100644 --- a/mysql-test/suite/tokudb/t/bf_create_select_range_part.test +++ b/mysql-test/suite/tokudb/t/bf_create_select_range_part.test @@ -72,8 +72,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 2 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# check that bulk fetch on is at least 1.5 times faster than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -100,8 +100,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 2 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# check that bulk fetch on is at least 1.5 times faster than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_create_temp_select.test b/mysql-test/suite/tokudb/t/bf_create_temp_select.test index 52cb886a410..1a373277960 100644 --- a/mysql-test/suite/tokudb/t/bf_create_temp_select.test +++ b/mysql-test/suite/tokudb/t/bf_create_temp_select.test @@ -65,8 +65,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least twice that whith bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo index $time_elapsed_on $time_elapsed_off; } @@ -94,8 +94,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least twice that whith bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo range $time_elapsed_on $time_elapsed_off; } diff --git a/mysql-test/suite/tokudb/t/bf_delete.test b/mysql-test/suite/tokudb/t/bf_delete.test index f98e87f1ec1..cd7cd60f174 100644 --- a/mysql-test/suite/tokudb/t/bf_delete.test +++ b/mysql-test/suite/tokudb/t/bf_delete.test @@ -1,5 +1,4 @@ -# Verify that index scans for delete statements use bulk fetch and are -# at least twice as fast +# Verify that index scans for delete statements use bulk fetch are faster than when not using bulk fetch source include/have_tokudb.inc; source include/big_test.inc; @@ -62,8 +61,8 @@ while ($i < $maxq) { } let $time_elapsed_bf_off = `select unix_timestamp() - $s`; -# verify that a delete scan with bulk fetch ON is at least 2 times faster than with bulk fetch OFF -let $verdict = `select $time_elapsed_bf_on > 0 && $time_elapsed_bf_off >= 2 * $time_elapsed_bf_on`; +# verify that a delete scan with bulk fetch ON is at least 1.5 times faster than with bulk fetch OFF +let $verdict = `select $time_elapsed_bf_on > 0 && $time_elapsed_bf_off >= 1.5 * $time_elapsed_bf_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_bf_on $time_elapsed_bf_off; } if (!$verdict) { echo range $time_elapsed_bf_on $time_elapsed_bf_off; } diff --git a/mysql-test/suite/tokudb/t/bf_insert_select.test b/mysql-test/suite/tokudb/t/bf_insert_select.test index 5fcb8fa58b5..17852b4262a 100644 --- a/mysql-test/suite/tokudb/t/bf_insert_select.test +++ b/mysql-test/suite/tokudb/t/bf_insert_select.test @@ -66,8 +66,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 2 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# check that bulk fetch on is at least 1.5 times faster than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -92,7 +92,7 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test b/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test index 51c6d66d706..876eb636aae 100644 --- a/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test +++ b/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test @@ -70,8 +70,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 2 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# check that bulk fetch on is at least 1.5 times faster than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -96,8 +96,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 2 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# check that bulk fetch on is at least 1.5 times faster than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_replace_select.test b/mysql-test/suite/tokudb/t/bf_replace_select.test index 1ca754454eb..30a03e3ebfe 100644 --- a/mysql-test/suite/tokudb/t/bf_replace_select.test +++ b/mysql-test/suite/tokudb/t/bf_replace_select.test @@ -66,8 +66,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 2 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +# check that bulk fetch on is at least 1.5 times faster than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -92,7 +92,7 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 2 * $time_elapsed_on`; +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } From 16fb2963ff497b7c0b6371a3bd3f0345dc625815 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Fri, 12 Dec 2014 14:03:20 +0100 Subject: [PATCH 102/201] Fix typo that breaks compilation on platforms without atomics. --- sql/rpl_parallel.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 53b37e82cdb..1a9e269022a 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -1131,9 +1131,9 @@ rpl_parallel_thread::inuse_relaylog_refcount_update() inuse_relaylog *ir= accumulated_ir_last; if (ir) { - my_atomic_rwlock_wrlock(&ir->rli->inuse_relaylog_atomic_lock); + my_atomic_rwlock_wrlock(&ir->inuse_relaylog_atomic_lock); my_atomic_add64(&ir->dequeued_count, accumulated_ir_count); - my_atomic_rwlock_wrunlock(&ir->rli->inuse_relaylog_atomic_lock); + my_atomic_rwlock_wrunlock(&ir->inuse_relaylog_atomic_lock); accumulated_ir_count= 0; accumulated_ir_last= NULL; } From 71764ccb4eaa3f05a9e739931fb6d915bb75f0ff Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 12 Dec 2014 09:21:08 -0500 Subject: [PATCH 103/201] relax the time constraints on the bulk fetch tests again --- mysql-test/suite/tokudb/t/bf_create_select.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_create_select_hash_part.test | 8 ++++---- .../suite/tokudb/t/bf_create_select_range_part.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_create_temp_select.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_delete.test | 4 ++-- mysql-test/suite/tokudb/t/bf_insert_select.test | 6 +++--- mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_replace_select.test | 7 ++++--- mysql-test/suite/tokudb/t/bf_select_hash_part.test | 8 ++++---- mysql-test/suite/tokudb/t/bf_select_range_part.test | 8 ++++---- 10 files changed, 37 insertions(+), 36 deletions(-) diff --git a/mysql-test/suite/tokudb/t/bf_create_select.test b/mysql-test/suite/tokudb/t/bf_create_select.test index c8ff2615c7c..8c457b75f27 100644 --- a/mysql-test/suite/tokudb/t/bf_create_select.test +++ b/mysql-test/suite/tokudb/t/bf_create_select.test @@ -65,8 +65,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# Check that the time with bulk fetch off is greater that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo index $time_elapsed_on $time_elapsed_off; } @@ -94,8 +94,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# Check that the time with bulk fetch off is greater that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo range $time_elapsed_on $time_elapsed_off; } diff --git a/mysql-test/suite/tokudb/t/bf_create_select_hash_part.test b/mysql-test/suite/tokudb/t/bf_create_select_hash_part.test index 4df0a138be8..34995b4ba2f 100644 --- a/mysql-test/suite/tokudb/t/bf_create_select_hash_part.test +++ b/mysql-test/suite/tokudb/t/bf_create_select_hash_part.test @@ -65,8 +65,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that bulk fetch on is greater than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -93,8 +93,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that bulk fetch on is greater than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_create_select_range_part.test b/mysql-test/suite/tokudb/t/bf_create_select_range_part.test index e2ec066aad1..a53249893f4 100644 --- a/mysql-test/suite/tokudb/t/bf_create_select_range_part.test +++ b/mysql-test/suite/tokudb/t/bf_create_select_range_part.test @@ -72,8 +72,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that bulk fetch on is greater than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -100,8 +100,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that bulk fetch on is greater than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_create_temp_select.test b/mysql-test/suite/tokudb/t/bf_create_temp_select.test index 1a373277960..4f8211a51d9 100644 --- a/mysql-test/suite/tokudb/t/bf_create_temp_select.test +++ b/mysql-test/suite/tokudb/t/bf_create_temp_select.test @@ -65,8 +65,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# Check that the time with bulk fetch off is greater that with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo index $time_elapsed_on $time_elapsed_off; } @@ -94,8 +94,8 @@ while ($i < $maxq) { let $time_elapsed_off = `select unix_timestamp() - $s`; -# Check that the time with bulk fetch off is at least 1.5 times that with bulk fetch on -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# Check that the time with bulk fetch off is greater than with bulk fetch on +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_on $time_elapsed_off; } if (!$verdict) { echo range $time_elapsed_on $time_elapsed_off; } diff --git a/mysql-test/suite/tokudb/t/bf_delete.test b/mysql-test/suite/tokudb/t/bf_delete.test index cd7cd60f174..a55d78784cc 100644 --- a/mysql-test/suite/tokudb/t/bf_delete.test +++ b/mysql-test/suite/tokudb/t/bf_delete.test @@ -61,8 +61,8 @@ while ($i < $maxq) { } let $time_elapsed_bf_off = `select unix_timestamp() - $s`; -# verify that a delete scan with bulk fetch ON is at least 1.5 times faster than with bulk fetch OFF -let $verdict = `select $time_elapsed_bf_on > 0 && $time_elapsed_bf_off >= 1.5 * $time_elapsed_bf_on`; +# verify that a delete scan with bulk fetch ON is greater than with bulk fetch OFF +let $verdict = `select $time_elapsed_bf_on > 0 && $time_elapsed_bf_off > $time_elapsed_bf_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_bf_on $time_elapsed_bf_off; } if (!$verdict) { echo range $time_elapsed_bf_on $time_elapsed_bf_off; } diff --git a/mysql-test/suite/tokudb/t/bf_insert_select.test b/mysql-test/suite/tokudb/t/bf_insert_select.test index 17852b4262a..8d96c26bc29 100644 --- a/mysql-test/suite/tokudb/t/bf_insert_select.test +++ b/mysql-test/suite/tokudb/t/bf_insert_select.test @@ -66,8 +66,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that the time with bulk fetch on is greater than with bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -92,7 +92,7 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test b/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test index 876eb636aae..1b015b2c272 100644 --- a/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test +++ b/mysql-test/suite/tokudb/t/bf_insert_select_dup_key.test @@ -70,8 +70,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that bulk fetch on is greater than with bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -96,8 +96,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that bulk fetch on is greater than bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_replace_select.test b/mysql-test/suite/tokudb/t/bf_replace_select.test index 30a03e3ebfe..72cda349f80 100644 --- a/mysql-test/suite/tokudb/t/bf_replace_select.test +++ b/mysql-test/suite/tokudb/t/bf_replace_select.test @@ -66,8 +66,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -# check that bulk fetch on is at least 1.5 times faster than bulk fetch off -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that the time with bulk fetch on is greater than with bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo index $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo index $time_elapsed_off $time_elapsed_on; } @@ -92,7 +92,8 @@ while ($i < $maxq) { } let $time_elapsed_off = `select unix_timestamp() - $s`; -let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off >= 1.5 * $time_elapsed_on`; +# check that the time with bulk fetch on is greater than with bulk fetch off +let $verdict = `select $time_elapsed_on > 0 && $time_elapsed_off > $time_elapsed_on`; echo $verdict; if ($debug) { echo range $verdict $time_elapsed_off $time_elapsed_on; } if (!$verdict) { echo range $time_elapsed_off $time_elapsed_on; } diff --git a/mysql-test/suite/tokudb/t/bf_select_hash_part.test b/mysql-test/suite/tokudb/t/bf_select_hash_part.test index 2271a2086be..46986278743 100644 --- a/mysql-test/suite/tokudb/t/bf_select_hash_part.test +++ b/mysql-test/suite/tokudb/t/bf_select_hash_part.test @@ -65,8 +65,8 @@ let $time_bf_off = `select unix_timestamp() - $s`; if ($debug) { echo index scans took $time_bf_off.; } -# check that the scan time with bulk fetch off is at least 1.5 times as long as with bulk fetch on -let $verdict = `select $time_bf_on > 0 && $time_bf_off >= 1.5 * $time_bf_on`; +# check that the scan time with bulk fetch off is greater than with bulk fetch on +let $verdict = `select $time_bf_on > 0 && $time_bf_off > $time_bf_on`; echo $verdict; if ($debug) { echo index $verdict $time_bf_on $time_bf_off; } if (!$verdict) { echo index $time_bf_on $time_bf_off; } @@ -93,8 +93,8 @@ let $time_bf_off = `select unix_timestamp() - $s`; if ($debug) { echo range scans took $time_bf_off.; } -# check that the scan time with bulk fetch off is at least 1.5 times as long as with bulk fetch on -let $verdict = `select $time_bf_on > 0 && $time_bf_off >= 1.5 * $time_bf_on`; +# check that the scan time with bulk fetch off is greater than with bulk fetch on +let $verdict = `select $time_bf_on > 0 && $time_bf_off > $time_bf_on`; echo $verdict; if ($debug) { echo range $verdict $time_bf_on $time_bf_off; } if (!$verdict) { echo range $time_bf_on $time_bf_off; } diff --git a/mysql-test/suite/tokudb/t/bf_select_range_part.test b/mysql-test/suite/tokudb/t/bf_select_range_part.test index 9dcb044d4d4..7e608777798 100644 --- a/mysql-test/suite/tokudb/t/bf_select_range_part.test +++ b/mysql-test/suite/tokudb/t/bf_select_range_part.test @@ -70,8 +70,8 @@ while ($i < $maxq) { } let $time_bf_off = `select unix_timestamp() - $s`; -# check that the scan time with bulk fetch off is at least 1.5 times as long as with bulk fetch on -let $verdict = `select $time_bf_on > 0 && $time_bf_off >= 1.5 * $time_bf_on`; +# check that the scan time with bulk fetch off is greater than with bulk fetch on +let $verdict = `select $time_bf_on > 0 && $time_bf_off > $time_bf_on`; echo $verdict; if ($debug) { echo index $verdict $time_bf_on $time_bf_off; } if (!$verdict) { echo index scan $time_bf_on $time_bf_off; } @@ -94,8 +94,8 @@ while ($i < $maxq) { } let $time_bf_off = `select unix_timestamp() - $s`; -# check that the scan time with bulk fetch off is at least 1.5 times as long as with bulk fetch on -let $verdict = `select $time_bf_on > 0 && $time_bf_off >= 1.5 * $time_bf_on`; +# check that the scan time with bulk fetch off is greater than with bulk fetch on +let $verdict = `select $time_bf_on > 0 && $time_bf_off > $time_bf_on`; echo $verdict; if ($debug) { echo range $verdict $time_bf_on $time_bf_off; } if (!$verdict) { echo range $time_bf_on $time_bf_off; } From c2a756dd77364eb08bf5fa7536adb7a0c84ca3fc Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 12 Dec 2014 09:43:15 -0500 Subject: [PATCH 104/201] FT-633 test case and bug fix for the data race between the lock request start and retry functions that results in a stall in the condition var broadcast --- locktree/lock_request.cc | 32 ++- locktree/lock_request.h | 6 + locktree/locktree.cc | 1 + .../tests/lock_request_start_retry_race.cc | 192 ++++++++++++++++++ src/ydb_row_lock.cc | 1 + 5 files changed, 226 insertions(+), 6 deletions(-) create mode 100644 locktree/tests/lock_request_start_retry_race.cc diff --git a/locktree/lock_request.cc b/locktree/lock_request.cc index 97fa780bb04..18f6051afdf 100644 --- a/locktree/lock_request.cc +++ b/locktree/lock_request.cc @@ -113,12 +113,19 @@ void lock_request::create(void) { m_complete_r = 0; m_state = state::UNINITIALIZED; + m_info = nullptr; toku_cond_init(&m_wait_cond, nullptr); + + m_start_test_callback = nullptr; + m_retry_test_callback = nullptr; } // destroy a lock request. void lock_request::destroy(void) { + invariant(m_state != state::PENDING); + invariant(m_state != state::DESTROYED); + m_state = state::DESTROYED; toku_destroy_dbt(&m_left_key_copy); toku_destroy_dbt(&m_right_key_copy); toku_cond_destroy(&m_wait_cond); @@ -135,7 +142,7 @@ void lock_request::set(locktree *lt, TXNID txnid, const DBT *left_key, const DBT toku_destroy_dbt(&m_right_key_copy); m_type = lock_type; m_state = state::INITIALIZED; - m_info = lt->get_lock_request_info(); + m_info = lt ? lt->get_lock_request_info() : nullptr; m_big_txn = big_txn; } @@ -223,15 +230,18 @@ int lock_request::start(void) { insert_into_lock_requests(); if (deadlock_exists(conflicts)) { remove_from_lock_requests(); - complete(DB_LOCK_DEADLOCK); + r = DB_LOCK_DEADLOCK; } toku_mutex_unlock(&m_info->mutex); - } else { + if (m_start_test_callback) m_start_test_callback(); // test callback + } + + if (r != DB_LOCK_NOTGRANTED) { complete(r); } conflicts.destroy(); - return m_state == state::COMPLETE ? m_complete_r : r; + return r; } // sleep on the lock request until it becomes resolved or the wait time has elapsed. @@ -292,8 +302,8 @@ int lock_request::wait(uint64_t wait_time_ms, uint64_t killed_time_ms, int (*kil // complete this lock request with the given return value void lock_request::complete(int complete_r) { - m_state = state::COMPLETE; m_complete_r = complete_r; + m_state = state::COMPLETE; } const DBT *lock_request::get_left_key(void) const { @@ -331,6 +341,7 @@ int lock_request::retry(void) { if (r == 0) { remove_from_lock_requests(); complete(r); + if (m_retry_test_callback) m_retry_test_callback(); // test callback toku_cond_broadcast(&m_wait_cond); } @@ -416,7 +427,8 @@ void lock_request::remove_from_lock_requests(void) { uint32_t idx; lock_request *request; int r = m_info->pending_lock_requests.find_zero(m_txnid, &request, &idx); - invariant_zero(r && request == this); + invariant_zero(r); + invariant(request == this); r = m_info->pending_lock_requests.delete_at(idx); invariant_zero(r); } @@ -432,4 +444,12 @@ int lock_request::find_by_txnid(lock_request * const &request, const TXNID &txni } } +void lock_request::set_start_test_callback(void (*f)(void)) { + m_start_test_callback = f; +} + +void lock_request::set_retry_test_callback(void (*f)(void)) { + m_retry_test_callback = f; +} + } /* namespace toku */ diff --git a/locktree/lock_request.h b/locktree/lock_request.h index d1a4c2822e0..c504961fcc0 100644 --- a/locktree/lock_request.h +++ b/locktree/lock_request.h @@ -164,6 +164,8 @@ public: // The rest remain pending. static void retry_all_lock_requests(locktree *lt); + void set_start_test_callback(void (*f)(void)); + void set_retry_test_callback(void (*f)(void)); private: enum state { @@ -171,6 +173,7 @@ private: INITIALIZED, PENDING, COMPLETE, + DESTROYED, }; // The keys for a lock request are stored "unowned" in m_left_key @@ -236,6 +239,9 @@ private: static int find_by_txnid(lock_request * const &request, const TXNID &txnid); + void (*m_start_test_callback)(void); + void (*m_retry_test_callback)(void); + friend class lock_request_unit_test; }; ENSURE_POD(lock_request); diff --git a/locktree/locktree.cc b/locktree/locktree.cc index 27e528db8e8..fc2470e98bd 100644 --- a/locktree/locktree.cc +++ b/locktree/locktree.cc @@ -152,6 +152,7 @@ void locktree::create(locktree_manager *mgr, DICTIONARY_ID dict_id, const compar void locktree::destroy(void) { invariant(m_reference_count == 0); + invariant(m_lock_request_info.pending_lock_requests.size() == 0); m_cmp.destroy(); m_rangetree->destroy(); toku_free(m_rangetree); diff --git a/locktree/tests/lock_request_start_retry_race.cc b/locktree/tests/lock_request_start_retry_race.cc new file mode 100644 index 00000000000..0b16e9c5813 --- /dev/null +++ b/locktree/tests/lock_request_start_retry_race.cc @@ -0,0 +1,192 @@ +/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: +#ident "$Id$" +/* +COPYING CONDITIONS NOTICE: + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation, and provided that the + following conditions are met: + + * Redistributions of source code must retain this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below). + + * Redistributions in binary form must reproduce this COPYING + CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the + DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the + PATENT MARKING NOTICE (below), and the PATENT RIGHTS + GRANT (below) in the documentation and/or other materials + provided with the distribution. + + 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 Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +COPYRIGHT NOTICE: + + TokuFT, Tokutek Fractal Tree Indexing Library. + Copyright (C) 2007-2013 Tokutek, Inc. + +DISCLAIMER: + + 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. + +UNIVERSITY PATENT NOTICE: + + The technology is licensed by the Massachusetts Institute of + Technology, Rutgers State University of New Jersey, and the Research + Foundation of State University of New York at Stony Brook under + United States of America Serial No. 11/760379 and to the patents + and/or patent applications resulting from it. + +PATENT MARKING NOTICE: + + This software is covered by US Patent No. 8,185,551. + This software is covered by US Patent No. 8,489,638. + +PATENT RIGHTS GRANT: + + "THIS IMPLEMENTATION" means the copyrightable works distributed by + Tokutek as part of the Fractal Tree project. + + "PATENT CLAIMS" means the claims of patents that are owned or + licensable by Tokutek, both currently or in the future; and that in + the absence of this license would be infringed by THIS + IMPLEMENTATION or by using or running THIS IMPLEMENTATION. + + "PATENT CHALLENGE" shall mean a challenge to the validity, + patentability, enforceability and/or non-infringement of any of the + PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS. + + Tokutek hereby grants to you, for the term and geographical scope of + the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free, + irrevocable (except as stated in this section) patent license to + make, have made, use, offer to sell, sell, import, transfer, and + otherwise run, modify, and propagate the contents of THIS + IMPLEMENTATION, where such license applies only to the PATENT + CLAIMS. This grant does not include claims that would be infringed + only as a consequence of further modifications of THIS + IMPLEMENTATION. If you or your agent or licensee institute or order + or agree to the institution of patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + THIS IMPLEMENTATION constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any rights + granted to you under this License shall terminate as of the date + such litigation is filed. If you or your agent or exclusive + licensee institute or order or agree to the institution of a PATENT + CHALLENGE, then Tokutek may terminate any rights granted to you + under this License. +*/ + +#ident "Copyright (c) 2014 Tokutek Inc. All rights reserved." +#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." + +#include "test.h" +#include "locktree.h" +#include "lock_request.h" + +// Test FT-633, the data race on the lock request between ::start and ::retry +// This test is non-deterministic. It uses sleeps at 2 critical places to +// expose the data race on the lock requests state. + +namespace toku { + +struct locker_arg { + locktree *_lt; + TXNID _id; + const DBT *_key; + + locker_arg(locktree *lt, TXNID id, const DBT *key) : _lt(lt), _id(id), _key(key) { + } +}; + +static void locker_callback(void) { + usleep(10000); +} + +static void run_locker(locktree *lt, TXNID txnid, const DBT *key) { + int i; + for (i = 0; i < 1000; i++) { + + lock_request request; + request.create(); + + request.set(lt, txnid, key, key, lock_request::type::WRITE, false); + + // set the test callbacks + request.set_start_test_callback(locker_callback); + request.set_retry_test_callback(locker_callback); + + // try to acquire the lock + int r = request.start(); + if (r == DB_LOCK_NOTGRANTED) { + // wait for the lock to be granted + r = request.wait(10 * 1000); + } + + if (r == 0) { + // release the lock + range_buffer buffer; + buffer.create(); + buffer.append(key, key); + lt->release_locks(txnid, &buffer); + buffer.destroy(); + + // retry pending lock requests + lock_request::retry_all_lock_requests(lt); + } + + request.destroy(); + memset(&request, 0xab, sizeof request); + + toku_pthread_yield(); + if ((i % 10) == 0) + printf("%lu %d\n", toku_pthread_self(), i); + } +} + +static void *locker(void *v_arg) { + locker_arg *arg = static_cast(v_arg); + run_locker(arg->_lt, arg->_id, arg->_key); + return arg; +} + +} /* namespace toku */ + +int main(void) { + int r; + + toku::locktree lt; + DICTIONARY_ID dict_id = { 1 }; + lt.create(nullptr, dict_id, toku::dbt_comparator); + + const DBT *one = toku::get_dbt(1); + + const int n_workers = 2; + toku_pthread_t ids[n_workers]; + for (int i = 0; i < n_workers; i++) { + toku::locker_arg *arg = new toku::locker_arg(<, i, one); + r = toku_pthread_create(&ids[i], nullptr, toku::locker, arg); + assert_zero(r); + } + for (int i = 0; i < n_workers; i++) { + void *ret; + r = toku_pthread_join(ids[i], &ret); + assert_zero(r); + toku::locker_arg *arg = static_cast(ret); + delete arg; + } + + lt.release_reference(); + lt.destroy(); + return 0; +} + diff --git a/src/ydb_row_lock.cc b/src/ydb_row_lock.cc index 40cafd0e331..dfd5c8e53a2 100644 --- a/src/ydb_row_lock.cc +++ b/src/ydb_row_lock.cc @@ -305,6 +305,7 @@ void toku_db_grab_write_lock (DB *db, DBT *key, TOKUTXN tokutxn) { int r = request.start(); invariant_zero(r); db_txn_note_row_lock(db, txn_anc, key, key); + request.destroy(); } void toku_db_release_lt_key_ranges(DB_TXN *txn, txn_lt_key_ranges *ranges) { From c2660182bb990aaee02cc775dc76230d70d65ee1 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 12 Dec 2014 09:43:31 -0500 Subject: [PATCH 105/201] FT-633 build on osx --- locktree/tests/lock_request_start_retry_race.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locktree/tests/lock_request_start_retry_race.cc b/locktree/tests/lock_request_start_retry_race.cc index 0b16e9c5813..86ef2dd9cc5 100644 --- a/locktree/tests/lock_request_start_retry_race.cc +++ b/locktree/tests/lock_request_start_retry_race.cc @@ -89,6 +89,7 @@ PATENT RIGHTS GRANT: #ident "Copyright (c) 2014 Tokutek Inc. All rights reserved." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." +#include #include "test.h" #include "locktree.h" #include "lock_request.h" @@ -149,7 +150,7 @@ static void run_locker(locktree *lt, TXNID txnid, const DBT *key) { toku_pthread_yield(); if ((i % 10) == 0) - printf("%lu %d\n", toku_pthread_self(), i); + std::cout << toku_pthread_self() << " " << i << std::endl; } } From 4ba6ee1b31b32555b5168746525f6f5958b62c3b Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 12 Dec 2014 10:38:19 -0500 Subject: [PATCH 106/201] MDEV-6891: Update company name --- scripts/mysql_install_db.sh | 4 ++-- win/packaging/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index fcf264262fd..8da092289e9 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -512,8 +512,8 @@ then echo "The latest information about MariaDB is available at http://mariadb.org/." echo "You can find additional information about the MySQL part at:" echo "http://dev.mysql.com" - echo "Support MariaDB development by buying support/new features from" - echo "SkySQL Ab. You can contact us about this at sales@skysql.com". + echo "Support MariaDB development by buying support/new features from MariaDB" + echo "Corporation Ab. You can contact us about this at sales@mariadb.com." echo "Alternatively consider joining our community based development effort:" echo "http://mariadb.com/kb/en/contributing-to-the-mariadb-project/" echo diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index 0b5e2f98f16..95547ac9f3a 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -17,7 +17,7 @@ IF(NOT WIN32) RETURN() ENDIF() -SET(MANUFACTURER "Monty Program AB") +SET(MANUFACTURER "MariaDB Corporation Ab") FIND_PATH(WIX_DIR heat.exe $ENV{WIX_DIR}/bin $ENV{ProgramFiles}/wix/bin From def5bd67ba2071d6834342736aff7da513bdf028 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 12 Dec 2014 10:40:27 -0500 Subject: [PATCH 107/201] MDEV-6891: Update company name --- scripts/mysql_install_db.sh | 4 ++-- win/packaging/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 801fdae5565..0487c311a0d 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -511,8 +511,8 @@ then echo "The latest information about MariaDB is available at http://mariadb.org/." echo "You can find additional information about the MySQL part at:" echo "http://dev.mysql.com" - echo "Support MariaDB development by buying support/new features from" - echo "SkySQL Ab. You can contact us about this at sales@skysql.com". + echo "Support MariaDB development by buying support/new features from MariaDB" + echo "Corporation Ab. You can contact us about this at sales@mariadb.com." echo "Alternatively consider joining our community based development effort:" echo "http://mariadb.com/kb/en/contributing-to-the-mariadb-project/" echo diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt index 0b5e2f98f16..95547ac9f3a 100644 --- a/win/packaging/CMakeLists.txt +++ b/win/packaging/CMakeLists.txt @@ -17,7 +17,7 @@ IF(NOT WIN32) RETURN() ENDIF() -SET(MANUFACTURER "Monty Program AB") +SET(MANUFACTURER "MariaDB Corporation Ab") FIND_PATH(WIX_DIR heat.exe $ENV{WIX_DIR}/bin $ENV{ProgramFiles}/wix/bin From 743e2ae433ca981bab5b2f74438e05d275245c8a Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 12 Dec 2014 17:10:51 -0500 Subject: [PATCH 108/201] MDEV-6891: Addendum, update company name in copyright notice --- include/welcome_copyright_notice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index 875770edb89..956a9f1c17a 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -25,6 +25,6 @@ */ #define ORACLE_WELCOME_COPYRIGHT_NOTICE(first_year) \ "Copyright (c) " first_year ", " COPYRIGHT_NOTICE_CURRENT_YEAR \ - ", Oracle, Monty Program Ab and others.\n" + ", Oracle, MariaDB Corporation Ab and others.\n" #endif /* _welcome_copyright_notice_h_ */ From fc1a7055a3c30dbec6c598bd0fc20ff0f0324174 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 12 Dec 2014 17:13:13 -0500 Subject: [PATCH 109/201] MDEV-6891: Addendum, update company name in copyright notice --- include/welcome_copyright_notice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index ff2d1fea3b1..956a9f1c17a 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -25,6 +25,6 @@ */ #define ORACLE_WELCOME_COPYRIGHT_NOTICE(first_year) \ "Copyright (c) " first_year ", " COPYRIGHT_NOTICE_CURRENT_YEAR \ - ", Oracle, SkySQL Ab and others.\n" + ", Oracle, MariaDB Corporation Ab and others.\n" #endif /* _welcome_copyright_notice_h_ */ From 8761f22a11e3ebe9563b93bb79cb65260b177873 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 14 Dec 2014 22:47:12 +0100 Subject: [PATCH 110/201] - Temporary fix for MDEV-7304. modified: storage/connect/rcmsg.c - Avoid Memory copying when reading an ODBC table when the entire table is already in the result set. modified: storage/connect/odbconn.cpp storage/connect/odbconn.h storage/connect/tabodbc.cpp storage/connect/tabodbc.h --- storage/connect/odbconn.cpp | 22 ++++++++++++++++++---- storage/connect/odbconn.h | 3 ++- storage/connect/rcmsg.c | 3 +++ storage/connect/tabodbc.cpp | 6 +++--- storage/connect/tabodbc.h | 4 ++-- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index e614980a57a..b9cf8054e3a 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -922,6 +922,8 @@ ODBConn::ODBConn(PGLOBAL g, TDBODBC *tdbp) m_Updatable = true; m_Transact = false; m_Scrollable = (tdbp) ? tdbp->Scrollable : false; + m_First = true; + m_Full = false; m_IDQuoteChar[0] = '"'; m_IDQuoteChar[1] = 0; //*m_ErrMsg = '\0'; @@ -1509,6 +1511,16 @@ int ODBConn::Fetch() irc = (rc == SQL_NO_DATA_FOUND) ? 0 : (int)crow; + if (m_First) { + // First fetch. Check whether the full table was read + if ((m_Full = irc < (signed)m_RowsetSize)) { + m_Tdb->Memory = 0; // Not needed anymore + m_Rows = irc; // Table size + } // endif m_Full + + m_First = false; + } // endif m_First + if (m_Tdb->Memory == 1) m_Rows += irc; @@ -2441,12 +2453,13 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g) /***********************************************************************/ int ODBConn::Rewind(char *sql, ODBCCOL *tocols) { - int rc, rbuf = -1; + int rc, rbuf; if (!m_hstmt) - return rbuf; - - if (m_Scrollable) { + rbuf = -1; + else if (m_Full) + rbuf = m_Rows; // No need to "rewind" + else if (m_Scrollable) { SQLULEN crow; try { @@ -2458,6 +2471,7 @@ int ODBConn::Rewind(char *sql, ODBCCOL *tocols) rbuf = (int)crow; } catch(DBX *x) { strcpy(m_G->Message, x->GetErrorMessage(0)); + rbuf = -1; } // end try/catch } else if (ExecDirectSQL(sql, tocols) >= 0) diff --git a/storage/connect/odbconn.h b/storage/connect/odbconn.h index ff8357c4591..021b4fe45fb 100644 --- a/storage/connect/odbconn.h +++ b/storage/connect/odbconn.h @@ -194,5 +194,6 @@ class ODBConn : public BLOCK { bool m_Updatable; bool m_Transact; bool m_Scrollable; - bool m_Memory; + bool m_First; + bool m_Full; }; // end of ODBConn class definition diff --git a/storage/connect/rcmsg.c b/storage/connect/rcmsg.c index abd74d169cc..9eea944c697 100644 --- a/storage/connect/rcmsg.c +++ b/storage/connect/rcmsg.c @@ -31,6 +31,8 @@ char *GetMsgid(int id) { char *p = NULL; + // This conditional until a real fix is found for MDEV-7304 +#if defined(FRENCH) if (!stricmp(msglang(), "french")) switch (id) { #include "frids.h" @@ -40,6 +42,7 @@ char *GetMsgid(int id) } // endswitch(id) else // English +#endif // FRENCH switch (id) { #include "enids.h" #if defined(NEWMSG) diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index 6608083f1b4..ee137187af8 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -95,7 +95,7 @@ ODBCDEF::ODBCDEF(void) { Connect= Tabname= Tabschema= Tabcat= Srcdef= Qchar= Qrystr= Sep= NULL; Catver = Options = Quoted = Maxerr = Maxres = 0; - Scrollable = Xsrc = false; + Scrollable = Memory = Xsrc = false; } // end of ODBCDEF constructor /***********************************************************************/ @@ -880,7 +880,7 @@ int TDBODBC::ReadDB(PGLOBAL g) if (To_Kindex) { // Direct access of ODBC tables is not implemented yet strcpy(g->Message, MSG(NO_ODBC_DIRECT)); - longjmp(g->jumper[g->jump_level], GetAmType()); + return RC_FX; } // endif To_Kindex /*********************************************************************/ @@ -1152,7 +1152,7 @@ void ODBCCOL::ReadColumn(PGLOBAL g) Name, tdbp->Rows, Bufp, Buf_Type, Value->GetCharString(buf)); } // endif Trace -put: + put: if (tdbp->Memory != 2) return; diff --git a/storage/connect/tabodbc.h b/storage/connect/tabodbc.h index da9d373add8..4fa0f2b751c 100644 --- a/storage/connect/tabodbc.h +++ b/storage/connect/tabodbc.h @@ -1,7 +1,7 @@ /*************** Tabodbc H Declares Source Code File (.H) **************/ -/* Name: TABODBC.H Version 1.6 */ +/* Name: TABODBC.H Version 1.7 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2000-2013 */ +/* (C) Copyright to the author Olivier BERTRAND 2000-2014 */ /* */ /* This file contains the TDBODBC classes declares. */ /***********************************************************************/ From 4a32d9c0580d6362cfcd86c6d8f103748946e580 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 15 Dec 2014 11:16:33 +0200 Subject: [PATCH 111/201] MDEV-6871 Multi-value insert on MyISAM table that makes slaves crash (when using --skip-external-locking=0) Problem was that repair() did lock and unlock tables, which leaved already locked tables in wrong state include/my_check_opt.h: Added option T_NO_LOCKS to disable locking during repair() Fixed duplicated bit T_NO_CREATE_RENAME_LSN mysql-test/suite/rpl/r/myisam_external_lock.result: Test case for MDEV-6871 mysql-test/suite/rpl/t/myisam_external_lock-slave.opt: Test case for MDEV-6871 mysql-test/suite/rpl/t/myisam_external_lock.test: Test case for MDEV-6871 storage/maria/ha_maria.cc: Don't lock tables during enable_indexes() Removed some calls to current_thd storage/myisam/ha_myisam.cc: Don't lock tables during enable_indexes() Removed some calls to current_thd --- include/my_check_opt.h | 4 ++- .../suite/rpl/r/myisam_external_lock.result | 12 ++++++++ .../rpl/t/myisam_external_lock-slave.opt | 2 ++ .../suite/rpl/t/myisam_external_lock.test | 24 +++++++++++++++ storage/maria/ha_maria.cc | 28 ++++++++++++----- storage/myisam/ha_myisam.cc | 30 ++++++++++++++----- 6 files changed, 84 insertions(+), 16 deletions(-) create mode 100644 mysql-test/suite/rpl/r/myisam_external_lock.result create mode 100644 mysql-test/suite/rpl/t/myisam_external_lock-slave.opt create mode 100644 mysql-test/suite/rpl/t/myisam_external_lock.test diff --git a/include/my_check_opt.h b/include/my_check_opt.h index abd4f4a96a7..f952792d2c8 100644 --- a/include/my_check_opt.h +++ b/include/my_check_opt.h @@ -63,7 +63,9 @@ extern "C" { #define T_ZEROFILL (1ULL << 32) #define T_ZEROFILL_KEEP_LSN (1ULL << 33) /** If repair should not bump create_rename_lsn */ -#define T_NO_CREATE_RENAME_LSN (1ULL << 33) +#define T_NO_CREATE_RENAME_LSN (1ULL << 34) +/** If repair shouldn't do any locks */ +#define T_NO_LOCKS (1ULL << 35) #define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL) diff --git a/mysql-test/suite/rpl/r/myisam_external_lock.result b/mysql-test/suite/rpl/r/myisam_external_lock.result new file mode 100644 index 00000000000..db23e2cd2d9 --- /dev/null +++ b/mysql-test/suite/rpl/r/myisam_external_lock.result @@ -0,0 +1,12 @@ +include/master-slave.inc +[connection master] +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE `t1` (`col1` int(11) NOT NULL,`col2` int(11) NOT NULL, +PRIMARY KEY (`col1`,`col2`), +KEY `col2` (`col2`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (2775,974),(2775,975),(2775,976),(2778,977),(2778,978),(2782,979),(2790,986),(2790,1139),(2792,840),(2792,984),(2792,989),(2793,982),(2793,992),(2793,993),(2793,994),(2795,323),(2795,332),(2797,980),(2797,997),(2797,998),(2798,1103),(2798,1104),(2799,841),(2799,985),(2799,988),(2833,983),(2833,990),(2833,991),(2834,981),(2834,995),(2834,996),(2835,316),(2835,317),(3007,854),(3007,856),(3008,855),(3008,857),(3009,823),(3009,824),(3014,1),(3015,1),(3016,2),(3017,2),(3018,3),(3019,3),(3024,842),(3024,843),(3024,844),(3025,845),(3025,846),(3025,847),(3040,31),(3041,32),(3042,52),(3042,55),(3043,53),(3043,54),(3044,278),(3044,279),(3044,280),(3044,281),(3044,282),(3044,283),(3044,284),(3044,285),(3045,1),(3046,1),(3049,220),(3050,221),(3050,222),(3051,2),(3052,2),(3053,223),(3054,224),(3055,225),(3056,226),(3057,227),(3058,228),(3059,229),(3060,327),(3066,236),(3067,237),(3068,238),(3069,239),(3070,240),(3080,241),(3081,242),(3082,247),(3083,248),(3084,249),(3085,250),(3086,251),(3087,252),(3088,253),(3089,254),(3090,255),(3091,256),(3092,257),(3093,258),(3094,259),(3096,263),(3097,264),(3100,273),(3100,302),(3101,266),(3102,267),(3103,268),(3104,269),(3105,270),(3111,275),(3112,238),(3113,272),(3115,286),(3116,318),(3116,319),(3117,290),(3117,292),(3118,238),(3119,291),(3119,293),(3120,304),(3121,305),(3122,306),(3123,307),(3124,308),(3125,309),(3126,310),(3127,311),(3128,312),(3128,336),(3129,313),(3129,350),(3130,314),(3131,315),(3131,351),(3132,325),(3132,328),(3134,502),(3138,334),(3139,338),(3139,339),(3140,340),(3140,341),(3141,344),(3141,345),(3142,346),(3142,347),(3149,351),(3149,354),(3150,351),(3150,356),(3152,358),(3152,359),(3153,361),(3153,370),(3154,363),(3154,369),(3156,350),(3156,371),(3159,376),(3160,377),(3160,379),(3160,384),(3161,378),(3161,380),(3161,383),(3162,388),(3162,389),(3162,390),(3169,392),(3169,393),(3169,394),(3170,395),(3170,396),(3170,397),(3171,398),(3171,399),(3171,400),(3172,401),(3172,402),(3172,403),(3173,404),(3173,405),(3173,406),(3178,351),(3178,421),(3190,411),(3190,412),(3191,413),(3191,414),(3192,415),(3192,416),(3193,417),(3193,418),(3194,419),(3194,420),(3195,353),(3195,424),(3196,425),(3196,426),(3197,427),(3197,428),(3198,429),(3198,430),(3199,431),(3199,432),(3200,433),(3200,434),(3201,435),(3201,436),(3202,437),(3202,438),(3203,439),(3203,440),(3204,441),(3204,442),(3205,443),(3205,444),(3206,445),(3206,446),(3207,447),(3207,448),(3208,449),(3208,450),(3209,451),(3209,452),(3210,453),(3210,454),(3211,455),(3211,456),(3212,457),(3212,458),(3213,459),(3213,460),(3214,461),(3214,462),(3215,463),(3215,464),(3218,466),(3218,467),(3218,468),(3219,469),(3219,470),(3219,471),(3220,474),(3220,475),(3220,476),(3221,477),(3221,478),(3221,479),(3222,480),(3222,481),(3223,482),(3223,483),(3224,484),(3224,485),(3225,486),(3225,487),(3227,503),(3227,505),(3228,506),(3228,507),(3230,508),(3230,509),(3231,510),(3231,511),(3232,512),(3232,513),(3233,514),(3233,515),(3234,516),(3234,517),(3235,518),(3235,519),(3237,521),(3237,522),(3239,524),(3239,525),(3240,526),(3240,527),(3241,528),(3241,529),(3242,530),(3242,531),(3243,532),(3243,533),(3244,534),(3244,535),(3245,536),(3245,537),(3246,538),(3246,539),(3252,540),(3252,541),(3254,543),(3254,544),(3254,545),(3255,547),(3255,548),(3255,571),(3256,550),(3256,551),(3256,572),(3257,553),(3257,554),(3257,573),(3258,556),(3258,557),(3258,574),(3259,559),(3259,560),(3259,575),(3260,561),(3260,562),(3260,563),(3261,565),(3261,576),(3262,566),(3262,567),(3263,568),(3263,569),(3263,570),(3264,577),(3264,578),(3265,579),(3265,580),(3266,581),(3266,582),(3266,591),(3267,583),(3267,584),(3267,592),(3268,585),(3268,586),(3268,593),(3269,587),(3269,588),(3269,594),(3270,589),(3270,590),(3271,595),(3271,596),(3271,597),(3272,598),(3272,599),(3273,600),(3273,601),(3273,602),(3274,603),(3274,604),(3274,605),(3275,606),(3275,607),(3275,608),(3276,609),(3276,610),(3276,611),(3277,612),(3277,613),(3277,614),(3278,615),(3278,616),(3279,617),(3279,618),(3279,619),(3279,628),(3279,629),(3280,620),(3280,621),(3280,622),(3281,623),(3281,624),(3281,625),(3282,626),(3282,825),(3283,630),(3283,631),(3284,632),(3284,633),(3284,634),(3285,635),(3285,940),(3286,638),(3286,639),(3286,640),(3287,641),(3287,642),(3287,643),(3288,644),(3288,645),(3288,646),(3289,647),(3289,648),(3289,649),(3290,650),(3290,651),(3290,652),(3291,653),(3291,654),(3291,655),(3292,656),(3292,657),(3292,658),(3293,659),(3293,660),(3293,661),(3294,662),(3294,663),(3294,664),(3295,665),(3295,666),(3295,667),(3296,668),(3296,669),(3296,670),(3297,671),(3297,672),(3297,673),(3298,674),(3298,675),(3298,676),(3299,677),(3299,678),(3299,679),(3300,680),(3300,681),(3300,682),(3301,683),(3301,684),(3301,685),(3302,686),(3302,687),(3302,688),(3303,689),(3303,690),(3303,691),(3304,692),(3304,693),(3304,694),(3305,695),(3305,696),(3305,697),(3306,698),(3306,699),(3306,700),(3307,701),(3307,702),(3307,703),(3308,704),(3308,705),(3308,706),(3309,707),(3309,708),(3310,709),(3310,710),(3311,711),(3311,712),(3311,713),(3312,714),(3312,715),(3312,716),(3313,717),(3313,1167),(3314,720),(3314,721),(3314,722),(3315,723),(3315,724),(3315,725),(3316,726),(3316,727),(3316,728),(3317,729),(3317,730),(3317,731),(3318,732),(3318,733),(3318,734),(3319,735),(3319,736),(3319,737),(3320,738),(3320,739),(3320,740),(3321,741),(3321,742),(3322,743),(3322,744),(3323,745),(3323,746),(3323,747),(3324,748),(3324,749),(3324,750),(3325,751),(3325,752),(3325,753),(3326,754),(3326,755),(3327,756),(3327,757),(3328,758),(3328,789),(3329,761),(3329,790),(3330,762),(3330,763),(3331,768),(3331,785),(3331,786),(3332,769),(3332,783),(3332,784),(3335,766),(3336,767),(3343,770),(3343,771),(3344,772),(3344,773),(3345,774),(3345,775),(3347,776),(3347,777),(3347,987),(3348,778),(3348,779),(3349,780),(3372,781),(3372,782),(3373,787),(3373,788),(3376,791),(3376,792),(3377,793),(3377,794),(3378,799),(3378,800),(3379,801),(3379,802),(3380,795),(3380,796),(3381,797),(3381,798),(3383,805),(3384,806),(3384,807),(3385,808),(3385,809),(3386,810),(3386,811),(3387,812),(3387,814),(3388,815),(3388,816),(3391,817),(3391,818),(3391,819),(3392,820),(3392,821),(3392,822),(3393,826),(3393,827),(3394,828),(3394,829),(3395,830),(3395,831),(3396,834),(3396,835),(3397,832),(3397,833),(3398,836),(3398,837),(3399,838),(3399,839),(3410,850),(3410,851),(3411,852),(3411,853),(3412,848),(3412,849),(3419,860),(3419,951),(3420,859),(3420,861),(3422,862),(3422,863),(3423,864),(3423,865),(3424,866),(3424,867),(3424,872),(3424,873),(3425,868),(3425,869),(3425,874),(3425,875),(3426,878),(3426,879),(3427,876),(3427,877),(3428,880),(3432,884),(3432,885),(3432,886),(3434,887),(3434,888),(3434,889),(3441,894),(3441,895),(3442,896),(3442,897),(3444,904),(3445,905),(3449,906),(3449,907),(3450,908),(3450,909),(3453,910),(3458,915),(3458,916),(3459,917),(3459,918),(3463,919),(3463,920),(3485,929),(3486,930),(3487,931),(3488,932),(3489,933),(3493,2),(3494,2),(3501,934),(3502,936),(3503,938),(3504,939),(3505,941),(3506,942),(3507,943),(3508,944),(3509,945),(3510,946),(3511,947),(3512,948),(3514,949),(3514,950),(3515,953),(3516,954),(3517,955),(3518,956),(3519,957),(3520,958),(3521,959),(3527,960),(3527,965),(3528,961),(3528,962),(3529,963),(3529,964),(3530,966),(3530,967),(3531,968),(3531,969),(3535,970),(3535,971),(3536,972),(3536,973),(3540,999),(3540,1000),(3541,1001),(8888,9999); +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/myisam_external_lock-slave.opt b/mysql-test/suite/rpl/t/myisam_external_lock-slave.opt new file mode 100644 index 00000000000..db53e17d4b3 --- /dev/null +++ b/mysql-test/suite/rpl/t/myisam_external_lock-slave.opt @@ -0,0 +1,2 @@ +--log-slave-updates=0 +--skip_external_locking=0 diff --git a/mysql-test/suite/rpl/t/myisam_external_lock.test b/mysql-test/suite/rpl/t/myisam_external_lock.test new file mode 100644 index 00000000000..14824fd8321 --- /dev/null +++ b/mysql-test/suite/rpl/t/myisam_external_lock.test @@ -0,0 +1,24 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +# +# MDEV-6871 Multi-value insert on MyISAM table that makes slaves crash +# This only happens if external_lock is enabled +# + +drop table if exists t1; +CREATE TABLE `t1` (`col1` int(11) NOT NULL,`col2` int(11) NOT NULL, + PRIMARY KEY (`col1`,`col2`), + KEY `col2` (`col2`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (2775,974),(2775,975),(2775,976),(2778,977),(2778,978),(2782,979),(2790,986),(2790,1139),(2792,840),(2792,984),(2792,989),(2793,982),(2793,992),(2793,993),(2793,994),(2795,323),(2795,332),(2797,980),(2797,997),(2797,998),(2798,1103),(2798,1104),(2799,841),(2799,985),(2799,988),(2833,983),(2833,990),(2833,991),(2834,981),(2834,995),(2834,996),(2835,316),(2835,317),(3007,854),(3007,856),(3008,855),(3008,857),(3009,823),(3009,824),(3014,1),(3015,1),(3016,2),(3017,2),(3018,3),(3019,3),(3024,842),(3024,843),(3024,844),(3025,845),(3025,846),(3025,847),(3040,31),(3041,32),(3042,52),(3042,55),(3043,53),(3043,54),(3044,278),(3044,279),(3044,280),(3044,281),(3044,282),(3044,283),(3044,284),(3044,285),(3045,1),(3046,1),(3049,220),(3050,221),(3050,222),(3051,2),(3052,2),(3053,223),(3054,224),(3055,225),(3056,226),(3057,227),(3058,228),(3059,229),(3060,327),(3066,236),(3067,237),(3068,238),(3069,239),(3070,240),(3080,241),(3081,242),(3082,247),(3083,248),(3084,249),(3085,250),(3086,251),(3087,252),(3088,253),(3089,254),(3090,255),(3091,256),(3092,257),(3093,258),(3094,259),(3096,263),(3097,264),(3100,273),(3100,302),(3101,266),(3102,267),(3103,268),(3104,269),(3105,270),(3111,275),(3112,238),(3113,272),(3115,286),(3116,318),(3116,319),(3117,290),(3117,292),(3118,238),(3119,291),(3119,293),(3120,304),(3121,305),(3122,306),(3123,307),(3124,308),(3125,309),(3126,310),(3127,311),(3128,312),(3128,336),(3129,313),(3129,350),(3130,314),(3131,315),(3131,351),(3132,325),(3132,328),(3134,502),(3138,334),(3139,338),(3139,339),(3140,340),(3140,341),(3141,344),(3141,345),(3142,346),(3142,347),(3149,351),(3149,354),(3150,351),(3150,356),(3152,358),(3152,359),(3153,361),(3153,370),(3154,363),(3154,369),(3156,350),(3156,371),(3159,376),(3160,377),(3160,379),(3160,384),(3161,378),(3161,380),(3161,383),(3162,388),(3162,389),(3162,390),(3169,392),(3169,393),(3169,394),(3170,395),(3170,396),(3170,397),(3171,398),(3171,399),(3171,400),(3172,401),(3172,402),(3172,403),(3173,404),(3173,405),(3173,406),(3178,351),(3178,421),(3190,411),(3190,412),(3191,413),(3191,414),(3192,415),(3192,416),(3193,417),(3193,418),(3194,419),(3194,420),(3195,353),(3195,424),(3196,425),(3196,426),(3197,427),(3197,428),(3198,429),(3198,430),(3199,431),(3199,432),(3200,433),(3200,434),(3201,435),(3201,436),(3202,437),(3202,438),(3203,439),(3203,440),(3204,441),(3204,442),(3205,443),(3205,444),(3206,445),(3206,446),(3207,447),(3207,448),(3208,449),(3208,450),(3209,451),(3209,452),(3210,453),(3210,454),(3211,455),(3211,456),(3212,457),(3212,458),(3213,459),(3213,460),(3214,461),(3214,462),(3215,463),(3215,464),(3218,466),(3218,467),(3218,468),(3219,469),(3219,470),(3219,471),(3220,474),(3220,475),(3220,476),(3221,477),(3221,478),(3221,479),(3222,480),(3222,481),(3223,482),(3223,483),(3224,484),(3224,485),(3225,486),(3225,487),(3227,503),(3227,505),(3228,506),(3228,507),(3230,508),(3230,509),(3231,510),(3231,511),(3232,512),(3232,513),(3233,514),(3233,515),(3234,516),(3234,517),(3235,518),(3235,519),(3237,521),(3237,522),(3239,524),(3239,525),(3240,526),(3240,527),(3241,528),(3241,529),(3242,530),(3242,531),(3243,532),(3243,533),(3244,534),(3244,535),(3245,536),(3245,537),(3246,538),(3246,539),(3252,540),(3252,541),(3254,543),(3254,544),(3254,545),(3255,547),(3255,548),(3255,571),(3256,550),(3256,551),(3256,572),(3257,553),(3257,554),(3257,573),(3258,556),(3258,557),(3258,574),(3259,559),(3259,560),(3259,575),(3260,561),(3260,562),(3260,563),(3261,565),(3261,576),(3262,566),(3262,567),(3263,568),(3263,569),(3263,570),(3264,577),(3264,578),(3265,579),(3265,580),(3266,581),(3266,582),(3266,591),(3267,583),(3267,584),(3267,592),(3268,585),(3268,586),(3268,593),(3269,587),(3269,588),(3269,594),(3270,589),(3270,590),(3271,595),(3271,596),(3271,597),(3272,598),(3272,599),(3273,600),(3273,601),(3273,602),(3274,603),(3274,604),(3274,605),(3275,606),(3275,607),(3275,608),(3276,609),(3276,610),(3276,611),(3277,612),(3277,613),(3277,614),(3278,615),(3278,616),(3279,617),(3279,618),(3279,619),(3279,628),(3279,629),(3280,620),(3280,621),(3280,622),(3281,623),(3281,624),(3281,625),(3282,626),(3282,825),(3283,630),(3283,631),(3284,632),(3284,633),(3284,634),(3285,635),(3285,940),(3286,638),(3286,639),(3286,640),(3287,641),(3287,642),(3287,643),(3288,644),(3288,645),(3288,646),(3289,647),(3289,648),(3289,649),(3290,650),(3290,651),(3290,652),(3291,653),(3291,654),(3291,655),(3292,656),(3292,657),(3292,658),(3293,659),(3293,660),(3293,661),(3294,662),(3294,663),(3294,664),(3295,665),(3295,666),(3295,667),(3296,668),(3296,669),(3296,670),(3297,671),(3297,672),(3297,673),(3298,674),(3298,675),(3298,676),(3299,677),(3299,678),(3299,679),(3300,680),(3300,681),(3300,682),(3301,683),(3301,684),(3301,685),(3302,686),(3302,687),(3302,688),(3303,689),(3303,690),(3303,691),(3304,692),(3304,693),(3304,694),(3305,695),(3305,696),(3305,697),(3306,698),(3306,699),(3306,700),(3307,701),(3307,702),(3307,703),(3308,704),(3308,705),(3308,706),(3309,707),(3309,708),(3310,709),(3310,710),(3311,711),(3311,712),(3311,713),(3312,714),(3312,715),(3312,716),(3313,717),(3313,1167),(3314,720),(3314,721),(3314,722),(3315,723),(3315,724),(3315,725),(3316,726),(3316,727),(3316,728),(3317,729),(3317,730),(3317,731),(3318,732),(3318,733),(3318,734),(3319,735),(3319,736),(3319,737),(3320,738),(3320,739),(3320,740),(3321,741),(3321,742),(3322,743),(3322,744),(3323,745),(3323,746),(3323,747),(3324,748),(3324,749),(3324,750),(3325,751),(3325,752),(3325,753),(3326,754),(3326,755),(3327,756),(3327,757),(3328,758),(3328,789),(3329,761),(3329,790),(3330,762),(3330,763),(3331,768),(3331,785),(3331,786),(3332,769),(3332,783),(3332,784),(3335,766),(3336,767),(3343,770),(3343,771),(3344,772),(3344,773),(3345,774),(3345,775),(3347,776),(3347,777),(3347,987),(3348,778),(3348,779),(3349,780),(3372,781),(3372,782),(3373,787),(3373,788),(3376,791),(3376,792),(3377,793),(3377,794),(3378,799),(3378,800),(3379,801),(3379,802),(3380,795),(3380,796),(3381,797),(3381,798),(3383,805),(3384,806),(3384,807),(3385,808),(3385,809),(3386,810),(3386,811),(3387,812),(3387,814),(3388,815),(3388,816),(3391,817),(3391,818),(3391,819),(3392,820),(3392,821),(3392,822),(3393,826),(3393,827),(3394,828),(3394,829),(3395,830),(3395,831),(3396,834),(3396,835),(3397,832),(3397,833),(3398,836),(3398,837),(3399,838),(3399,839),(3410,850),(3410,851),(3411,852),(3411,853),(3412,848),(3412,849),(3419,860),(3419,951),(3420,859),(3420,861),(3422,862),(3422,863),(3423,864),(3423,865),(3424,866),(3424,867),(3424,872),(3424,873),(3425,868),(3425,869),(3425,874),(3425,875),(3426,878),(3426,879),(3427,876),(3427,877),(3428,880),(3432,884),(3432,885),(3432,886),(3434,887),(3434,888),(3434,889),(3441,894),(3441,895),(3442,896),(3442,897),(3444,904),(3445,905),(3449,906),(3449,907),(3450,908),(3450,909),(3453,910),(3458,915),(3458,916),(3459,917),(3459,918),(3463,919),(3463,920),(3485,929),(3486,930),(3487,931),(3488,932),(3489,933),(3493,2),(3494,2),(3501,934),(3502,936),(3503,938),(3504,939),(3505,941),(3506,942),(3507,943),(3508,944),(3509,945),(3510,946),(3511,947),(3512,948),(3514,949),(3514,950),(3515,953),(3516,954),(3517,955),(3518,956),(3519,957),(3520,958),(3521,959),(3527,960),(3527,965),(3528,961),(3528,962),(3529,963),(3529,964),(3530,966),(3530,967),(3531,968),(3531,969),(3535,970),(3535,971),(3536,972),(3536,973),(3540,999),(3540,1000),(3541,1001),(8888,9999); + +drop table t1; + +save_master_pos; +connection slave; +sync_with_master; + +connection master; + +--source include/rpl_end.inc diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 2cafdecc4b1..38ee0758611 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1554,6 +1554,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) MARIA_SHARE *share= file->s; ha_rows rows= file->state->records; TRN *old_trn= file->trn; + my_bool locking= 0; DBUG_ENTER("ha_maria::repair"); /* @@ -1589,12 +1590,18 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) param->out_flag= 0; strmov(fixed_name, share->open_file_name.str); - // Don't lock tables if we have used LOCK TABLE - if (!thd->locked_tables_mode && - maria_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK)) + /* + Don't lock tables if we have used LOCK TABLE or if we come from + enable_index() + */ + if (!thd->locked_tables_mode && ! (param->testflag & T_NO_LOCKS)) { - _ma_check_print_error(param, ER(ER_CANT_LOCK), my_errno); - DBUG_RETURN(HA_ADMIN_FAILED); + locking= 1; + if (maria_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK)) + { + _ma_check_print_error(param, ER(ER_CANT_LOCK), my_errno); + DBUG_RETURN(HA_ADMIN_FAILED); + } } if (!do_optimize || @@ -1726,7 +1733,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) mysql_mutex_unlock(&share->intern_lock); thd_proc_info(thd, old_proc_info); thd_progress_end(thd); // Mark done - if (!thd->locked_tables_mode) + if (locking) maria_lock_database(file, F_UNLCK); /* Reset trn, that may have been set by repair */ @@ -1960,6 +1967,13 @@ int ha_maria::enable_indexes(uint mode) param.op_name= "recreating_index"; param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK | T_CREATE_MISSING_KEYS | T_SAFE_REPAIR); + /* + Don't lock and unlock table if it's locked. + Normally table should be locked. This test is mostly for safety. + */ + if (likely(file->lock_type != F_UNLCK)) + param.testflag|= T_NO_LOCKS; + if (bulk_insert_single_undo == BULK_INSERT_SINGLE_UNDO_AND_NO_REPAIR) { bulk_insert_single_undo= BULK_INSERT_SINGLE_UNDO_AND_REPAIR; @@ -2199,7 +2213,7 @@ bool ha_maria::check_and_repair(THD *thd) { /* Remove error about crashed table */ thd->warning_info->clear_warning_info(thd->query_id); - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_CRASHED_ON_USAGE, "Zerofilling moved table %s", table->s->path.str); sql_print_information("Zerofilling moved table: '%s'", diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 7cb5ae02e6d..a2e62d8ae1e 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1068,6 +1068,7 @@ int ha_myisam::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) char fixed_name[FN_REFLEN]; MYISAM_SHARE* share = file->s; ha_rows rows= file->state->records; + my_bool locking= 0; DBUG_ENTER("ha_myisam::repair"); param.db_name= table->s->db.str; @@ -1081,12 +1082,18 @@ int ha_myisam::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) // Release latches since this can take a long time ha_release_temporary_latches(thd); - // Don't lock tables if we have used LOCK TABLE - if (! thd->locked_tables_mode && - mi_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK)) + /* + Don't lock tables if we have used LOCK TABLE or if we come from + enable_index() + */ + if (!thd->locked_tables_mode && ! (param.testflag & T_NO_LOCKS)) { - mi_check_print_error(¶m,ER(ER_CANT_LOCK),my_errno); - DBUG_RETURN(HA_ADMIN_FAILED); + locking= 1; + if (mi_lock_database(file, table->s->tmp_table ? F_EXTRA_LCK : F_WRLCK)) + { + mi_check_print_error(¶m,ER(ER_CANT_LOCK),my_errno); + DBUG_RETURN(HA_ADMIN_FAILED); + } } if (!do_optimize || @@ -1205,7 +1212,7 @@ int ha_myisam::repair(THD *thd, HA_CHECK ¶m, bool do_optimize) update_state_info(¶m, file, 0); } thd_proc_info(thd, old_proc_info); - if (! thd->locked_tables_mode) + if (locking) mi_lock_database(file,F_UNLCK); DBUG_RETURN(error ? HA_ADMIN_FAILED : !optimize_done ? HA_ADMIN_ALREADY_DONE : HA_ADMIN_OK); @@ -1437,6 +1444,13 @@ int ha_myisam::enable_indexes(uint mode) param.op_name= "recreating_index"; param.testflag= (T_SILENT | T_REP_BY_SORT | T_QUICK | T_CREATE_MISSING_KEYS); + /* + Don't lock and unlock table if it's locked. + Normally table should be locked. This test is mostly for safety. + */ + if (likely(file->lock_type != F_UNLCK)) + param.testflag|= T_NO_LOCKS; + param.myf_rw&= ~MY_WAIT_IF_FULL; param.sort_buffer_length= THDVAR(thd, sort_buffer_size); param.stats_method= (enum_handler_stats_method)THDVAR(thd, stats_method); @@ -1515,7 +1529,7 @@ int ha_myisam::indexes_are_disabled(void) void ha_myisam::start_bulk_insert(ha_rows rows) { DBUG_ENTER("ha_myisam::start_bulk_insert"); - THD *thd= current_thd; + THD *thd= table->in_use; ulong size= min(thd->variables.read_buff_size, (ulong) (table->s->avg_row_length*rows)); DBUG_PRINT("info",("start_bulk_insert: rows %lu size %lu", @@ -1589,7 +1603,7 @@ int ha_myisam::end_bulk_insert() */ if (((err= enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE)) != 0) && - current_thd->killed) + table->in_use->killed) { delete_all_rows(); /* not crashed, despite being killed during repair */ From 80ee57a30ac9f4692c57ba3b02ce364cc9fcbfe9 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 15 Dec 2014 13:01:11 +0200 Subject: [PATCH 112/201] MDEV-6896 kill user command cause MariaDB crash mysql-test/r/kill-2.result: test case for MDEV-6896 mysql-test/t/kill-2-master.opt: test case for MDEV-6896 mysql-test/t/kill-2.test: test case for MDEV-6896 sql/sql_parse.cc: Use host_or_ip instead of host as host may be 0 --- mysql-test/r/kill-2.result | 10 ++++++++++ mysql-test/t/kill-2-master.opt | 1 + mysql-test/t/kill-2.test | 29 +++++++++++++++++++++++++++++ sql/sql_parse.cc | 2 +- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/kill-2.result create mode 100644 mysql-test/t/kill-2-master.opt create mode 100644 mysql-test/t/kill-2.test diff --git a/mysql-test/r/kill-2.result b/mysql-test/r/kill-2.result new file mode 100644 index 00000000000..c2bcc979441 --- /dev/null +++ b/mysql-test/r/kill-2.result @@ -0,0 +1,10 @@ +# +# MDEV-6896 kill user command cause MariaDB crash! +# +create user foo@'127.0.0.1'; +select user from information_schema.processlist; +user +foo +root +kill user foo@'127.0.0.1'; +drop user foo@'127.0.0.1'; diff --git a/mysql-test/t/kill-2-master.opt b/mysql-test/t/kill-2-master.opt new file mode 100644 index 00000000000..ab6ca1731f5 --- /dev/null +++ b/mysql-test/t/kill-2-master.opt @@ -0,0 +1 @@ +--skip-name-resolve diff --git a/mysql-test/t/kill-2.test b/mysql-test/t/kill-2.test new file mode 100644 index 00000000000..0c1177722b4 --- /dev/null +++ b/mysql-test/t/kill-2.test @@ -0,0 +1,29 @@ +# +# Test KILL and KILL QUERY statements. +# +# Killing a connection in an embedded server does not work like in a normal +# server, if it is waiting for a new statement. In an embedded server, the +# connection does not read() from a socket, but returns control to the +# application. 'mysqltest' does not handle the kill request. +# + +-- source include/not_embedded.inc +-- source include/not_threadpool.inc + +--echo # +--echo # MDEV-6896 kill user command cause MariaDB crash! +--echo # + +create user foo@'127.0.0.1'; + +--connect (con1,127.0.0.1,foo,,) + +--connection default +select user from information_schema.processlist; +kill user foo@'127.0.0.1'; + +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where user = "foo"; +--source include/wait_condition.inc +drop user foo@'127.0.0.1'; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0fe3c5b90ea..c21e7fa3e4b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6745,7 +6745,7 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user, host.str[0] == '%' means that host name was not given. See sql_yacc.yy */ if (((user->host.str[0] == '%' && !user->host.str[1]) || - !strcmp(tmp->security_ctx->host, user->host.str)) && + !strcmp(tmp->security_ctx->host_or_ip, user->host.str)) && !strcmp(tmp->security_ctx->user, user->user.str)) { if (!(thd->security_ctx->master_access & SUPER_ACL) && From 10ab3e68876bc7a16a6a2108a445f38778fa3df4 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 15 Dec 2014 14:49:23 +0200 Subject: [PATCH 113/201] MDEV-4010 Deadlock on concurrent INSERT .. SELECT into an Aria table with statement binary logging There was a bug in lock handling when mixing INSERT ... SELECT on the same table. mysql-test/suite/maria/insert_select.result: Test case for MDEV_4010 mysql-test/suite/maria/insert_select.test: Test case for MDEV_4010 mysys/thr_lock.c: We wrongly alldoed TL_WRITE_CONCURRENT_INSERT when there was a TL_READ_NO_INSERT lock --- mysql-test/suite/maria/insert_select.result | 6 ++++++ mysql-test/suite/maria/insert_select.test | 21 +++++++++++++++++++++ mysys/thr_lock.c | 16 +++++++++------- 3 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 mysql-test/suite/maria/insert_select.result create mode 100644 mysql-test/suite/maria/insert_select.test diff --git a/mysql-test/suite/maria/insert_select.result b/mysql-test/suite/maria/insert_select.result new file mode 100644 index 00000000000..878914ddabf --- /dev/null +++ b/mysql-test/suite/maria/insert_select.result @@ -0,0 +1,6 @@ +create table t1 (pk int primary key) engine=Aria; +insert into t1 values (1); +insert into t1 select sleep(2)+1 from t1; +insert into t1 select 2 from t1; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +drop table t1; diff --git a/mysql-test/suite/maria/insert_select.test b/mysql-test/suite/maria/insert_select.test new file mode 100644 index 00000000000..a86edc7d857 --- /dev/null +++ b/mysql-test/suite/maria/insert_select.test @@ -0,0 +1,21 @@ +# +# MDEV-4010 +# Deadlock on concurrent INSERT .. SELECT into an Aria table with statement +# binary logging +# +--source include/have_binlog_format_statement.inc + +create table t1 (pk int primary key) engine=Aria; +insert into t1 values (1); + +send insert into t1 select sleep(2)+1 from t1; + +--connect (con1,localhost,root,,) + +insert into t1 select 2 from t1; + +--connection default +--error 1062 +--reap +--disconnect con1 +drop table t1; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index a7cbfa07db2..890140fc34f 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -325,7 +325,7 @@ static void check_locks(THR_LOCK *lock, const char *where, found_errors++; fprintf(stderr, "Warning at '%s': Write lock %d waiting while no exclusive read locks\n",where,(int) lock->write_wait.data->type); - DBUG_PRINT("warning", ("Warning at '%s': Write lock %d waiting while no exclusive read locks\n",where,(int) lock->write_wait.data->type)); + DBUG_PRINT("warning", ("Warning at '%s': Write lock %d waiting while no exclusive read locks",where,(int) lock->write_wait.data->type)); } } } @@ -345,7 +345,7 @@ static void check_locks(THR_LOCK *lock, const char *where, fprintf(stderr, "Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write lock: %d\n", where, data->type); - DBUG_PRINT("warning", ("Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write lock: %d\n", + DBUG_PRINT("warning", ("Warning at '%s': Found TL_WRITE_CONCURRENT_INSERT lock mixed with other write lock: %d", where, data->type)); break; } @@ -361,7 +361,7 @@ static void check_locks(THR_LOCK *lock, const char *where, fprintf(stderr, "Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock\n", where); - DBUG_PRINT("warning", ("Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock\n", + DBUG_PRINT("warning", ("Warning at '%s': Found WRITE_ALLOW_WRITE lock waiting for WRITE_ALLOW_WRITE lock", where)); } @@ -384,7 +384,7 @@ static void check_locks(THR_LOCK *lock, const char *where, "Warning at '%s' for lock: %d: Found lock of type %d that is write and read locked. Read_no_write_count: %d\n", where, (int) type, lock->write.data->type, lock->read_no_write_count); - DBUG_PRINT("warning",("At '%s' for lock %d: Found lock of type %d that is write and read locked\n", + DBUG_PRINT("warning",("At '%s' for lock %d: Found lock of type %d that is write and read locked", where, (int) type, lock->write.data->type)); } @@ -794,7 +794,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout) The idea is to allow us to get a lock at once if we already have a write lock or if there is no pending write locks and if all write locks are of the same type and are either - TL_WRITE_ALLOW_WRITE or TL_WRITE_CONCURRENT_INSERT + TL_WRITE_ALLOW_WRITE or TL_WRITE_CONCURRENT_INSERT and + there is no TL_READ_NO_INSERT lock. Note that, since lock requests for the same table are sorted in such way that requests with higher thr_lock_type value come first @@ -811,7 +812,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout) situation. **) The exceptions are situations when: - when old lock type is TL_WRITE_DELAYED - But these should never happen within MySQL. + But these should never happen within MariaDB. Therefore it is OK to allow acquiring write lock on the table if this thread already holds some write lock on it. @@ -829,7 +830,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout) (lock_type == TL_WRITE_CONCURRENT_INSERT && lock->allow_multiple_concurrent_insert)) && ! lock->write_wait.data && - lock->write.data->type == lock_type) || + lock->write.data->type == lock_type && + ! lock->read_no_write_count) || has_old_lock(lock->write.data, data->owner)) { DBUG_PRINT("info", ("write_wait.data: 0x%lx old_type: %d", From 5257d71e0e495216162b790efc6866027aa2b718 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 15 Dec 2014 17:13:47 +0200 Subject: [PATCH 114/201] MDEV-6855 Assertion `cond_type == Item::FUNC_ITEM' failed in check_group_min_max_predicates with GROUP BY, aggregate in WHERE SQ, multi-part key mysql-test/r/group_by.result: Test for MDEV-6855 mysql-test/t/group_by.test: Test for MDEV-6855 sql/item.h: Fixed spelling error sql/opt_range.cc: Added handling of cond_type == Item::CACHE_ITEM in WHERE clauses for MIN/MAX optimization. Fixed indentation --- mysql-test/r/group_by.result | 14 ++++++++++++++ mysql-test/t/group_by.test | 15 +++++++++++++++ sql/item.h | 2 +- sql/opt_range.cc | 30 ++++++++++++++++++++---------- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 57f21a5e0eb..32f7d61319b 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2493,3 +2493,17 @@ SELECT i2 FROM t1 AS t1a STRAIGHT_JOIN ( t2 INNER JOIN t1 AS t1b ON (t1b.c1 = c2 WHERE t1a.c1 = c2 GROUP BY i2; i2 DROP TABLE t1,t2; +# +# MDEV-6855 +# MIN(*) with subqueries with IS NOT NULL in WHERE clause crashed. +# +CREATE TABLE t1 (i INT, c VARCHAR(3), KEY(c,i)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (7,'foo'),(0,'bar'); +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (0),(8),(1),(8),(9); +SELECT MAX(i), c FROM t1 +WHERE c != 'qux' AND ( SELECT SUM(j) FROM t1, t2 ) IS NOT NULL GROUP BY c; +MAX(i) c +0 bar +7 foo +drop table t1,t2; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 92d1c18ee13..a1f7f693c21 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1665,6 +1665,21 @@ WHERE t1a.c1 = c2 GROUP BY i2; DROP TABLE t1,t2; +--echo # +--echo # MDEV-6855 +--echo # MIN(*) with subqueries with IS NOT NULL in WHERE clause crashed. +--echo # + +CREATE TABLE t1 (i INT, c VARCHAR(3), KEY(c,i)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (7,'foo'),(0,'bar'); + +CREATE TABLE t2 (j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (0),(8),(1),(8),(9); + +SELECT MAX(i), c FROM t1 +WHERE c != 'qux' AND ( SELECT SUM(j) FROM t1, t2 ) IS NOT NULL GROUP BY c; +drop table t1,t2; + # # End of MariaDB 5.5 tests # diff --git a/sql/item.h b/sql/item.h index 57e91e5b3d8..ed50605ef7b 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4038,7 +4038,7 @@ private: /** @todo Implement the is_null() method for this class. Currently calling is_null() - on any Item_cache object resolves to Item::is_null(), which reutns FALSE + on any Item_cache object resolves to Item::is_null(), which returns FALSE for any value. */ diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 04481b39d2f..17b24aa70fd 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -12539,12 +12539,13 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) SYNOPSIS check_group_min_max_predicates() - cond [in] the expression tree being analyzed - min_max_arg [in] the field referenced by the MIN/MAX function(s) - image_type [in] - has_min_max_arg [out] true if the subtree being analyzed references min_max_arg - has_other_arg [out] true if the subtree being analyzed references a column - other min_max_arg + cond [in] the expression tree being analyzed + min_max_arg [in] the field referenced by the MIN/MAX function(s) + image_type [in] + has_min_max_arg [out] true if the subtree being analyzed references + min_max_arg + has_other_arg [out] true if the subtree being analyzed references a + column other min_max_arg DESCRIPTION The function walks recursively over the cond tree representing a WHERE @@ -12588,7 +12589,7 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item, (2) the subtree passes the test, but it is an OR and it references both the min/max argument and other columns. */ - if (!check_group_min_max_predicates(and_or_arg, min_max_arg_item, //1 + if (!check_group_min_max_predicates(and_or_arg, min_max_arg_item, //1 image_type, &has_min_max, &has_other) || (func_type == Item_func::COND_OR_FUNC && has_min_max && has_other))//2 @@ -12604,7 +12605,7 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item, a subquery in the WHERE clause. */ - if (cond_type == Item::SUBSELECT_ITEM) + if (unlikely(cond_type == Item::SUBSELECT_ITEM)) { Item_subselect *subs_cond= (Item_subselect*) cond; if (subs_cond->is_correlated) @@ -12621,7 +12622,14 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item, } DBUG_RETURN(TRUE); } - + /* + Subquery with IS [NOT] NULL + TODO: Look into the cache_item and optimize it like we do for + subselect's above + */ + if (unlikely(cond_type == Item::CACHE_ITEM)) + DBUG_RETURN(cond->const_item()); + /* Condition of the form 'field' is equivalent to 'field <> 0' and thus satisfies the SA3 condition. @@ -12638,7 +12646,9 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item, /* We presume that at this point there are no other Items than functions. */ DBUG_ASSERT(cond_type == Item::FUNC_ITEM); - + if (unlikely(cond_type != Item::FUNC_ITEM)) /* Safety */ + DBUG_RETURN(FALSE); + /* Test if cond references only group-by or non-group fields. */ Item_func *pred= (Item_func*) cond; Item_func::Functype pred_type= pred->functype(); From 8e193934c0938a34547481ae92556eef72f99df3 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Mon, 15 Dec 2014 16:02:10 -0500 Subject: [PATCH 115/201] FT-635 count the number of deleted leaf entries that are skipped by a cursor search Conflicts: ft/ft-ops.cc --- ft/ft-internal.h | 1 + ft/ft-ops.cc | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ft/ft-internal.h b/ft/ft-internal.h index 3cd39705571..88fc5dca686 100644 --- a/ft/ft-internal.h +++ b/ft/ft-internal.h @@ -616,6 +616,7 @@ typedef enum { FT_PRO_RIGHTMOST_LEAF_SHORTCUT_SUCCESS, FT_PRO_RIGHTMOST_LEAF_SHORTCUT_FAIL_POS, FT_PRO_RIGHTMOST_LEAF_SHORTCUT_FAIL_REACTIVE, + FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, // how many deleted leaf entries were skipped by a cursor FT_STATUS_NUM_ROWS } ft_status_entry; diff --git a/ft/ft-ops.cc b/ft/ft-ops.cc index a8efc47629d..4fb37603b6b 100644 --- a/ft/ft-ops.cc +++ b/ft/ft-ops.cc @@ -375,6 +375,8 @@ status_init(void) STATUS_INIT(FT_PRO_RIGHTMOST_LEAF_SHORTCUT_FAIL_POS, nullptr, PARCOUNT, "promotion: tried the rightmost leaf shorcut but failed (out-of-bounds)", TOKU_ENGINE_STATUS); STATUS_INIT(FT_PRO_RIGHTMOST_LEAF_SHORTCUT_FAIL_REACTIVE,nullptr, PARCOUNT, "promotion: tried the rightmost leaf shorcut but failed (child reactive)", TOKU_ENGINE_STATUS); + STATUS_INIT(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, CURSOR_SKIP_DELETED_LEAF_ENTRY, PARCOUNT, "cursor skipped deleted leaf entries", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); + ft_status.initialized = true; } static void status_destroy(void) { @@ -3376,13 +3378,13 @@ ok: ; if (le_val_is_del(le, ftcursor->is_snapshot_read, ftcursor->ttxn)) { // Provisionally deleted stuff is gone. // So we need to scan in the direction to see if we can find something. - // Every 100 deleted leaf entries check if the leaf's key is within the search bounds. - for (uint n_deleted = 1; ; n_deleted++) { + // Every 64 deleted leaf entries check if the leaf's key is within the search bounds. + for (uint64_t n_deleted = 1; ; n_deleted++) { switch (search->direction) { case FT_SEARCH_LEFT: idx++; - if (idx >= bn->data_buffer.num_klpairs() || - ((n_deleted % 64) == 0 && !search_continue(search, key, keylen))) { + if (idx >= bn->data_buffer.num_klpairs() || ((n_deleted % 64) == 0 && !search_continue(search, key, keylen))) { + STATUS_INC(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, n_deleted); if (ftcursor->interrupt_cb && ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra)) { return TOKUDB_INTERRUPTED; } @@ -3391,6 +3393,7 @@ ok: ; break; case FT_SEARCH_RIGHT: if (idx == 0) { + STATUS_INC(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, n_deleted); if (ftcursor->interrupt_cb && ftcursor->interrupt_cb(ftcursor->interrupt_cb_extra)) { return TOKUDB_INTERRUPTED; } @@ -3404,6 +3407,7 @@ ok: ; r = bn->data_buffer.fetch_klpair(idx, &le, &keylen, &key); assert_zero(r); // we just validated the index if (!le_val_is_del(le, ftcursor->is_snapshot_read, ftcursor->ttxn)) { + STATUS_INC(FT_CURSOR_SKIP_DELETED_LEAF_ENTRY, n_deleted); goto got_a_good_value; } } From 357cb12d87aa9d6abcf345b7221cf58d01203cdf Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 16 Dec 2014 15:33:13 +0400 Subject: [PATCH 116/201] DEV-7221 from_days fails after null value --- mysql-test/r/func_time.result | 24 ++++++++++++++++++++++++ mysql-test/t/func_time.test | 18 ++++++++++++++++++ sql/item_timefunc.cc | 7 +++---- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 8c156efbac1..08d46ab10fa 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -2561,3 +2561,27 @@ Warning 1292 Truncated incorrect time value: '9336:00:00' Warning 1292 Truncated incorrect time value: '2952:00:00' Warning 1292 Truncated incorrect time value: '2952:00:00' DROP TABLE t1; +# +# MDEV-7221 from_days fails after null value +# +CREATE TABLE t1 ( +id INT(11) NOT NULL PRIMARY KEY, +date1 DATE NULL DEFAULT NULL +); +INSERT INTO t1 VALUES (12, '2011-05-12'); +INSERT INTO t1 VALUES (13, NULL); +INSERT INTO t1 VALUES (14, '2009-10-23'); +INSERT INTO t1 VALUES (15, '2014-10-30'); +INSERT INTO t1 VALUES (16, NULL); +INSERT INTO t1 VALUES (17, NULL); +INSERT INTO t1 VALUES (18, '2010-10-13'); +SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; +id date1 date2 DATE_ADD(a.date1,INTERVAL -10 DAY) TO_DAYS(a.date1)-10 +12 2011-05-12 2011-05-02 2011-05-02 734624 +13 NULL NULL NULL NULL +14 2009-10-23 2009-10-13 2009-10-13 734058 +15 2014-10-30 2014-10-20 2014-10-20 735891 +16 NULL NULL NULL NULL +17 NULL NULL NULL NULL +18 2010-10-13 2010-10-03 2010-10-03 734413 +DROP TABLE t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 5bb19fe3587..f6afef99134 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1561,3 +1561,21 @@ CREATE TABLE t1 ( d DATE, t TIME ); INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02'); SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1; DROP TABLE t1; + + +--echo # +--echo # MDEV-7221 from_days fails after null value +--echo # +CREATE TABLE t1 ( + id INT(11) NOT NULL PRIMARY KEY, + date1 DATE NULL DEFAULT NULL +); +INSERT INTO t1 VALUES (12, '2011-05-12'); +INSERT INTO t1 VALUES (13, NULL); +INSERT INTO t1 VALUES (14, '2009-10-23'); +INSERT INTO t1 VALUES (15, '2014-10-30'); +INSERT INTO t1 VALUES (16, NULL); +INSERT INTO t1 VALUES (17, NULL); +INSERT INTO t1 VALUES (18, '2010-10-13'); +SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; +DROP TABLE t1; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 59a5f1849f8..522004e965b 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1488,10 +1488,9 @@ String *Item_temporal_func::val_str(String *str) bool Item_func_from_days::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { longlong value=args[0]->val_int(); - if (args[0]->null_value) - return (null_value= 1); - if ((fuzzy_date & TIME_NO_ZERO_DATE) && value == 0) - return (null_value= 1); + if ((null_value= (args[0]->null_value || + ((fuzzy_date & TIME_NO_ZERO_DATE) && value == 0)))) + return true; bzero(ltime, sizeof(MYSQL_TIME)); if (get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day)) From ff5349bd6c4eb71b26a74290864c58f7b34690b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Dec 2014 14:35:13 +0100 Subject: [PATCH 117/201] MDEV-6985: MariaDB crashes on stored procedure call Item_ident fixed to allow double cleanup(). --- mysql-test/r/sp-innodb.result | 32 +++++++++++++++++++++++++ mysql-test/t/sp-innodb.test | 45 +++++++++++++++++++++++++++++++++++ sql/item.cc | 10 +++++++- 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/sp-innodb.result create mode 100644 mysql-test/t/sp-innodb.test diff --git a/mysql-test/r/sp-innodb.result b/mysql-test/r/sp-innodb.result new file mode 100644 index 00000000000..da02957d3c9 --- /dev/null +++ b/mysql-test/r/sp-innodb.result @@ -0,0 +1,32 @@ +drop table if exists t1,t2; +drop procedure if exists p1; +# +#MDEV-6985: MariaDB crashes on stored procedure call +# +CREATE TABLE `t1` ( +`ID` int(11) NOT NULL, +PRIMARY KEY (`ID`) +) ENGINE=InnoDB; +CREATE TABLE `t2` ( +`ID` int(11) NOT NULL, +`DATE` datetime DEFAULT NULL, +PRIMARY KEY (`ID`) +) ENGINE=InnoDB; +CREATE PROCEDURE `p1`() +BEGIN +DECLARE _mySelect CURSOR FOR +SELECT DISTINCT t1.ID +FROM t1 +LEFT JOIN t2 AS t2 ON +t2.ID = t1.ID +AND t2.DATE = ( +SELECT MAX(T3.DATE) FROM t2 AS T3 WHERE T3.ID = t2.ID AND T3.DATE<=NOW() +) +WHERE t1.ID = 1; +OPEN _mySelect; +CLOSE _mySelect; +END ;; +CALL p1(); +CALL p1(); +drop procedure p1; +drop table t1,t2; diff --git a/mysql-test/t/sp-innodb.test b/mysql-test/t/sp-innodb.test new file mode 100644 index 00000000000..228ab42544d --- /dev/null +++ b/mysql-test/t/sp-innodb.test @@ -0,0 +1,45 @@ + +--source include/have_innodb.inc + +--disable_warnings +drop table if exists t1,t2; +drop procedure if exists p1; +--enable_warnings + +--echo # +--echo #MDEV-6985: MariaDB crashes on stored procedure call +--echo # +CREATE TABLE `t1` ( + `ID` int(11) NOT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB; + +CREATE TABLE `t2` ( + `ID` int(11) NOT NULL, + `DATE` datetime DEFAULT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB; + +--delimiter ;; + +CREATE PROCEDURE `p1`() +BEGIN + DECLARE _mySelect CURSOR FOR + SELECT DISTINCT t1.ID + FROM t1 + LEFT JOIN t2 AS t2 ON + t2.ID = t1.ID + AND t2.DATE = ( + SELECT MAX(T3.DATE) FROM t2 AS T3 WHERE T3.ID = t2.ID AND T3.DATE<=NOW() + ) + WHERE t1.ID = 1; + OPEN _mySelect; + CLOSE _mySelect; +END ;; +--delimiter ; + +CALL p1(); +CALL p1(); + +drop procedure p1; +drop table t1,t2; diff --git a/sql/item.cc b/sql/item.cc index 78c5fff3d2c..bddf011b60e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -862,12 +862,20 @@ void Item_ident::cleanup() field_name ? field_name : "(null)", orig_field_name ? orig_field_name : "(null)")); #endif + bool was_fixed= fixed; Item::cleanup(); db_name= orig_db_name; table_name= orig_table_name; field_name= orig_field_name; /* Store if this Item was depended */ - can_be_depended= test(depended_from); + if (was_fixed) + { + /* + We can trust that depended_from set correctly only if this item + was fixed + */ + can_be_depended= test(depended_from); + } DBUG_VOID_RETURN; } From a4ff2afcb4b1e16f1d467add82a7313d3da05a05 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Dec 2014 14:38:14 +0100 Subject: [PATCH 118/201] cleanup --- sql/item.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index bddf011b60e..cfc5f67dc8e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -854,14 +854,6 @@ Item_ident::Item_ident(THD *thd, Item_ident *item) void Item_ident::cleanup() { DBUG_ENTER("Item_ident::cleanup"); -#ifdef CANT_BE_USED_AS_MEMORY_IS_FREED - db_name ? db_name : "(null)", - orig_db_name ? orig_db_name : "(null)", - table_name ? table_name : "(null)", - orig_table_name ? orig_table_name : "(null)", - field_name ? field_name : "(null)", - orig_field_name ? orig_field_name : "(null)")); -#endif bool was_fixed= fixed; Item::cleanup(); db_name= orig_db_name; From 612d7a87a0df95fa3b5c6d27dea20f2a41830f5b Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 17 Dec 2014 10:48:34 -0500 Subject: [PATCH 119/201] FT-635 adjust test result with new status variable --- .../suite/tokudb/r/information-schema-global-status.result | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/tokudb/r/information-schema-global-status.result b/mysql-test/suite/tokudb/r/information-schema-global-status.result index 369c14fe4fe..7d0e83260e1 100644 --- a/mysql-test/suite/tokudb/r/information-schema-global-status.result +++ b/mysql-test/suite/tokudb/r/information-schema-global-status.result @@ -65,6 +65,7 @@ TOKUDB_CHECKPOINT_LONG_BEGIN_COUNT TOKUDB_CHECKPOINT_LONG_BEGIN_TIME TOKUDB_CHECKPOINT_PERIOD TOKUDB_CHECKPOINT_TAKEN +TOKUDB_CURSOR_SKIP_DELETED_LEAF_ENTRY TOKUDB_DB_CLOSES TOKUDB_DB_OPENS TOKUDB_DB_OPEN_CURRENT From 59f2e817693c5a9e94f4a10803957a6ceafe1855 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 17 Dec 2014 16:44:02 -0500 Subject: [PATCH 120/201] DB-783 append -Wvla to compiler flags to allow variable length arrays to be used in tokudb --- storage/tokudb/CMakeLists.txt | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index faeb50f924f..2a1d4988a06 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -46,18 +46,34 @@ include(CheckCXXCompilerFlag) macro(set_cflags_if_supported) foreach(flag ${ARGN}) - check_c_compiler_flag(${flag} HAVE_C_${flag}) - if (HAVE_C_${flag}) + string(REGEX REPLACE "-" "_" temp_flag ${flag}) + check_c_compiler_flag(${flag} HAVE_C_${temp_flag}) + if (HAVE_C_${temp_flag}) set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}") endif () - check_cxx_compiler_flag(${flag} HAVE_CXX_${flag}) - if (HAVE_CXX_${flag}) + check_cxx_compiler_flag(${flag} HAVE_CXX_${temp_flag}) + if (HAVE_CXX_${temp_flag}) set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}") endif () endforeach(flag) endmacro(set_cflags_if_supported) +macro(append_cflags_if_supported) + foreach(flag ${ARGN}) + string(REGEX REPLACE "-" "_" temp_flag ${flag}) + check_c_compiler_flag(${flag} HAVE_C_${temp_flag}) + if (HAVE_C_${temp_flag}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") + endif () + check_cxx_compiler_flag(${flag} HAVE_CXX_${temp_flag}) + if (HAVE_CXX_${temp_flag}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") + endif () + endforeach(flag) +endmacro(append_cflags_if_supported) + set_cflags_if_supported(-Wno-missing-field-initializers) +append_cflags_if_supported(-Wno-vla) ADD_SUBDIRECTORY(ft-index) From 724dbaabc0d06c4446417eb217d8536f193461f9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 18 Dec 2014 00:13:16 +0100 Subject: [PATCH 121/201] MDEV-7150 Wrong auto increment values on INSERT .. ON DUPLICATE KEY UPDATE when the inserted columns include NULL in an auto-increment column when restoring auto-inc value in INSERT ... ON DUPLICATE KEY UPDATE, take into account that 1. it may be changed in the UPDATE clause (old code did that) 2. it may be changed in the INSERT clause and then cause a dup key (old code missed that) --- mysql-test/r/insert_update_autoinc-7150.result | 9 +++++++++ mysql-test/t/insert_update_autoinc-7150.test | 8 ++++++++ sql/sql_insert.cc | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/insert_update_autoinc-7150.result create mode 100644 mysql-test/t/insert_update_autoinc-7150.test diff --git a/mysql-test/r/insert_update_autoinc-7150.result b/mysql-test/r/insert_update_autoinc-7150.result new file mode 100644 index 00000000000..96773479310 --- /dev/null +++ b/mysql-test/r/insert_update_autoinc-7150.result @@ -0,0 +1,9 @@ +create table t1 (a int(10) auto_increment primary key, b int(11)); +insert t1 values (null,1); +insert t1 values (null,2), (1,-1), (null,3) on duplicate key update b=values(b); +select * from t1; +a b +1 -1 +2 2 +3 3 +drop table t1; diff --git a/mysql-test/t/insert_update_autoinc-7150.test b/mysql-test/t/insert_update_autoinc-7150.test new file mode 100644 index 00000000000..1229898b4aa --- /dev/null +++ b/mysql-test/t/insert_update_autoinc-7150.test @@ -0,0 +1,8 @@ +# +# MDEV-7150 Wrong auto increment values on INSERT .. ON DUPLICATE KEY UPDATE when the inserted columns include NULL in an auto-increment column +# +create table t1 (a int(10) auto_increment primary key, b int(11)); +insert t1 values (null,1); +insert t1 values (null,2), (1,-1), (null,3) on duplicate key update b=values(b); +select * from t1; +drop table t1; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ccfdf352f53..4500c4492c4 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1754,7 +1754,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) table->file->adjust_next_insert_id_after_explicit_value(table->next_number_field->val_int()); } - else + else if (prev_insert_id_for_cur_row) { table->file->restore_auto_increment(prev_insert_id_for_cur_row); } From 826d7c68d210f5c34998108aa5e29909344e3683 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 18 Dec 2014 11:59:08 +0100 Subject: [PATCH 122/201] MDEV-7342: Test failure in perfschema.setup_instruments_defaults Fix a possible race in the test case when restarting the server. Make sure we have disconnected before waiting for the reconnect that signals that the server is back up. Otherwise, we may in rare cases continue the test while the old server is shutting down, eventually leading to "connection lost" failure. --- mysql-test/suite/perfschema/t/setup_instruments_defaults.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/perfschema/t/setup_instruments_defaults.test b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test index 5fd5acceb34..e1f61404d12 100644 --- a/mysql-test/suite/perfschema/t/setup_instruments_defaults.test +++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test @@ -60,6 +60,8 @@ WHERE name like "%wait/io/table/sql/handler%"; --echo # --echo # Stop server --send_shutdown +--source include/wait_until_disconnected.inc + --echo # Restart server with wait/io/table/sql/handler disabled --exec echo "restart:--loose-performance-schema-instrument=%wait/io/table/sql/%=off" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect From b75090c7dede338236b98ace65362348579ffa01 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Thu, 18 Dec 2014 20:06:49 +0300 Subject: [PATCH 123/201] MDEV-6830: Server crashes in best_access_path after a sequence of SELECTs ... generate_derived_keys_for_table() did not work correctly in the case where - it had a potential index on derived table - however, TABLE::check_tmp_key() would disallow creation of this index after looking at its future key parts (because of the key parts exceeding max. index length) - the code would leave a KEYUSE structure that refers to a non-existant index. Depending on further optimizer calculations, this could cause a crash. --- mysql-test/r/mdev6830.result | 49 +++++++++++++++++++++++++ mysql-test/t/mdev6830-master.opt | 1 + mysql-test/t/mdev6830.test | 63 ++++++++++++++++++++++++++++++++ sql/sql_select.cc | 2 +- 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/mdev6830.result create mode 100644 mysql-test/t/mdev6830-master.opt create mode 100644 mysql-test/t/mdev6830.test diff --git a/mysql-test/r/mdev6830.result b/mysql-test/r/mdev6830.result new file mode 100644 index 00000000000..0570659e860 --- /dev/null +++ b/mysql-test/r/mdev6830.result @@ -0,0 +1,49 @@ +drop table if exists t1,t2,t3; +drop view if exists v2,v3; +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 ( +f1 DATE, +f2 VARCHAR(1024), +f3 VARCHAR(10), +f4 DATE, +f5 VARCHAR(10), +f6 VARCHAR(10), +f7 VARCHAR(10), +f8 DATETIME, +f9 INT, +f10 VARCHAR(1024), +f11 VARCHAR(1024), +f12 INT, +f13 VARCHAR(1024) +) ENGINE=MyISAM; +CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2; +CREATE TABLE t3 ( +f1 VARCHAR(1024), +f2 VARCHAR(1024), +f3 DATETIME, +f4 VARCHAR(10), +f5 INT, +f6 VARCHAR(10), +f7 VARCHAR(1024), +f8 VARCHAR(10), +f9 INT, +f10 DATE, +f11 INT, +f12 VARCHAR(1024), +f13 VARCHAR(10), +f14 DATE, +f15 DATETIME +) ENGINE=MyISAM; +CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES +('FOO','foo','2000-08-04 00:00:00','one',1,'1','FOO','foo',1,'2004-05-09',1,'one','one','2001-12-07','2001-10-17 08:25:04'), +('BAR','bar','2001-01-01 04:52:37','two',2,'2','BAR','bar',2,'2008-01-01',2,'two','two','2006-06-19','2002-01-01 08:22:49'); +CREATE TABLE t4 (f1 VARCHAR(10), f2 INT) ENGINE=MyISAM; +SELECT * FROM t1; +pk +SELECT non_existing FROM v2; +ERROR 42S22: Unknown column 'non_existing' in 'field list' +SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5; +pk f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f1 f2 +drop table t1,t2,t3,t4; +drop view v2,v3; diff --git a/mysql-test/t/mdev6830-master.opt b/mysql-test/t/mdev6830-master.opt new file mode 100644 index 00000000000..2a8c27d4731 --- /dev/null +++ b/mysql-test/t/mdev6830-master.opt @@ -0,0 +1 @@ +--debug diff --git a/mysql-test/t/mdev6830.test b/mysql-test/t/mdev6830.test new file mode 100644 index 00000000000..24565d04fed --- /dev/null +++ b/mysql-test/t/mdev6830.test @@ -0,0 +1,63 @@ + +--source include/have_debug.inc + +--disable_warnings +drop table if exists t1,t2,t3; +drop view if exists v2,v3; +--enable_warnings +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM; + +CREATE TABLE t2 ( + f1 DATE, + f2 VARCHAR(1024), + f3 VARCHAR(10), + f4 DATE, + f5 VARCHAR(10), + f6 VARCHAR(10), + f7 VARCHAR(10), + f8 DATETIME, + f9 INT, + f10 VARCHAR(1024), + f11 VARCHAR(1024), + f12 INT, + f13 VARCHAR(1024) +) ENGINE=MyISAM; + +CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2; + +CREATE TABLE t3 ( + f1 VARCHAR(1024), + f2 VARCHAR(1024), + f3 DATETIME, + f4 VARCHAR(10), + f5 INT, + f6 VARCHAR(10), + f7 VARCHAR(1024), + f8 VARCHAR(10), + f9 INT, + f10 DATE, + f11 INT, + f12 VARCHAR(1024), + f13 VARCHAR(10), + f14 DATE, + f15 DATETIME +) ENGINE=MyISAM; + +CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3; + +INSERT INTO t3 VALUES + ('FOO','foo','2000-08-04 00:00:00','one',1,'1','FOO','foo',1,'2004-05-09',1,'one','one','2001-12-07','2001-10-17 08:25:04'), + ('BAR','bar','2001-01-01 04:52:37','two',2,'2','BAR','bar',2,'2008-01-01',2,'two','two','2006-06-19','2002-01-01 08:22:49'); + +CREATE TABLE t4 (f1 VARCHAR(10), f2 INT) ENGINE=MyISAM; + +SELECT * FROM t1; + +--error ER_BAD_FIELD_ERROR +SELECT non_existing FROM v2; + +SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5; + +drop table t1,t2,t3,t4; +drop view v2,v3; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9f2e7f531bb..eae06393c75 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9060,7 +9060,7 @@ bool generate_derived_keys_for_table(KEYUSE *keyuse, uint count, uint keys) else { /* Mark keyuses for this key to be excluded */ - for (KEYUSE *curr=save_first_keyuse; curr < first_keyuse; curr++) + for (KEYUSE *curr=save_first_keyuse; curr < keyuse; curr++) { curr->key= MAX_KEY; } From bc21e7a67f33b19d9d7a9002a5aec589f39120fd Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 19 Dec 2014 09:25:29 +0200 Subject: [PATCH 124/201] Fixed compiler warnings scripts/mysql_system_tables.sql: Removed DEFAULT from a blob definition as this can cause problems. --- client/mysqltest.cc | 2 +- extra/yassl/src/yassl_imp.cpp | 6 +++--- scripts/mysql_system_tables.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 02a075cf9b4..9b7a6e8fd19 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5908,7 +5908,7 @@ void do_connect(struct st_command *command) { int con_port= opt_port; char *con_options; - char *ssl_cipher= 0; + char *ssl_cipher __attribute__((unused))= 0; my_bool con_ssl= 0, con_compress= 0; my_bool con_pipe= 0; my_bool con_shm __attribute__ ((unused))= 0; diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index e2da042457f..25e00d45d2b 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -24,7 +24,7 @@ #include "handshake.hpp" #include "asn.hpp" // provide crypto wrapper?? - +#include namespace yaSSL { @@ -947,7 +947,7 @@ void Alert::Process(input_buffer& input, SSL& ssl) if (ssl.getSecurity().get_parms().cipher_type_ == block) { int ivExtra = 0; - opaque fill; + opaque fill __attribute__((unused)); if (ssl.isTLSv1_1()) ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); @@ -2395,7 +2395,7 @@ void Finished::Process(input_buffer& input, SSL& ssl) if (ssl.isTLSv1_1()) ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); - opaque fill; + opaque fill __attribute__((unused)); int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - HANDSHAKE_HEADER - finishedSz - digestSz; for (int i = 0; i < padSz; i++) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index a53a73656e7..bc89ae82dbb 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsign CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(141) collate utf8_bin DEFAULT '' NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob NOT NULL, body longblob NOT NULL, definer char(141) collate utf8_bin DEFAULT '' NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; From 094640c036a333c0f2b6f909b01a0ca39997f716 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 19 Dec 2014 23:17:59 +0400 Subject: [PATCH 125/201] Fixed a couple of compiler warnings. --- cmake/maintainer.cmake | 4 ++-- mysys/my_context.c | 13 ++++++++----- sql-common/client_plugin.c | 5 ----- storage/innobase/include/dict0dict.h | 2 +- storage/xtradb/include/dict0dict.h | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake index 5d3ce4d1f75..872d61d9aac 100644 --- a/cmake/maintainer.cmake +++ b/cmake/maintainer.cmake @@ -36,8 +36,8 @@ ENDIF() # Turn on Werror (warning => error) when using maintainer mode. IF(MYSQL_MAINTAINER_MODE MATCHES "ON") - SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -Werror") - SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Werror") + SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror") + SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror") ENDIF() # Set warning flags for GCC/Clang diff --git a/mysys/my_context.c b/mysys/my_context.c index 9be5ab80468..80156df4495 100644 --- a/mysys/my_context.c +++ b/mysys/my_context.c @@ -729,33 +729,36 @@ my_context_continue(struct my_context *c) #ifdef MY_CONTEXT_DISABLE int -my_context_continue(struct my_context *c) +my_context_continue(struct my_context *c __attribute__((unused))) { return -1; } int -my_context_spawn(struct my_context *c, void (*f)(void *), void *d) +my_context_spawn(struct my_context *c __attribute__((unused)), + void (*f)(void *) __attribute__((unused)), + void *d __attribute__((unused))) { return -1; } int -my_context_yield(struct my_context *c) +my_context_yield(struct my_context *c __attribute__((unused))) { return -1; } int -my_context_init(struct my_context *c, size_t stack_size) +my_context_init(struct my_context *c __attribute__((unused)), + size_t stack_size __attribute__((unused))) { return -1; /* Out of memory */ } void -my_context_destroy(struct my_context *c) +my_context_destroy(struct my_context *c __attribute__((unused))) { } diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index f31ddb22a6a..d96f9648011 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -28,11 +28,6 @@ There is no reference counting and no unloading either. */ -#if _MSC_VER -/* Silence warnings about variable 'unused' being used. */ -#define FORCE_INIT_OF_VARS 1 -#endif - #include #include "mysql.h" #include diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 0ad3cb3bcce..bb1119b3c19 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1139,7 +1139,7 @@ recalculated */ #define DICT_TABLE_CHANGED_TOO_MUCH(t) \ ((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \ - ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \ + (ib_int64_t) ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \ 16 + (t)->stat_n_rows / 16)) /*********************************************************************//** diff --git a/storage/xtradb/include/dict0dict.h b/storage/xtradb/include/dict0dict.h index b03d25818c9..2b53a33e103 100644 --- a/storage/xtradb/include/dict0dict.h +++ b/storage/xtradb/include/dict0dict.h @@ -1139,7 +1139,7 @@ recalculated */ #define DICT_TABLE_CHANGED_TOO_MUCH(t) \ ((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \ - ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \ + (ib_int64_t) ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \ 16 + (t)->stat_n_rows / 16)) /*********************************************************************//** From 260727adc6d1b805e6854315c3a18d3a30138bc6 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 19 Dec 2014 23:42:22 +0400 Subject: [PATCH 126/201] Fixed yet another compiler warning. --- client/mysqltest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 6ead479b94e..9b925d6bfb8 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5883,7 +5883,7 @@ void do_connect(struct st_command *command) { int con_port= opt_port; char *con_options; - char *ssl_cipher= 0; + char *ssl_cipher __attribute__((unused))= 0; my_bool con_ssl= 0, con_compress= 0; my_bool con_pipe= 0; my_bool con_shm __attribute__ ((unused))= 0; From f7a7e892883ebc175376b15c8e2cf0b06de4fbf2 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sun, 21 Dec 2014 07:24:36 -0500 Subject: [PATCH 127/201] add sysbench update perf graph --- doc/sysbench.update.ma55.tokudb754.png | Bin 0 -> 6584 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/sysbench.update.ma55.tokudb754.png diff --git a/doc/sysbench.update.ma55.tokudb754.png b/doc/sysbench.update.ma55.tokudb754.png new file mode 100644 index 0000000000000000000000000000000000000000..b2456d1e839480e6fc5b855b7633529cf00715de GIT binary patch literal 6584 zcma)gcUV);w)Rd)qzQ!HI|u>_h#*af2nr&-ccco^kt!t=DN;lbr3wmyKtKWMAfY2g zfzW%A8tF}HzK!R1&i(Fl?;khMPS)(%Gi$9`^Uk~0PPC@_eKHaz5&!_mRFoC90RV~u z0LUy60oVhj5E=$=#5Eu4D&g^XuqQh^`$Av<0ENc@cwl1#g9JJ|fjbU!cnk-CLSj&O z5ld7I03cBS9)%Ca4}KI70H-2n`@nfjOiW^8Vrpt?c6N5b!NIAispaM67!0PTr)P0- z5j3%N<3_?pLhWJW?(a`#qd4#%fsN3O*8p}Z zdn!Q_srN(}MFXH{Xi!M-LZK`%C`&x*!ha+_8@w#>*=~3Y1`n(U=(bHo;@ z9voEjzkU!A$_Q@R;doPT8zG4hPZgVkyAoUzeyq)u(BD39cz@KdExk02X(V!c!1L<_ zB|F>w)yP``>pR_3Y0I5fAhO{XPNErm>bO|T!iib3MzaRo5KdR>t)-JE?YmNDp%t79 zJgbmgtMC707d0wTd~|C*B>A?IJvam_T?$VXr6CW?!dO;niE5I6 zm+SSAq*C?OB_}cOg=i)7%%^2E?-EMoY1MqYw&^VQT@Lbdn=^{9jawG5(Ojt;+IJDk z@EglT$4 z#B>cuNJ#O2W>1?_{~=ycc)7Irfywk$Z;PUBfl@y)8kIoAtm*BXb2+`vo!tEP`J`k) z&6l@}T&l;1V-9uTqwfdNNj}XQ(2VIHdWN^+dYc*3&fe^l1IxY=pN$7`EcEX`1`1-l zq<%-XRPivUN4r@hpR2?(r8_$6G0t1-m3-T-+-_K1^ICV-sG}?aZtKa-pY{dnmxK(g zZ);W-Nc5f*JpYo9n1YV82N@I{88j3os3q4q04+nNEcvp`q@U2Qj1%>> z$5nE(PWV9eSL%byOiGMFYh|aj%wn%$MWT23O05rvfkq zY&l4i#qy9<*o=_+00^JaQq$W%n#Q%<wES z(wn@(Nv*9NTfO8mzqdYGMmmuX(bJ=o?X_9Z>yI=KO1Y6(DzIOU%cyYdl)%A%h z0va<2Z|YEb(snD2*qv)p^v5A8cTva4e8)g%$E8yt^>$C%K)P%(ich;tMW@B^d{28J z;}e`8riMjb!>2w%3YuY0)(gwh>`wF4P;e^rc$Zh6Jft=jJ(MnWORV&9<42!f5Wf5q z`bQmp7^Rcbrmp91eA5S>rP!{JDuIHxGY;!!eew!QCq;?=N6AC18I8Ya7}O+3x~AMq zIwA|}M^yeNO(N~SW>xwLv`N2mB>?Wfr?=BQek4%0*D3+HF)Soydz4o9UNjF>G*1|I zFIxU&Y148N7Q`07tVoab+&j1mf+Hi;jDY~6K>oYgEF=&KdC6A*^wygAH$6kf=;QWPcOAjWdQcjCrNZUDc&0QJ1uQZ>zc_S2fi@xRP0k0l?`M4A^P@lMC zjPmyUxbE`seCjz%x#ya#0&4>OnEf?kBDd(|G_EmjKSSa12z;6GXJU{YF&ZGCvMAc{ z4g>7zuyvyF-8#iO&o)A$FA3it!z7ai_<|pk?Av2mZ)S!$t}Uub1?-R!^>G$!oc~r4 zZr9^p`n~l%I1FG#585PS_<|2UP?dLg4>Uf|B|QFx7c&1$3Vphgc>L?~R10M-!(9ZEJL;C3t(M5_-Jr<|FvdJFIZXJ$H?wzy<~x&2(DU@R|MLq= zSYPc$u^O;5aWCKa2Z5vQ&oS1`q@VnM)`neG9ORCOw(K%~CE?S~<(Xil0A-tY-M9 zR$dO4c;#`NwMc+`Ub&t2x#D|hed?1liMmyov{A*r#61SSUS52(Hr!Wu#J?)=*|L?o z_*;Mv}*e;H7$1nu3NYQwsduJ(WyniEoC3> z<56ru*BK<6iOJTg5i0Hvp5^}oGLKByaM}x}z>o#BaCOp?2A%BHg;iLDw>R4qQTp{< z@^_LXmEzd%jv0;Pm*UHV1QpD1xX`83fZSx1%-bhdMkK(AGcS-M$NB+r9Ks?4Q=Q2I z^;#yC>5T|f#zDtwFtphwA;PT$E+`StKqGzr12;RhE5V_I9hR%lzpI@>2&$eYHrkX7O!Vr+H0q#XKM4+c2;^d)5ci>D`*OWw?xEeQQGT>%ck-G~A7gz5DbA<83 zCJ+-Rxq_?8nXTQ04{Oc!w@T&~nukl~t_dZl?(2L5ebW>YB`>&3@rB$?S=^{Hj=?^& zDufjbJ=YQ>SyM7s?s--l?!6+BrUd0S);JP-RG{8((Zg%_vvliWr}ZBxrC`yCn=6z~ zRxfp7zK_)V+0Rj1Au$ywUgJoMYGd{vI2)75uz*<;QarD2S&&J0tQmE1=R##NVarY zY@X-Ovtgbb<3qP}C#ii?@z;qp+HQxA;65B%Gc6I<-}9hvA%zCO43a^1eEjf0g!xH2xu?#403`9M#@lp>Op7iz(LSjMf(brQ1*^2Qr0fr)*B5X z2NCOu$$^P8Mc74#HOeueMi^_B1b7k#$7oL<1>nE z^mqnY^X(n+!{ne_ENU76FVfL329vjsZY9<+n1`OA$_m%gifcEz#D@%&{9B&>rVlW1 z5ynsz%M-(V@8H}ZR@a*fm#HpCN4qPpPZZiApeoTRgu0;)49aTZfGstpd@;yOQL1hR zgtw_Z!ol{|ohZNYYugcK7sNwG@NepiULhz`5Xj~8r7>kMwH61lNQjR2LV10u&%={) zdf0|P9DcN9doCEEN&Ge19#}xPgpL$(oIS5XIbq$%%(-h~UR}<63vh!H{_l1#}Vh>it}9@)Y=Nd&o(`i6{MmlfDBKj-%yIWT-%I%ayobJYEtjgv3xc;yX-EPmg77z1p6*W0J(4+&xlbE;&P zZIM1rwKB#$9G-Kf=_3^CKeo1{2~Y!r1C}+srLZ*zlc!R!T=|Ox!0y1?H&m$Yf9K3Q z;r;nCF^fH`i!#W?C5-by?#ju>O7gb`Ruh6k9hgULL3Hav%U&J7-;ssYhEq9>3~l!|ca_C=5q2hs*&IaH#Z#2ccJ}fSL-O30V zpb`kF`W)EJ&yYxkBWvLW#UwO-SNH`TB9ZFcFz?%?D*w6nmoM0nt=lPF87&VZ>H)LK zMYIi}9@Vg53&uHqoTdO}7(%b$^OF`98!%Vdd7()nb(P7e`x9tg+H8M`pW!W=GbwX7 z2(GX_mo-I&9hg&$Sp4DrgLsL~C;j5zz*Zu^1o7Nq`fe7B=D?t3&4Oxpx1K@<2xB)0 zZcwBk?lqNCS<-;WH@i5*iBy7+jc}y)JWsach2$dS6zYAIp4Ik*ScJ^;R#0K$UL>&D zp`mho7j-L_=Zq6`a);FL#r`t|_Ad;$s&Fkgso^;&NJ1pg9#t*U_)Q382@a7PJ*GvX z9Lja3WbTedxzj#(o|VM;?|KL`1l4jrj3Q!h;KMm zld;&J#dBb+ZwyX!F&?fu&uZeT2q0`p?*peUkynuWfG=x*Bj(92a!cxd3 z&PE~7hi&oBFCUmJ+fopTux?+od?aYL4uM>;)?ojFt~ftH0Xn6wG^bC&u)J=Sw^kvI z0;s93A&*f+BD|$g8=4FgC@*nBa)fsXKplEKe+NZ;2er+C3FpB0{`=M8A15pYQuL}kpI$A^-@BF4fZF*>{}qe2or3DV5AU> zM9CR0&fY|1)9Xt~lEPLNI%F4AgEwG^?3b)XEEqXNHv2Chszp+_5mcz$tkG*>%xx>C z5`q_kN&8f%RQ+T+r~9wL8Q=YggUFzzJ)x}m?yKj*^|&Fo7*=3>l@>hJ&k)%-A^K&H^k zb1&C%Dl#7~TbzfO^?5;`{h7j$*jLv6!mR34U^Ltf(bYpxIN65k7?5brjJ)(;|1wC@ z4NWz>cG7vCXf`E}((NWLo_$QQe`_GILk|7gwkNCW##z}`Z{rtyb!l~ReejwrpR=fp zQ8Al9HPwXGI41ee#}o-SE+2%YI4u^Z>CLO(R`2L1Pb+rc&y^SXS#>?xkao9l@l3ae zWwF70-S-aa>K#-+2j(>g=J5(aUbvj)%^3HIWOe~VTI{9k?fIa}Rofa_Yf)jmW>aB` z!L`kNt9RzpNm(z(yG?sk<#lJTF41w+XqAfEn%AzcK zo~>6i*CJ4U<_`}(xJJIz6^U(%U-5c@36n(-|t0JZyY)3v;Pj}S7 zJ^r*oH;kyROIBQ>)0n;AO7`gKoZ||429+u#jR319#o}? zmhHY8>VR{+)`5;O_C8poBS|0Y-*%s8PE*TSq0Ckr8G6tgG5E|mY)YB@0H^<%=ztsA#Ni*;UT+wO~vo5QkNkU zae#9z=ZD0zKF6-PvL|+r8Q^!tN$oT(uo6SYsBS-`SZUegvb?Ku&ptV)RRGS?nOgad mqCW{LdkCQa*$e=f%)mohUFwf~t0Ab1ZWSeU#S#U}(EkS<$Smdn literal 0 HcmV?d00001 From 49577736b8d332d73cb7bff450febf9d9c9dea8b Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sun, 21 Dec 2014 10:39:23 -0500 Subject: [PATCH 128/201] add sysbench update graphs --- doc/sysbench.update.ma55.tokudb753.loglog.png | Bin 0 -> 7367 bytes doc/sysbench.update.ma55.tokudb753.png | Bin 0 -> 7561 bytes doc/sysbench.update.ma55.tokudb754.png | Bin 6584 -> 0 bytes doc/sysbench.update.my55.tokudb753.loglog.png | Bin 0 -> 6899 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/sysbench.update.ma55.tokudb753.loglog.png create mode 100644 doc/sysbench.update.ma55.tokudb753.png delete mode 100644 doc/sysbench.update.ma55.tokudb754.png create mode 100644 doc/sysbench.update.my55.tokudb753.loglog.png diff --git a/doc/sysbench.update.ma55.tokudb753.loglog.png b/doc/sysbench.update.ma55.tokudb753.loglog.png new file mode 100644 index 0000000000000000000000000000000000000000..81fecd376842231acc76611f105bb3ea267a7480 GIT binary patch literal 7367 zcmbVR2{@E*yPq+Pl1V~kM%l_9LUv||LS$@_U5kASS;CkQAz2b4OV*O8G?pwgC=te% zeVMV#GKQ>UnKRRO&UgL4bAA7FopY}1o%fyR_dL(NJn#M7@BO=;803v>5Edv4004mK z>S!4Q01RjV07yInq9F`y5(Bh`3{u}zn@Xk9klfr{`U3|5ps6?j6+j~45P;TJfQHK? z6~_laBXDS{v^_cw06?GtR5Ue=`m<0>j5ZZP?553wLZPy<;`^aFvKg63rINBoEnBCqtR4t00r&yEA=6H?rD9MTXod2&CRh~G#|AP zKnf?N0Q$yr#}knVGdC$TCjiaKiAK;aG}<1Awx^=$_9Ljdw9B5F>rKVss5F15xX!9< zGL@WL+1W^K?8JQtp(1jrd<_i^1Oma%&Mqe>hnJTZi^am>@F&K%tZ6hRcHA>f@m+)HXs>)c_v zpT)ttac0^__#;nf{_RaiY%%h3@1QdB$D{Cm$2`Wpk**YSUg>i;(WjBXy$H+olEKbT zB4umw!1;Jnl}_gicd9C{=1Vxv8{`&V{?V~$yF9pO`LosY;sc~2_#{|PYET*XZqbS( zP`GRj13b8@em+zev_w(QFkucdnq`74_#S~De&?@X57EOp>eM2RlAGF3nMc#3yOff zWT51`iXP`L&MWq=Z^K54^;Q0{q{mI4K1}jO(s;h>wCMTbHthDL78)Lr!l7H+}_G~l8*fNN!7tK zixi`e4~iC-qp_cOTV3LVT8y8u$ny+lPA_bEvT9>O*uKs_g>5V)hc>P~6cce%REg9s z$r3fEN*K`Xu`nn;2r`-78n_N~Es17x8!a6*zhRv_+CQibedXq~VjK4@Qdo>52P0H( zOIUYOvdw2pquFuNAY-%U{tnuDooh_4Il2N0XBP@AZy8)$UCy4(w_uW;3P6FjgJOB0 z7t3tj-ws^Z`(}%?CL5=^C|oEj62mN;6#Dyh06o92=OLwf!SkEVy7(4Xb>nvtuTzzh zoLb&m?A4X>X4sFrM=x~p8DV9JK6O{A^~#!$!Y6Xpr!AND#8kyO3(i^HZ028CBp%dZ z4|`qK+CEQ;gYaHyf;VB)aZe<_O?d2%pxYldlv?&Los4+<0p*3m9LIV;(Q^yo7en=L z3BGM%b2$6iR1oC3IGXlhqz%7Z@3OdQ`@O&B)6-bUPD$!!n!D+&wiCjtLhTZpa$4baF*ql~O31U`Uwt7fw(6O<-KkE4Yz6QJ)83~H ziVe*BKjX||?6zwKr_AA6Z%L8Y7}m^;t`zb)KulGn;#6E&Nnz-z`dfMd^Tl6|mK;k+ z^UY0YL|yE;@f}m`ODHsN+_EZ#5Jux}so97wD*HViAN0TT{Pn#u8^UlP*VwSJyZD{` z8+{&d_j~h{b=8Jf1NwtqysQhyvfF(K=WERy%RFY5a<<AaS# zcRhnx60^0R*2VEP{S(~Yzb^ZQ7Lt$;9N_lOxI%SoYuCu?Yv1w6mCrsKLL%dva(JVP zJucqz$qM2fatW`rqFuSGOL&u%04Y%A8KsVeAEx}E_h>r!JhS3z@q!je4D;)V(&yuU zlUCQ`c3uaCoDBNG$UjfKHoSJlut5KW&q-9uS$L`e9lQkXUT}r-3p#`+{zk63(IE{` z^7Yriw!)BMu<4AE4tICLz2`C?$5pXSPaiJ@Wg02UKVSSt@Dq{AR+d~Bypx2I$V`b@ zncL-Zl(_3I>sM#<#0fWBxA^^&?#rRH_+#4HOxZd~j*Y`(h^dQO0$|vco^7#YJtXg- zNoLGUlNWFz+xm@jRnPj%7L0PoglyDFSN+Sx$(kXeO9QgUv4bMFFOrmbtuAE78Z@zX z%>XK$TVBcLYW%v09HiCW7rg~}Q$n278!f)H!Y1&=M(X6$>37v4D&|@H5_OsYD7n}F z7e&M1Bd~d%{h}eS%tOm%;W>}}<`^o=*#6c}m zeUZFmwTF}h7IPaR_nLt#du$vdWv7qE{IH765Khho!o5G{^+#k(aC@UDiOuj0r|dun z+?z4yJW8FdJ8t}>x+Vxk^wI924LQ>d4;8UErN0d8)|#c5SZ^@q1=f2F*2Mf>e7{YyZ)%ZX+rwC0Wui%YA}x z2v%nH8HMay-^kh7vtTmh9dQAXLhn(on^*n7H%I=QcsSYjVro4vueUt>HEZC5>h0>A zJ#!icH2DMI4MW~_wu6}L!wN54zyaFTtNsnIw4_%bTRJ0T2dJvOV7*hfx7v72AzQ$Y zvXs5Ctrj@hViNi6V9ty5Fc@xI%`Wxy$%!Y8Ehbuwe?|!$v8`U?WY-`!#TPrz1l#Cd zc+>xIG>3v`k6@U{Mu-~MKIc`sq#K4Ec|{L~C}Y3SWYn{M($HxLmnZYj7rUFf6l_*9 z8`tttIc;;{UsOLmb-Ki$cQz>nVXk_IIYchdXYXmzFUq>`Quz@Ik_NG~hj~weO&Jpl zuwJtaUhPaR_2n$j)|>DZ z8F8+xj7PlNtfwy#Au9PUxI|f5aCClYp4|X_sqT9;(Ab~68vh$8a=KOIh z>f>+s)AtwG?N@z13V2~mWXKUoH_{l>q%-x*w4>XoDpWQQqI8*-dasAYT7NT zjk_cr~nu?&`n>)^=A%{aw zbLaGZtl&|%)G3O0xdw8^%F$rc28 zPn#;^7RvF!C0Lg()Uod4hu$}#5KGI2)#6cY^JZixGH0Xj^s5jYZN0+h@k+b&_+jkI z@?Bq}MabVRXJD)l{?t~UD#r5D!COPkj(fzFBR6ByN3!-?V{|Ed?`AvH^d8x|mD(rR zi+)kpg@1Py-qudr89y#Qc1l8fQ23YK%Vaw~Um&fiNRJ}B)MUH!0mmfA0%Pm?CG~pY zvKOcXoyD@>tWR*X*Y1EZlJ9twvLDvC3`IOzAL1IYE_k|dfOqDZ=M8m`>-M$c9N+`l z7iYHyu^EcFA_>9tzEE?y37l5yPmpxw;g^jG{D3}pa@O9rPr)kpwT#Yf>%A{;GTWcJ z&%BWWelvY}`D=6qXsp{kb;diOp4%T@Usc~@G8{i%H#eRJ#`O2<6JSK`!KPe}b9bm86wTOJb%DmqZ3K=TQnJW$tecrQ4zPT!V zT!f-wY_hZjQ%~LGYI8yq-D!KCZb^6>>_}Lp<%_TU(=17;me_;c{RTcTJ!70#8mnY- z*BcAc2C2vX^sZ`g)Cyq2AIcH)TbHALsoUj+9=lyZG~XfgGYrfGXwh;K9>*;`&8j%g zVN7Hdv2FIP`3M{ae--SzL4_st_@vKxSJkmx6(n4DCcQh+9AA8d3yNg4WfH!>aEuF& z{?(XG`mWzzv%@kX#iginmS2hgf%`$>y{u3sNcxX_)>afk_1rx~{&)_lm$ zm$y(FTc9RB0yt8}-pw)?OQZTX@aCaj0R-T|`1BO%q2mTZV^hvzW9^=7gI zZU7ENa6(T!4kNK1xs96?uYTJ;#Gf9~sSBUp$!M_3 zXXi1ba4(f0{LSR)33Ee*xXUI@w*;IGG{KoLwmrJRg_GyIP1Af5}g=^K@X5?-#54+hN4SjYHEVagWJ z$#%p!Qi5}NkqRak-W%Of!23_3^Kt~>RkJSOR|6{D?Bf|X4MzP*1UxNAV72}I2^D4G zdrG_yR#F+EYG%DdzBZ%F1~cLmC6pjmDMvuzLOcwnR_9!yaNp8EVeaLjIEN<})>AlE zyeYy7x4m%RqV$enK`)wjH%Ucxy^Wh6qpYk7%K)yC)(>9L5Yc3|^g(b6wVr8RlE9qI z;Y!=A7^{=wKINp0D$gyUO7XZR6;*E?Jo7TPm6=Dpr))whX-`t;+u{N*v(5k>wduT%fcNrmB>SCIeRvit z=POel&ZLWvx)1+V8De@`DeaZ#8B8b72{br_Q|WBaoHN}16ju7`hOd`T`}uOgk;A>1 zxD)rCad(qP(H>^~mwEeNT&)C#U8tAKDRobe>N<8qkbrJns=(1o%DfQTIC9fLYg}S6 zR9bClOWb06pXEjbSYJq(AG2DLahhLuMo6&_eRRpCa2WDjZ|>r`I+hz2<(Ijac;^*Z zcUm_nf_Foh6gGQ;H9ze@KcMxo|j_!)Oq?OoMvS||Nm zPA@u0A=-geyUBNDM$jMV%dQ}_D^@*_EW_Z8yJmFPuT(;~S+Xj4sPp86KVA?m;7G{It5LT9e%5TX(a8-@=YL!pIIY z7@$gDY>DW7E`5+@5{hd~{GQ%ZW6^^Ph9FJg0Gmad_|z&C34kIMc@weA3`v*dzHe+F za`(^_pt*aRX8X`cRVl#?aO70bAFvBn@XEXqsp^&J!@$HWDxB7&@uRKKJJH8S6djQg zH;6!2AMnl2OpJxmAU9mo0U?YkI;W==GYU(r+MUQe4=MrNQewuV>pHgw&a)X$1bpdz z?(~a)puY!n#+);+?$gShi1Y4%CNN@sT!2gdJEdIp*-rWD4Y5&Fy zc9XAvOVt0)!+#^@zqtMXaf;;8D$gQUt9<=hOC4ItE8aAo;a^%Qo3$5EBjCer9$DLC zf{9n#!x+@1&^|1u9|xBXEKF)=)@u`yGqBRsLHady(g(TiKB%I4pm_WJ4Q zdZ2JN_G$66I8`Pnd0I0zWyS`Us2bZlkZC<TI2wZe~wXO zJrbhOsK@uJ*POx^Y5TC)l!4a0d?eDCa)UPo`L{4%P{uFr*Go4O9EWbFzf0qq zU-6UGuU7d!V!Jv1L1+6%zs9-vO~g1e*iW`YbQEH~$RA3MIsnE^QVU{r-c=jb&xS^B0zTGG)$<+gg`qGOr|Mcbf_*_}I%ILRG z8z6reh_VvJ^C`cTMyXgK o^W8ACdCSb_|Ml3b<^q*DsbjU6JHDujcD4r4)xM!srfDDkAA`^o-~a#s literal 0 HcmV?d00001 diff --git a/doc/sysbench.update.ma55.tokudb753.png b/doc/sysbench.update.ma55.tokudb753.png new file mode 100644 index 0000000000000000000000000000000000000000..e5ed5f90b6356d0a442a136b83563f976509fb7b GIT binary patch literal 7561 zcmaKR2Ut^0x9(0t3B8LHN$5=xL4rt0KtRAkN2M2~H>HTw&=f^Fh*C@hM3mkXL?8&# ztI}&gfk-nVz2$EF&hwo6{pX&WXD4gV?3uOJe&?MvYbK8ku3u)N=cNY#fJs+J(+B{d zSO9i%^m%n!Hnxms*SXkJL7cVL+D+vTbcX#*v z{5)uaEGL(^mRLNxKsF^4DU`LT2+I4W(zP|p2mo3GZiByJLa{{9{^x(IsQV@q?!2u zfbUROQ{5yWYc)IWV`Twz^!$r4ADPdY&5iqw(ZWc$E7v$ueMI?>pGD!h4Aa26B2Yr{5?#24m|L*tbD=IX*Uzzo5+0M0u z%6ZFF`F(raO8NwKeRPSHgZC#cEid5{o?6R+BC6^wIk(TgadhRY4C>n7HR)ge6}3P2 z_R_>V(9OYMbNB4`mZZ)rPoDLOw@V0+nTt?idEDYIe)N|%eT#b)DkmU)=ZSU5 zF5hOf<+Cz*Gv&_~1E-z77i{-N<=hIR)lhbfc5xfyVNU0GS*%VY_N6Ixy20-n|4uo) z?AG;tf74gn!?h@{x7m$F_eS5BR{6Y~2@DD$Mw%6Gf}W5LI83=;R-XvV4qL`;2JoCJ zId@@NPj<|sFYXVwNI(#GGjj93dWi7FU-h!33#F!gd#3K6cxIJ9L>#G6(=(}gsufAT ze>TWb}j3{w5y&fIQz){!8EV@_cOqp-wAFL`vJP*AQy@pBI@;s+|8+?^&o5pR6A~OUv{oc8>VEep>E|f6%5R7XB>9= zDN(X5w%77jw|c7~Q?V~krqkfc&T!OcRngXS&yLTwjwHCJENWtV%PJMBoID7A`(0`Z zbA$xbGgcGD+TDmnbNQ>0M<2#g&k}6IRA+)_5uD4h8etELo<}McZmJjeGfyuZe1FYF zviJU!X8WeOSVy%m2AHb0blbC?G9}-ZDIZLm8{KJnM))5CfYq_){KRj4{i?GhxWlB7e_V}$_5`v zeWKs89$u|Ym^{5$_vZ`0$^?=lQ?byGm(YJ70C>LQmR@6E`?=JIZXrR!^M=q%^;hnqLcjq&x##hfmA_3{LT_%--ovBy} zhPiu6<(V-kYaYw3w|K;y_d2`cbYEz|tC%yb^yKB*YQmTOh|qwqy1zej#Z1Pn-J>f8 zmK)yELEf$B*PY9V(0F@fpt(%A)CT2@Q!M!!ip>AM_iBG0dU>)<==|#i`Z+tYCoR;( zz0H}Pn#7`2#jNt(iThZ9tJ(2sejL!8 ze&_R0APd;~C}%n9)J>faBmUpvtLY5G2C-GJE6(oV-$vzv{LI|TsPTYQ>c=t5H8<{_KL4&qySDI>TE5Bs7jWtNZ z^K}4``{d57x#Oiu=7Y-MvIbIPpoG2ZIS-m6r4z)4*%MENt897^HzljMGhFY|h~yL@ zCeCFHhlhQhahPRN@$IKk+3WC4F9}SFyc^XraPNqq_o|*?a$qV;6`+0#?eB2D7)EiY zCeaAo`+i6Tqwq73ix390k3Or>aK`~QKQ93NlWY2*EZ0@Y`GjB)hc^*!vdSX9^!g#*5hU#T3B4b^5 zuiJS2E=~9KpCTc{lDkE0d>ga~KO}WCBVeKM@RM?_KGm z`FD+s;WKdA_iD&m1lst#F7CW&qg~KZmpCS^v@k5Q%_KJ7y zOB`!fjC9d0vp+=Jcy{apNxz^6fu5q?cN_8$)=r*J_}b|D?fS@Pphb1^AFE&tqKEiy zg3TJXPU=S7(zg4dg||cs0)V(W%aiL}xAnprlu|op2wy0lLodATc!-3}6#9M?t2u9t zN^|x+lcJw-NuQCbfJaB3eCWEp@G`;T)`t<#vnl$!oNVV<@!{uTGxFaa8(?Q?wxE+C zpSVHVGr)1VBKf|=GxLYYZo>BZf<=lyo7Bph+-{zJGKaAmnT9#E=Gj;&&rT>`zsS)A zpXkmXK52*qf;9cUdU|;2M6g?R(4nJcPnu*(0*WXaeTeTO{8FxdHp5boTAv|pD2BMv zGy>99NFXs~hI~v`sW~2{-M>_Q5}H`Pt9s<7@WH>DD z{SZK!-4-NsXX?QX`u;0=UQ%56-)1PSzk_`Vc$*5mX?=>Zc!=Z_=Kk(2>ZCjIV+osxoSE=C3jPg z5lu|ir{hKwdc2QOCG==gTL+|Wz*G`O3EReK#Rv0ibF-dkLURn$L9%84Vy9}C3}%Tb zxJ(>{Tk-0j_s+MsXNev?I5XciVrGmokf=VovSjA7!PD={pWv4bska_aW#ZH;rX+u? z%W+_db~)S}+f)4mFDn_`Yqe?A_upo+M4eu{ES2_p_}B9M zS!LO`naffMlV@I4Ox>PZa@#qNtk^vc@4QCKEKBp5ELDSpaS7g!C61h8tPacs&JtdM zn*G?6N7k_BMGUB#j>R2Ds(@>1=q0`4naoOM+4g*|?JF&0D#*Kh@8bI!u6o5ReO|F# z^{_wNw!HVRX#NJDAcUDigFWh#2luX}e6@CPZu)s8p@-d2MIBok_O5cQRI+;detU@f zecR!JjryUzggW}r2;h6)_Ds?>titPITIR8YRp#!+vCSpznoaxoCJw66HXONf?>ENY zczI%J{~$g_4JLF-nmg(3W_^uip7!4WNF8&fc!rxZh~}8qEZ*`1;Ws>HOFjoRVHL~6 z)3ZBc)+!H~G1#-B<$U>#4L7@%X#-BaJvC56Pm`yKgQPoYc+*hj8GL|PC9StE)C}Fs zG0?+cv>37X(q^o9RS`pOU!bFF9@dqdV zxBM*g392-4A?zLo?2qOb0f27K*9; zq!s7vP4nCMZi)7W+_@a>^B1V~zl7%y-(E1_{AV0^{v}>Sq44cvw-`akNrgnzFJnPg z;uT#IZ8tp#pgpXy-bcNMgL=n_LW_IM6pSmygeD_Qf4`x?oIpBK%V>Pv-H$wy`I{ja ztUF1p(s=!)c@-u!U6XeDX{t!N5-CmJVyNjwS&tLPq z)X7Bl5SsH-*b6YIc|Q%6)??;REvB;Vz`x@BRTJV!+v&S!Pxk*iTLJZ2bc%k|-q3Y% z2GNXfQ5L*$Y5;usf6CH#!*T9vOC|YTG&h6;6MNo#?e`R#Vj*83A@t;~yiBDAu`5e1 z)L7EBGXa5@mgF*W%8|~~z#^Zd(!afC@&E;A6~W+GcJA=8D&)*u*6UAyN-Fk@FIpN= zN8$7?)jd8mC;DkF!mgL^Vq53_%P5`x7r&gk(+Opcr?XNYYR5Sf{{n=~)MY$~@jZ>v z^Ci-TD3-Wg*@wK;@j8NUI^48wRE&j{E>~X3F+S#QO5I>-T*&DGNy=ic{%Ldf} z$CRJ?qaC0?2Tis5yk2_%un5nJ2RP@xr0X~iGQYV6HKu5KQMTOR!2caXqT{~>`#82B zk)HIpf!^~^{7oiE1Lxk-%^3*DoR&`b7#6V6b0_Y*t72V3v5(k7Xs({he}#)0I1Tce z;~up&vx7V{yFyNrQmvG54X=BoyMZuou*i)&RN$x?{&@Ek|7;N51nTc?H{-E;-j{v} z28r;wXR6)rgh^{-fkeoI_ZX1dx_bSzFU)uZKhcA@lEW?2*e12$pbhy7Y5|2Db;kCG z5G{2SqlBI>svGP6{Orz~D%eWLGp3Y|gib6_`WGiw7{t2iINQblKwNTB4B(hzt3S|6 zS{K1LNVC`31;SK}p+)gu)Zq z9y?(s8EC5Vsv-MUx2o$7!J&CQjU%m_zKsHG=>Ihj80B)*4J+a=>qbPP=n3}>Ea8OI^_kqNIMbwO-T>O#3r zE${1moHm>_E5+#46%kHJ?j`XW91`Pwy;Dmk-5_t$a-JU4h|{GDbWK`US2z*$P$7r1 zLcvnkK1of;&I$_`ZRQ;a+d~tgKtm$~a$`d=M_?@2A-taQo6#?uE$InouolN;K_0Mi z1(d#dYi$({m2Lg8E!t_ zGUW7O^C@>)cvv~v@GgfxOXg2wu$u;&*vhSof)zhmphYoq&~8RBqfuZ*O6c)GI(NlS zrmKH+%ml#*R#2aYj;0;xm@I`+vMu?fd>jP941S0u1ye*p* zqi0TRJ8@qFkbKN7sM}nv=fSVl*+j9`fBaQzMWqO7)5f3prfBmw?+YNukbY=2WiiEu#ppBN5>XcI)qHaktB-NJC$ z2oMOvnU|OzXiH5x3*H`L|6@knpd7eM6AV>gVD%u-f`u^~>J&BfzKPTcWS9gF7b5l7 zh&dc55cJQjJ-$);pH+d#7(ka!m|1Ac-frus`9uTlrY(sOF2G=``~s2$2@G&nPHONJ zV^#*UKH!YRSl{Nbb?ZVLSPFj}mq-5mQ>ia%^Wc3skGQTOSkr{jk%p_JSwd5nw1#Z? z1_$*Oas&zDDb-8?mM6#x#|3x=O@oJxl^_@NDbk5JKZwDy5|wyhUQh51x3D$z4Pq9= z%U1a+4NL(y;+!Y(^OuJ46G_puVR3VN5WSDMXR=dj8 z<{i^GXA0x<*#SjT0-Gf-r4TVu*Z6~lGRN3X7YcR%jI&)|r*(!^MAQKteW0NQ>L5s{ zCrqe(iLQ(j-_`+c;CHBM7|2v`GTo=^*cx^5D05cPaGplLa(-mshg`G%5vInOxfgdsQ}lZ=O5f0*gdNw9RSUu z8s*P|==W&(1J?b-Ul}PHobrj9YkO- z=7?jtmIWHjK~1&uO8Y$3jvhVSJFy2`geff))M*4!@B1uxtYR2KNPr$h^Y1^K4;Y#Q z&zW*jJf0_^Q9Tni?8vbMPldL^6PMk}d8#}5pd!<(XIO2iQD-lB!Xnb|H3GC_E3TR; zxIN|Z{pR7Mp-0NFzTm@!a_HcOl_+#D@qrtAh|8(X7K@4 zDx?@)boJmR#Y??G5s{fz$ww@t;d^Mq@y(KmiSW*{b9z5lt9)-?Fpfge9j1<3Uk=4I zE=cH7Xf55Md)IQf+!9*J`Aj=?1L`syQSlcuQ$xo?F>|mz)hgY+@3wVAE-NJoUP?iY zeE!;W^;YijsmE8rvqmXY@g=mRg4K3Y~xfm*GV=6i+}%esZg9 zfa+an6^GRdFDtUlH$>cIma`aM-c1Tr9y!73O^qLH>w4#C_KSv*ed&S6D>K9h^=jbW zE5<|O^Q@M^!Zuwo!Tfvr>wtg+Q&oyMMm4w6r!Lf(PLI({-Y6vBNy*}6{T=lW(;`DD z>X&j6h|D|13#UyP2$_aVHHJITLHQNSvFB|rY39BVi4mfF!sOOBGi+BzSA?f(T#51P z8yq`aG`!NEOtDRq1GtmQHYmquqx7=RZ;tp}A-PnK%jz5ekqnUWJCl(FA4nr|h<#X8;?%cS{q5D&2SWneE&L=I(!Q*dmzw_@= bDM+Wl#FHA-dQHlbkDusjUDqtpu#NaXaNIEE literal 0 HcmV?d00001 diff --git a/doc/sysbench.update.ma55.tokudb754.png b/doc/sysbench.update.ma55.tokudb754.png deleted file mode 100644 index b2456d1e839480e6fc5b855b7633529cf00715de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6584 zcma)gcUV);w)Rd)qzQ!HI|u>_h#*af2nr&-ccco^kt!t=DN;lbr3wmyKtKWMAfY2g zfzW%A8tF}HzK!R1&i(Fl?;khMPS)(%Gi$9`^Uk~0PPC@_eKHaz5&!_mRFoC90RV~u z0LUy60oVhj5E=$=#5Eu4D&g^XuqQh^`$Av<0ENc@cwl1#g9JJ|fjbU!cnk-CLSj&O z5ld7I03cBS9)%Ca4}KI70H-2n`@nfjOiW^8Vrpt?c6N5b!NIAispaM67!0PTr)P0- z5j3%N<3_?pLhWJW?(a`#qd4#%fsN3O*8p}Z zdn!Q_srN(}MFXH{Xi!M-LZK`%C`&x*!ha+_8@w#>*=~3Y1`n(U=(bHo;@ z9voEjzkU!A$_Q@R;doPT8zG4hPZgVkyAoUzeyq)u(BD39cz@KdExk02X(V!c!1L<_ zB|F>w)yP``>pR_3Y0I5fAhO{XPNErm>bO|T!iib3MzaRo5KdR>t)-JE?YmNDp%t79 zJgbmgtMC707d0wTd~|C*B>A?IJvam_T?$VXr6CW?!dO;niE5I6 zm+SSAq*C?OB_}cOg=i)7%%^2E?-EMoY1MqYw&^VQT@Lbdn=^{9jawG5(Ojt;+IJDk z@EglT$4 z#B>cuNJ#O2W>1?_{~=ycc)7Irfywk$Z;PUBfl@y)8kIoAtm*BXb2+`vo!tEP`J`k) z&6l@}T&l;1V-9uTqwfdNNj}XQ(2VIHdWN^+dYc*3&fe^l1IxY=pN$7`EcEX`1`1-l zq<%-XRPivUN4r@hpR2?(r8_$6G0t1-m3-T-+-_K1^ICV-sG}?aZtKa-pY{dnmxK(g zZ);W-Nc5f*JpYo9n1YV82N@I{88j3os3q4q04+nNEcvp`q@U2Qj1%>> z$5nE(PWV9eSL%byOiGMFYh|aj%wn%$MWT23O05rvfkq zY&l4i#qy9<*o=_+00^JaQq$W%n#Q%<wES z(wn@(Nv*9NTfO8mzqdYGMmmuX(bJ=o?X_9Z>yI=KO1Y6(DzIOU%cyYdl)%A%h z0va<2Z|YEb(snD2*qv)p^v5A8cTva4e8)g%$E8yt^>$C%K)P%(ich;tMW@B^d{28J z;}e`8riMjb!>2w%3YuY0)(gwh>`wF4P;e^rc$Zh6Jft=jJ(MnWORV&9<42!f5Wf5q z`bQmp7^Rcbrmp91eA5S>rP!{JDuIHxGY;!!eew!QCq;?=N6AC18I8Ya7}O+3x~AMq zIwA|}M^yeNO(N~SW>xwLv`N2mB>?Wfr?=BQek4%0*D3+HF)Soydz4o9UNjF>G*1|I zFIxU&Y148N7Q`07tVoab+&j1mf+Hi;jDY~6K>oYgEF=&KdC6A*^wygAH$6kf=;QWPcOAjWdQcjCrNZUDc&0QJ1uQZ>zc_S2fi@xRP0k0l?`M4A^P@lMC zjPmyUxbE`seCjz%x#ya#0&4>OnEf?kBDd(|G_EmjKSSa12z;6GXJU{YF&ZGCvMAc{ z4g>7zuyvyF-8#iO&o)A$FA3it!z7ai_<|pk?Av2mZ)S!$t}Uub1?-R!^>G$!oc~r4 zZr9^p`n~l%I1FG#585PS_<|2UP?dLg4>Uf|B|QFx7c&1$3Vphgc>L?~R10M-!(9ZEJL;C3t(M5_-Jr<|FvdJFIZXJ$H?wzy<~x&2(DU@R|MLq= zSYPc$u^O;5aWCKa2Z5vQ&oS1`q@VnM)`neG9ORCOw(K%~CE?S~<(Xil0A-tY-M9 zR$dO4c;#`NwMc+`Ub&t2x#D|hed?1liMmyov{A*r#61SSUS52(Hr!Wu#J?)=*|L?o z_*;Mv}*e;H7$1nu3NYQwsduJ(WyniEoC3> z<56ru*BK<6iOJTg5i0Hvp5^}oGLKByaM}x}z>o#BaCOp?2A%BHg;iLDw>R4qQTp{< z@^_LXmEzd%jv0;Pm*UHV1QpD1xX`83fZSx1%-bhdMkK(AGcS-M$NB+r9Ks?4Q=Q2I z^;#yC>5T|f#zDtwFtphwA;PT$E+`StKqGzr12;RhE5V_I9hR%lzpI@>2&$eYHrkX7O!Vr+H0q#XKM4+c2;^d)5ci>D`*OWw?xEeQQGT>%ck-G~A7gz5DbA<83 zCJ+-Rxq_?8nXTQ04{Oc!w@T&~nukl~t_dZl?(2L5ebW>YB`>&3@rB$?S=^{Hj=?^& zDufjbJ=YQ>SyM7s?s--l?!6+BrUd0S);JP-RG{8((Zg%_vvliWr}ZBxrC`yCn=6z~ zRxfp7zK_)V+0Rj1Au$ywUgJoMYGd{vI2)75uz*<;QarD2S&&J0tQmE1=R##NVarY zY@X-Ovtgbb<3qP}C#ii?@z;qp+HQxA;65B%Gc6I<-}9hvA%zCO43a^1eEjf0g!xH2xu?#403`9M#@lp>Op7iz(LSjMf(brQ1*^2Qr0fr)*B5X z2NCOu$$^P8Mc74#HOeueMi^_B1b7k#$7oL<1>nE z^mqnY^X(n+!{ne_ENU76FVfL329vjsZY9<+n1`OA$_m%gifcEz#D@%&{9B&>rVlW1 z5ynsz%M-(V@8H}ZR@a*fm#HpCN4qPpPZZiApeoTRgu0;)49aTZfGstpd@;yOQL1hR zgtw_Z!ol{|ohZNYYugcK7sNwG@NepiULhz`5Xj~8r7>kMwH61lNQjR2LV10u&%={) zdf0|P9DcN9doCEEN&Ge19#}xPgpL$(oIS5XIbq$%%(-h~UR}<63vh!H{_l1#}Vh>it}9@)Y=Nd&o(`i6{MmlfDBKj-%yIWT-%I%ayobJYEtjgv3xc;yX-EPmg77z1p6*W0J(4+&xlbE;&P zZIM1rwKB#$9G-Kf=_3^CKeo1{2~Y!r1C}+srLZ*zlc!R!T=|Ox!0y1?H&m$Yf9K3Q z;r;nCF^fH`i!#W?C5-by?#ju>O7gb`Ruh6k9hgULL3Hav%U&J7-;ssYhEq9>3~l!|ca_C=5q2hs*&IaH#Z#2ccJ}fSL-O30V zpb`kF`W)EJ&yYxkBWvLW#UwO-SNH`TB9ZFcFz?%?D*w6nmoM0nt=lPF87&VZ>H)LK zMYIi}9@Vg53&uHqoTdO}7(%b$^OF`98!%Vdd7()nb(P7e`x9tg+H8M`pW!W=GbwX7 z2(GX_mo-I&9hg&$Sp4DrgLsL~C;j5zz*Zu^1o7Nq`fe7B=D?t3&4Oxpx1K@<2xB)0 zZcwBk?lqNCS<-;WH@i5*iBy7+jc}y)JWsach2$dS6zYAIp4Ik*ScJ^;R#0K$UL>&D zp`mho7j-L_=Zq6`a);FL#r`t|_Ad;$s&Fkgso^;&NJ1pg9#t*U_)Q382@a7PJ*GvX z9Lja3WbTedxzj#(o|VM;?|KL`1l4jrj3Q!h;KMm zld;&J#dBb+ZwyX!F&?fu&uZeT2q0`p?*peUkynuWfG=x*Bj(92a!cxd3 z&PE~7hi&oBFCUmJ+fopTux?+od?aYL4uM>;)?ojFt~ftH0Xn6wG^bC&u)J=Sw^kvI z0;s93A&*f+BD|$g8=4FgC@*nBa)fsXKplEKe+NZ;2er+C3FpB0{`=M8A15pYQuL}kpI$A^-@BF4fZF*>{}qe2or3DV5AU> zM9CR0&fY|1)9Xt~lEPLNI%F4AgEwG^?3b)XEEqXNHv2Chszp+_5mcz$tkG*>%xx>C z5`q_kN&8f%RQ+T+r~9wL8Q=YggUFzzJ)x}m?yKj*^|&Fo7*=3>l@>hJ&k)%-A^K&H^k zb1&C%Dl#7~TbzfO^?5;`{h7j$*jLv6!mR34U^Ltf(bYpxIN65k7?5brjJ)(;|1wC@ z4NWz>cG7vCXf`E}((NWLo_$QQe`_GILk|7gwkNCW##z}`Z{rtyb!l~ReejwrpR=fp zQ8Al9HPwXGI41ee#}o-SE+2%YI4u^Z>CLO(R`2L1Pb+rc&y^SXS#>?xkao9l@l3ae zWwF70-S-aa>K#-+2j(>g=J5(aUbvj)%^3HIWOe~VTI{9k?fIa}Rofa_Yf)jmW>aB` z!L`kNt9RzpNm(z(yG?sk<#lJTF41w+XqAfEn%AzcK zo~>6i*CJ4U<_`}(xJJIz6^U(%U-5c@36n(-|t0JZyY)3v;Pj}S7 zJ^r*oH;kyROIBQ>)0n;AO7`gKoZ||429+u#jR319#o}? zmhHY8>VR{+)`5;O_C8poBS|0Y-*%s8PE*TSq0Ckr8G6tgG5E|mY)YB@0H^<%=ztsA#Ni*;UT+wO~vo5QkNkU zae#9z=ZD0zKF6-PvL|+r8Q^!tN$oT(uo6SYsBS-`SZUegvb?Ku&ptV)RRGS?nOgad mqCW{LdkCQa*$e=f%)mohUFwf~t0Ab1ZWSeU#S#U}(EkS<$Smdn diff --git a/doc/sysbench.update.my55.tokudb753.loglog.png b/doc/sysbench.update.my55.tokudb753.loglog.png new file mode 100644 index 0000000000000000000000000000000000000000..1fe55b07b19ce7f015602de568d16cd3177cc3c4 GIT binary patch literal 6899 zcmb_hc{r4P_rGTlqiiLz#E_7P>{1L_lO@@Ok!46@-`Am%JxgRaWG_qhC5%*-EQt^% zQ$s=+`!;5N<9XiaecztzeXr~H$9rA(-1nUG-Of4Rb3W(X-#gksPm_V3lO6y725l`h zLjVAy004xeqoQ!YOrm2HLdM{xkvf@7rf|?`^w9$Y04OpBAOkBa7#Psg1E@HEBV(Wd z3Wh>`e01yHQ4C>Z5Jq2L%4oQyh>A4Wz~E;t$OPR3x!6n)5;fyP_{nSgE> z=p=UzV5)=3Ffl8)Ny_w+0W%^MtpSDIb+m4d%0&+^(HNR_y zA_=S(SR10+7`HXtL?=(s`WAbUH42t`%0W|(;?Ii5Qdjs`OM{96D^eS#Zs@N*c3Ie8 zQ&m^*H6asZ)xO@BNeB6AkC`6Ft%1rhNL3B}ZKi~*lezjo zyN`1)A-$o}&+ysgyOYI{YeHp?)8m7mO9y-uEV5ob6{&stRJq@K>+N|&%5brD%rtwC;kH!Ha8R?n?b7Xw51&s|sZ5!MSjCSkw(*un42EbD<%ZK7 zkU7%~Tq{ulkL_6CZu(B$F01#|KQ%s(%5)^klN?)9et27CIXpE!UEF>~Lg;GAXLDs4 zD{t@W`dMYG+x2C(MD4D|zC#)8(%~u5GJd;JaHLP zomqakXEawimL)rD#6<6s^?4QRlpXYiwW!gL1#WgbqiHhpSJr@eoMjAR^qb+V&an-e z$mr!CcXbNGcOkBs`Jtun-J&30U#$5M6<;8T7e?_JAH-psgL$}in%6pk@`Egi+q2jU;CP{5CAf1m%g9&V0}NIv!Ojp=brJIdzMeXe%<>S z>J;Hq%UvM%KzlzNc=nxRYo`?UCUzy{H1GV~Cx*6S?&r29YB*!+UOd?G0_|3g7Njh^ z)dXkHTv9jV!ly*FI1UX4i(=;F^GqrhePTLI(mU93lZ@nVxT3LLH6vpAvZ?3j#2v#I zZw#1XCEE+jrGnft1FZt5KFEr&;q;Q8ybPl_xXL{Y2zha_v!PiUd(a$75JZflNU_S^ z&2{2=$kuau^5yrR+kIbefE?6Cir6-YD1AnX?a^}F|3w(&8lAT^+u(J}eBlxj^5Rhc zjxgr1V4BW7=+VlmR@_R?XZu=W_22Ybn05Jn?Fjr&v~p zAJ6M%@p&`;ps`Pc71tt+kEs4xZZU}%<_b%Gk-O;lh2`{<+i3Ci^AGmGLJ_fXULHQY zkwAz|B~LdzM7)Xj;7&tH>5{?e?eA0ZHzU)UeeDo-;!U+>6DHleS;bSK@*h^V76O8= zR5qURSuLA!B^6J3$?VUkwm|xn(Xw|3vH5$PMd zxqa-Bj9ky?V!S?5H0bOdO{1%_x;C@zFe1%hiF2NH_VJJM@Oj!7@7eA*N-_S7#}ukcZ+$Gqp}UR5`UU9li- z#Y{>Kd`E);3*=oazr;-&N8KdS=a4?gZXzXAV&axII*lpV`DEm&vv#6yTb<<2Em4|h z+AM9mc;+pYTlcLhrafQZ*yOqOY`q*KzFPFo(f_9#uDU{Ob%t5tiPyVvYiMERCI0_{ zrqd7elDlc2l-y_bWDNB^t30RHcZ^Ty8)AGdWwMaM{ zZ9Yw(INg_pgsI1<-av&KW<8BxUfAPs3~u_`m=R)ETgF4weXQ}`vO7MwH@z@#RM5dL zC@?gVgZEP-hws%xW_^@S+oDjt_Lm7cE_TiUHh+y6>EnYxsBRMJ&avc(-5s8a7Ceu( z<|&co>WvP&;6EOktKN!Cd?sDVV7qO?c%w(c81;B3l*`{VAXh!BY(9nHbM4gr;mnDINe7Jnj5qo?rvio|Xay}lJ=p(-cZ<7i;$ z{vJ3P@J% z_wMGzul128O_%*r0>Pn6&_$-ML*wIiQ%{0$+xfD9a}auh_h7w~UlQ61wD0psH1tAV z06rXeZvQ-fam(Ws;CI^}LgRl0VaZz2xT%KfY*EcW9iG+zmcCWf9y1bt&$RoIklF$= zC2(L!t1rJApeJnlmbqohe6A@U+Egh`_AsVG+Pri+d>@Q4K}|(k)*UVG9$zTmCSTT) z$VpgIGt@pdrq+ytC{nRK>e7B2+&YUVY zW5Thm$iX--9w_m7L^M+ZYRXP2jMqm@hEKrREbxXIznuCQxNuI!UjYm z?=^W+*X>C%w95wj9Hi|A{-t}s16x4s^Phurj zG*B_Cka~2nY3poz%Kbe!q0;ITe|_s-%&7;PJ6;1{4v;vjqC)jX+J$+oinv!!FcAHA zzZ=shgjVRy@Gc2C+65_rFq*HA=q+c9eDxDaWqf-bol7N#*?=44Cnm4>K_%8?vSmmM zsqYjNmPl#`{GNopTP<0tf`Ptr74n91=d@kB9IZcYlLY3zm>CqYsn6JpVDMKm-HKR+ zd{UMZ$V0+F55-y(w8*20!P^n%0nV(~=e0UY6N90MAa~IgA+0>VJvl17VO^E|6TKZA z|E}I|y1H`2>gjE%crH3$MbUWib8=Zl^0*{>0J>AlAQE3V8Bp%;%~a%^qfKYsg&w@b40 zu)c>-!_i9RTmoIPl};_clp{!XBat8M`GRse!+8gNl`Gd5PBkGiiOM@Onj6dDt1@6^ zt#_qnD35(hkgL*HdUv@;?8L*6CQ`c%3Za3c_1M^I`sn*o!seZov@U5z>rGM=e%K9@Ct z%EDH>40~BuDX8=0G=in1w*y4~vCDaV6$Reh^UNeFqJiEDTr<}YKR;b=>zXKk#6O9u znxC`5JOU*qc`sK9(G%<1II9+?sPsu}@VjW0{e#DIzuFRxzi;kP=5c?wtg^3Q*cu|b zAEOxZ2twF~9uCp>c0kASB|s(=PYN^8BAp+$2F9CJC;7$eDVsiYqL(b^`C8PvlhXi| z^&U2@9D!x5(gehd=80$9@^e_ap!b4`Y1zDe5Hbw)h3`fqDAoES=j12BH>jliK zf@UEta(`kly+Oo>z|I}&g*=XAeb5aka(F;x9}zhlyAvUfz6$z*abAC?;<-bYsGcoo z!vpox$C1WN?i~s=5P} zLQc_ZpfRa^$S&*x>@u^^W)Tnz^188M9gUD$7XAR^RUNd_njsu8MYTnxHLuiZB#TQR2|>6_x^OWEX#G{ zu8s<(>6L+Yy^5mtUvXqFgfi#+VFtW)wc(E#M7=PkpeHJFICbTczg`^04E?t0dZYm7 zw~ind{xE1}8{AW*R|dCvvxi0o?awHX!MnyiaZErT!-CFPif+Sw2TtM~aOOrL%I9h_ zaLrk5aA=_m#v7qOWT&A+(+k@Jg>Rg?T2HbVj3e~gFF`a>+_cnq1OKwuxi!77PkDCs zzhZ@RYJz_$o1u_H9xw?{-peh8x3hG|`soDaMEB`_(Fl3` z=eF-KY397Db`f!?j}yqc`k_2c`i)y)?*|_<@hGjQf|xOT?l5kO+en5+WbJ1nROOki z7!~y2UEq4`-U)-wnX>)`%D28%00m`lppRQ)0qsmoh$5=}+{>$U3 zhp_)59_qhKvix@2W7cHXh`af;(rHas8bX=;8aEwtut>r*{okPB2q*08K$>b5ub`1p zEPS7Gu;Uh=5>etwGp0AKd_c`hG#{>m*wlXncCr%~z@l>P(pg4+ex^4QS9gzrNW^CH ziY)$=Rwd}OLk{yAcO|+X5yyx+%2ewYb}oFle-x9$EW#aXlBPG3ZOWDusm*@fPWw_= zb$Wc^hF3+C^u%#JL9a7EVm?d0^Mb-=8P#gpZ|a>#wBcf8pbA_Kpxz3B)>a4cbh(*}sAXEXh~LR#gmSqrP-9x&|9j5>|@F8Qf=Dz>C5=!RZTc=*q;x_eg| zy~w_@31({T5z>A;URM__#30gveTA=ltfqb;XD!v*AL{Vj;MA85^dEL~!`Ef^lz2q9 z8WUTvP16N;cKsi-Do7PFa%b_Sf(4%RWboBrxpIw*MvKQo`zqX;i;#REra+9FM!w%k z!ryz2&8xRKDdkyJIbZhSF?1E%&j8q?Y z29GV|?$3VdgeD5w45u2P3@Hd+L8C?8>)UYYGIuPKIeqf4mG{_qsrtgpj8{SHm%UVy zpW9B0VH-Xcwa5=go>AzMxW}ac1#$s}&xue;ws=?EEb*mNdgKyKN=m1fT&}tr^HsldzN%5o3xf^Hoh|eF5(*jFsL}Qp zizgNN)Dq)7U=`l^T@q>uCqNB?_+7jKN;%3#cZMX=S zx9p!Y;?32lJH2*j*w!FS+>(>18L8_cG*Q<*#hb>G9jPgEc=Y}ohO#p-j^H4YdqBO&!&am)fznmY6gHiv{_Gh9feC>1wOaqthH|AiW zrr0raH9C?H_LQCBIvVqrDUJl!=84KBt($Nwq*9=>vfq3?nz?LnWnQVr(YbRYpBNKC zH9TuVn9gxy$&(_(g<+l-k6s8QD8WH2{buu?Bik8Y3p$0%s}Z*$M+V_garst;o(x%~tk<$|gvBkFgw2Rv&6KalS5hTS`wbzo5^DDU+*B!^ zYN%xKk93kGe`Yp4T&>QZkveLfzknQ1H?Ml~f;j)a4dI4s$!qOC@*$&m2P>3rPS=oB zwSSiM98eK>xrS^C=z7sZ?)$6`1=)a~&kF-R!>K(Rs1?tezo>b1WmmJ$ZfH zeb#{DMHJJ4=>Mo$g<&em(-q)ChJAXFV?TUE8~(8DtzR_0HF;-{iiiJ8JxP6hgAMT-HNF`?Zv3tui)q#{-*n`2B&>xUy98*o49cz*5 ziJf9!lG|W-(=$FO7t1?#t{SFxcj9OKyZ9q_LS%baTp#D*8W9=>Yc9L8GX*R?oQVP{ z!;s@voG{Y8H0cCSp*oC@M5U>H2Y@6lHkMy z&vkmfYiIK7kr=rkK0DV*2J!+NAEiEfQHul#Rpxh5Xq6h_<_*Q8C@jEhr>Zte|3oTP zI`EkE@@`%OH*P2^x&s0sQs8l4*AKbhg*k@9x~{SRB3-(g!aYLM}g%Zt}3^~{R9pUdRssX_0RnPs-5 zsirP$d~OZ${_?o&S_v!s*7WSkWy|M}*^%2y;Kv%d?<&A2Y)pB>ub&(G&PBbu8P~=% zelYq#?p|#@DT^^at}%ftfSwiifyud0U}zFmC|sHLwNP?r@u-$18mJB;Skb`#`m>{-ZT!wD!FMTzr(`s#cFGV2D1mrs&>)xK)(QH={`A38 zYyB955yp{$pw>_ss;7tkSA3>F?;&g>I|kg}SDT8{4$dz)PPpqQ)VD3RemjS~_>A@f z=Zo+bChDKQ=>b&>$MWksPZ*RBk7QIF_AjqH(=6!H?r-dyF!A3P*&$9qU0S!<~4_`PSY@*CvTNM`Y8FuR&kEIT;+$=Z{5<-7fhslXw=uKuzL7|+uH z(pF{o`9nE6!7qKUmU5UmFH=9JqY;?tfVShR_Es(Pu>`fq!lmk`i9!jqNQ{%6PwoI_ zd2NHEme1@;Eqs46A=bzRw0&EDeB0jVZ27=egrefxnm8(7F3|o)B$dw;*ER28pE(Vu ziQ|Hw`O{TGilshVpuWkYxy&HtF9V{6Ru|*UkAKWVoVw>-k>-I(z@z^5g@m`4d@*3> VQthM7Zpud(KwDi;tx^>p@qf163u^!X literal 0 HcmV?d00001 From 1a7a60d1e6599d8643e766dc31e505dec0943b0c Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sun, 21 Dec 2014 10:51:19 -0500 Subject: [PATCH 129/201] add sysbench update perf graph --- doc/sysbench.update.ma55.tokudb753.binlog.png | Bin 0 -> 6723 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/sysbench.update.ma55.tokudb753.binlog.png diff --git a/doc/sysbench.update.ma55.tokudb753.binlog.png b/doc/sysbench.update.ma55.tokudb753.binlog.png new file mode 100644 index 0000000000000000000000000000000000000000..510f1811e5ae79236b24f4a69f07359cf950e8fc GIT binary patch literal 6723 zcma)gXIN8P6K)a$gx(3ggNi^X(gYAAl0BqN2GTMq7>zLX%LW(RY%PWKlR_m@LP`!=s>}U~Fvc>pwzBbsZJ!>!b+)SsUO!`4=S;BO()H`S(7Co7>Xf#O&aESI=O7kZ!#mlne0k|KS zABi{M=8s@#b^w~49StX6Xfy(gMv%~F_QOdS@`WH_JV{tAiR=#vJ5ZlXBoQ%n10AG} z0qloB5*$MkYHMqI{ra__pkRA@yPcgK9*@`1&}dihLy~=_@zk^S1^^g8oqd6+7a4g0 z0Iqs{ZA~-Z?6n-a%+mAB*B7z|C8zn$ucPQh&qE&i$U;LByq(-LxyrP*sDXwqJmhKq zpC5EP3%6JPuS4t?>WI%0n+&^sxz&*N$uFx5eJ_~_M0@M_#)*?ZH&-{AfK54J*~&f1 z_#ZYrt+GWq%9_^stY1>s)8`JSVqQ(|e5L9d(xd^F*m(zGJ=WjR*02Q}-$MtVBc;;g z*$Eg_faCC&`|D=TBBUZ^k*RA2V>_Gq1)rO z)LPX7IizC-mG&c!$TGX8usQ%)T|%Gy4_F9@XNkDVX9XhM`3JWSm*##)s;@1r>dnb}jfIV;gH$>PEu7op+G4z@ zi$9YBjp8ORbW35~4>`@0d0AQ+W0acG<{o?xv|Klmrp_y1l{sB)6OjsmHN#?dI7>9k z!INK>_MA&09PH0j?G`Dx&&(_E-i%2vNCW)ZavQpjm$u7A(m(Aqb9iesk|Bt43{LcB zthcWe4dE{gTo0(xRSx19@Zx{5W~4^{sBgwI+Z0^q&z-@pc3}n2VZ8d%krSa{dE{xDq$%XiyCgJ3sr zm9KPdQnR+6a0bEFJUWg=%!sx|6*#-X+=aqPFz-*FVCtiQXm*~U>Eo(Gt2?`bN95&* zkrr3xv@E_Z)jj$m$EyKmWwQIG!vDheq89tIdH=@j;;~-lzBE0B+mbTPM{ZnMh@6yb z+fGt%PL0uh2btS@Q{1!$1j&S2Xo`MV?MJ9?^JT&!Cr@4+RUyEdmUh&#z>h{o)^w9oP@%>or^R}p4Xxc+DY+U<^ zNEu_*?EsI%XF;QtYL5(~tkCU#)^_(r(^DV9=f0WsJ6cbFtJ%26FdO6BKvi?6f5>yy z!4-Acq7dPzQsVYjeRF9{he#q{onD}~Ij(i}!qK!kBdDQ z>PZ{JZ#y@wA%?57HWEs&pPXxD+nlM~S`eL>Ke&dT`A|PrkE#ViNn3J?4uyO%HfE)q zqBudjngT)pBaa11cEpnw&2MTfx$Kslp(mRva=IRzE3M!1)+l^t52|Rl@f~gHzcG%m zukIxxaD4isLOCluoj`$1+R}w(C9`lqz5v)LAjG%ry$bfRdlKp2VvCEx`lw z?rW36^?EbNSNd05y>6rD=d*m$Hou=lV%%-jhE_}(etwJ{jB|Rb6}i#*7_OH6A=`nw zhV?|1C*iKOuv<59Ai}oZK^;*$xuqSE&PHkmynPIJd~~_9n)6Lp&d%?Xif&-Km$vke zVu=^vhFG5OmA3*)nmqYr*$F>~Q1i-b3B%v)wN#zsXTalYdT)=$`yYS)_2^i7e}ho} z7>jAM^;@EtOMO8-b5*xx2=pOu%SV&M0)_}CZdg2d0|#KZ2>z34;&VVARdCz;Pf8eccZxasnFUP2_!=zB)g%ik!iuoiu#$G&X0;f2 zS)P-D>>6^dHh#GkKbCyG!hUQ!WbHwNH*V04ZK1`n7BgaKUA}U%X#q1Ey+cdHAMAOF zTQipiI;8a6ex(o!xZggPJv*qpYJ5Hax%7*S6Gefeec$C zl!L?qPi1GFU*YY{&U-blwtl-=kXuiR&qZ&90#hu704eTJRRv9?2GtD2)mUetAgrUyuzVBd!u z&DvxRVR$?3O`>(;BoxsiiF3M{*MqFtd)B>oto(SMa1jkq-cPf}OO*l!1f^iR75CC7 zB_hTo;YXlprG+;-;U5)Kf40u?-+73=}pMUzD*zo!SNf?k=%OSHV zXSKfN#|3mih@&(0Zk%p57C;-i;R>yJC@IPU_#H~Hn?uiLt<7XT#)>f$id*eicuk)a zIyW;DYPpunH!P{ZzS8|quUh489SXsVXhC5m{~NIPyr8Sl0EeC4-9g)^kJ+@~2BBvu z9^Vpr6DY1H(8}8X^3G{a&_vU95Z9AJ)*`jL9Y0foeN#GIzzvBC5~woT0q1qb%u0+o z@61b43491Z^iS73ENR;zQ_(?A*XWcU6id97VjS`6SUlQ5N*HDznCe2?HBSOp{GtS2 z-?n!Aldk8Vck;=8Yp2#Vx_h2<>DPoH=x&mtgof-}Z7J;Jb10%gk(1zls(hSnhk|%s z>w0x8l-!o%L={76r6NHB?bsn{vTveqUlGlsmpicM^~}r~%sMhKx~fQMY~4tNN#N@a z0>w^7lg45iJwDCjsMH(x`2T#K_xZBQ5l_MM0Jiw0dmcx3wRz9btNv9W*jKKkd%k^| zLZe|y2p#J7Nw!kcI_2L6>;;V5 zAqiGjeqwI9oJ3Av8>mfq8@q>ix%(p2Aa6&|D?RVG8ZFT#Z^yV=Iqvicz@L#~^f6;f zgTD5uH09)7nVMj=xYIyDsCBT}t|nu(KtoH+VdfO=u%WS%C8Qj0@>T%T{nWth z!$GLkTA4dU);TaCj``{RQ$(Zs_xfoc+W}2>V%^>|+q6Ht)pRw2BYVxi%uCEG_+TLo zD<8%iuT;kRxrO@fg_^5UiKIz>Y|%~bwDDz)O6W0G2_vYvvKqCz%ewFnhh*XrnZs&G zrj>Vg&rp@xbd~Z*0oUim)BauJi(fl?ao)~aT-Wh#&&B7yQWK2tkz_%;=ug9kCM^SA zNO?NhrY(**CGAee2V`>1@FBAL!2Nz3xOq_x6n2SL4|5yBeCvWRFlmO0z3&Rdm+zoG zSR-tzPi|y4AgTy#-P%ccVU%k0*{JD;_!qxOy5vTx?Q0E6^WGXa`_=9ys^RG(=+J;X zNeFXE$p80{ECysD25opc-x42Y$Z@Zk4tp8gtu~!zM$_;8^NHVUoGv=yoH@v0XRmo? zwoYsUjhoZXF10hh zBeSKj^TpjQNRrH3rOU|6W8Y9}QKl`O#YMt!(Hyyo;4IW{qcq!iSQXwd@F%}}U($1z zy$zU+YxSi4H3gRjbgJ*eaC>&Cgws%c@|=5?`Ry)&TqoUJ1e+ zpQze^cw_8N;q-cyLPk5U0>2kB6%4B!q)k}VgO>&-|+mJz7aQDFM#6 zNy%Zw6>TYPKKE&mrtSjP4ukVQni4agQ-EGB!%tggX0?wmaqsxdv$}Oz`AUGV?=0Z( zNe_68n3TM=B|$A>+&jAJJ{5-R zrNAc`OTr*5ggO0mI1P&kw%c0|WV35z0=CX$1N{#g|H_>O8f5yJgUDF_4tx7CWlJY= zwpgWzmQ0#mIE_>$n%(8L-PQ1=BNKk^XrV61(%%l7&|Y)63jkX|=F_P_QWQw6He(G? z=kx&VaS`s{Q7lGY7*^BpX$y4X7qTDAevwnjEk@Upx_^@G)lY?|2fQ1<_79drOd#xN zd#=AFgYWJIeTzSgKH@>;4JOKmKWrYqBU_`YLcir++pqNxa0{UH)?}C#+QT2hd+3nx zB7-WhSS#W@VD4YQC!>jv^1NYOf3z6>?t)Y^n(ZyT@*KLH6{i<>eC3}YY=pINzgWNX z!$rXYS3Gz+rGEwm!%Q$0G@;32nD(exK<9g(obXZWr^g$fj`^O61G8@1 zsj7&7Ifmow!jf^x+8*mo8rHM@7EjH0>nHF;1ylDn*dMkTb%u}J=-XPYIRbf>TQ}_Y z0)Db>cv?0<>CIKo1C3QU?~7Z5T3dMwzh9o2eJ`flx$WP7(YoYf2I(P`z{AHK!7}9% z0`qGZfyhRQQj9FGsUR+FSb~8PkMpU_$~e-$pxA0-9s`r7&{eMA)7~|G)eO?-i;h^b zhNd_E;uATuP(BP>M%67x^ z4&&XBBc-K`L{@TW@_n>caqbz=RV{Qv8`%UfkVP#n;3hpd7taK z3JM@3_V%Aw87#jkU$Z$~N0-PdfXu=(STK_Pu>f;>CvXw1f+*Zv;1V-~^Ss=MtfxsX z8v{k5m?}>}d*CJd?4)k(PONGk+pVzI1ddY>Fm1L_6QwW4q&*&CG^~8Ddt(UhNsfOD@3{8kTday--DIp^=z-T9?J4gzik~5@42Z|m<;r}8Fn?7U zr&?8_xNz}_hOt1(cdCAYpR~}Q!xMN0t)lvBvnKjhw}LO8SuYF{m-*KX79Yb^&(-kn z-~#^Ibw9YvQ7fzKXQ1Kztn-WfG7y%L8yq5U@+7sjubIDi5mBP~DCVPQ>wO-}(m3;K>_^13Nqapik zJ`D=JDKDAGrA>?r_=jA!RL9$zyJtHn$G98Jj^E{qBsF6{0V(NCc{D5ME0vnS# zIUg-x9WxAG^dDYBV^xIAD1m?LOSd8MD1*hoFS6MS!}f;vq7vXvg-g4`kku z3n&J9e5Rz-<0YE#At}ZMsq>+M7vuE_?5&6fHr+z!Qag%|(LyT3|Mb`jLdmX`g zu>EZH>u66CW+AhMWYGP(&7*%ChGc7W(`yC;@d9i1x+v84VCJ2AkqW@ORH^BHq{1%c$J+MgZd#6?H^f6 zenC5HMQ$}Ryb9WcH8AV6onoNVghwq_{jXA-wG?Ls!<#nI4#bx-Xqr=xG8xt>s}&X_=1prX>#X zB)Yy||D;d3@64MRb?W{}m2$rT8hg4<7MeUh_${tTh-<(ATq$OvR%jA!iRCJVfDH6+ zx$N6$2AqdF<-dw>w9L7{|K29ZPwAC3BFO5ekY{?u2!spS=IGxW!rA)h*+~UO!Znp* z@}yV8$t<=+N0m506xLs&kVPm(SUm*?N$h3L?R5q3I|@=3eA~NZB8qL7xQ0IR;sMI@ z_bU{`;1fp}hJC$dy5UC~zji`Fg1SM#rWtBw4FUZi;9x70d$4-SAt--u)5Syx?k{Ls zPy(=f<9DKL8?+Rpp8j1C<9gESa&#sA3n+Uh5+rE2VEADTz!tiLXgdcl4oiNtF%1a5 zY{!NuynF=PJq5xUn(3+qbk?mmZnmF; zSN?Kug5K>K3oW-TDtbz}?}&G@B%}_qgQOgGEOpfs5f?0(>iqNGjJs2OoI6MZ1gN&v zoMhbvgbzRCyD=d{rJiOIwWD(BztaG?{%*)NDST$;j+v_TN^qOylJuhNTA7oy=L*$f zHRqW1K!E#{F^l&j;qV_qCn$SQ<-;oLG=u0#2S(h?!$Htqx%;+|0(9)ofWLd+%N<|2 zF4nTpZ4wPCxypKdhfikyY`XGAsSlNiw{b1y^w*)K))P*=ah*nZ4Um*l9}lsbig-GACHc z`h%z{0pVtxy_?OGMX7r_=terJ$O3Ho!}3L$66PRpHK5Jqr~E*hKODZadjt1Ig5FJ`&SWL~{~XA0fw_J?X|>Y11Fd@bL0$kf%WrQV0* zAf_#$i2BsdBC<(EUv10|OjqQpsF#kO8JP4{n`M7CDzHRi=`8|O&sA~$U4|1C#5&GD zaa!}R$)|IvQ3}T7?ia&t6i}*4r_MX36J4V4dMfy~w!q|nQTXrQr0^0qZ+VDYl<7j? z!7P8ndHu^QGK{`{`SJ<&zUr=^Cp4)|)F5!=@=Mw30xO*texb|L7Rp)Z*GIj9>Km7l z%f~jFAJt2w``7(@fA3bC-k)^tniq-~R5y`_$ORq=3#jm3r&wc#47=ZOFI~1sfk(}_ zUe6p_mGHRuLD_lxh~cX`=cw{-Z{^K#r#|%uKy_{$8YjYz`9Y}r;^dz;Ui5kJWS%z= zw^jG!11F*7SN6z;b7hLzw;y0j`wuF!(xBM7W!XIQ^I5JbR&=rkQbz}TO2}s`0lk!5 zGmznhO(sx`@6cin;KZ@F{MPg5uH@EDuL!u-f9_^*%y+YBHPH6aPWgC@=#`=I;Ss99 z%Xy%0HhpMr)1$_PN(%T{SA8DM-UN4(fb0Sn2U8pTWB>NaP4~%opj(kpH o^T Date: Sun, 21 Dec 2014 11:10:53 -0500 Subject: [PATCH 130/201] add sysbench update perf graph --- doc/sysbench.update.ps56.tokudb754.loglog.png | Bin 0 -> 7008 bytes doc/sysbench.update.ps56.tokudb754.png | Bin 0 -> 7434 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/sysbench.update.ps56.tokudb754.loglog.png create mode 100644 doc/sysbench.update.ps56.tokudb754.png diff --git a/doc/sysbench.update.ps56.tokudb754.loglog.png b/doc/sysbench.update.ps56.tokudb754.loglog.png new file mode 100644 index 0000000000000000000000000000000000000000..52985276249cbc540825fbc52240ce057e32ded7 GIT binary patch literal 7008 zcmaiZ1yodB*Z<7W-5{YfA{`>Bw19+!5>jKpDBUd#jnYU+BLWIYN%s)aDIEht_b_xb z|H0?^Ki~VV^*!rb>(0GrpL6fI`~3F)?Y-xo587HPB!mov004kQO;t%3002P&03ZS% z3)2H4;~U2aBH9|yl+kE3rY9>a>*fLj0HA0X01ZGQVRC@3E`a>I1vHEW0F{G5(L!Ko zH~=6A1)!m5KlErW4-e*1Im8g=IR*v>QBhG%O-)NnOFuuq(#4j5Gcfd0^d zEx?V6Xu!ZQn)(ykPa6e=qLl&XP^XPVFVt#8W3_cn2+`5eY!;LSoeMw)Amafe@GN+Y zw%l`TK`1o)fp%>Dyyo$1>MpQ zEA>IkWuaM`nwsY4=grN{Gcz-pnVFlLn`LEX!*q>IFl#1oP&IM}07%q`8%cCm@CR7GtkA8rd78^rey)TNUfMGCpe% zxx&AmR5>;S*cYRvVtYSCj0x=BZm3~8S|>^%2mAd_tXOm{Z=y*&eGKhYD@Zqg>wI3U z!`?wZ!aKtE)at9oTIyQ@0X|)*)nZLwpTVU#CFs6jv{XysqVW>EyR>}*iGv&ODhY2c^E4p=;eD6y(drwV|^JwIIz+@y3?$nSNGM$+wq_`Hs}=%h|@I)rcgj^9_YO zMaCV1{=}O2=9Ja+dPz005$hdYctmcoinS;_x95kum6Uzs=0?|%jCUXMcbX3S!mshl zeu&pAbi}XoiOSl9o;$iFj~v|JidpB0s_Pg7wcPK^9=DAdTzL#HeS7U|7I}1i+PxLh zywq&fV1Kl}Y^OTOo=C@62)Nh_a;qD+`=NU7hSDF=u&=*l63BGp6X7n{cQz+66fxW1 ze5~@o)S)8jMQ>(FzAm0yA80$T?iU|YJ8W&z~HnQjtM6d)vuid*5xNw6DO<-b!d7cUpSNWlMRwLwn*W zZFJ8w_~}B)_{EZ$;epQFhY?5QYq2>+@8h_6EBTl`56jQxy%I87o}MIQiJ7@ls#E)P zBcuMe%K?S8)8<;wkFC<*DXJZzUfQPGUi6qArIonPZKu z4VY`Bm-|xo;$9{nnAZB|(Lee)cIYoO=PdS6%a86z!#vna%DD&?2ti_dJ7Wdo+8YQC zJex^_&kR60m&61|kWRBXJe6j8xun~M*ppgkl0bc=U4$~}@6AvKo6Br7WV}1nh-$?1 zvBAPws(Py4)zHvZ8iS4PCa*(2L>y!yntph)N$R=gnP9D*cZZ}=1^Qahx?yr5(XH~t zXD@V1sz@sNsShV?C10J`h#^UNlE&M4)f!mbS=(Us+}`<6*Y`{dYAijQ8mRYTNknJi z>mAuRD@y&H%4hBm&em?5O}~o&YW#@ADu2o{@w!V3DxmjO0eI&WM(KmP5=oWndnD-9 zFxe8nVmH0kdv_{1%>--Opd)%=D0T$tw(Z^evP0g2k%?+ZCA3z|SxA!I967 zpT-s6T68~h$7Hg1FXig%M%B^KkA$jvsR>*cvIk$*a5FD1rR z=nG{1G1NCt-+usatH`|ABWWV9PxF}G@qMiqL!fIT!gupk-8;*N`M(;$N5MO!9l)KK)`E}Y)||!t;R_DDL01xpQ-!bAVkRX< z2hP~^CGN|WfIvr>aLER#Airy~BShV0#l910ARUm1JWQa$cepK9@jCZd-&L>^I3{IT zeH+h2wj*5U!H8wIS^uN;q>_axk;Zow0@Y6aE`JKFRDal5~YmFvHN4aIod}pQSzOjS@GG{M*m|xf!*DGqVfWwd|)^^!tEf} zRfURVBddc0jFZQ!kU zCxyRDQ6lOcVM|z7jxeESxCEG*8nN=G3LlAU*qtP*M})kl6NHr!klQ$;;V?LQ_MvkP zqtF9jiZ0hyk_fRPxW!pKLs^Mj#(l|13Hu)bQnCIuJ6lVCW@%JlFaI_f-tKfRziw!^ zy9s@cpW$-ZZI9wuz%EZNf1S9htUS~rLK%xt+vDx}9LxJ=)sW>RDN+weOp^hJ;y!N| zgOE9eJNAZmvL90%dg9B1W5A(lY-;&n@NzkBLq=L70@INMF$QK3c0(Aop~SRs`kdWJ ztPn^hem6wWFkq&W%U+=Ad(7ob`g_<8E!+m6xNpDe7H;<->!x$}80bMuA&;7kgiugm z55oUTaH2K+d=UO)G&A_S>7u3^C)9m|&Nzqk)2>7mjI2#jmJYFD&`jJA-Y}V6$cAc* zUEl-py%IX#!tv0-zSh1Q^~5FIB(gJg8cl%Y2BD95&h)T}U+*`YL&t(CPUl{o=)Gx8 z8F9qE-g>^j)`i`%ykxp|Bugfh|DM5rm)~U*r^aLWSpgwC%Df~_R)x!l_7mFv3|$t# zXN$&)p z{c3;DP8P>dU*pm2&No2s$L`SjE9k%4MUua+^aq_$e!sL;Qq5%4H-GnyMGC1+p|dEW zz{6-Vbx^x$d*p$%$}S||cbNMbVoaX=sQ)%@p7hd(+A)KWf~{rB)IPpP_|eld8k~&! zJwCPoL@ncBwr=;&Yt9>)Cy|L4&{^l5#@1`D@PxgMVSTtws50?>TOde@wO4>VA8UAD z8!7=9gFYr=ppXN$LPv48&rMk4s96ZL8^LW3d~Cq~m^a|;X+u!Zd_aQ8C4Y^O1NLN! zFk77{efGkB-{DUZM>>Ck{15GYYCUs@I#kcPc)7(Y% z9c>RDICikbsU`-K#;MVVxz(p|uGqSWMKU+3rIm$o1m104W)Ql^@;o@&o)W^xmhU6a zC}hi$0t#B(XaqCHq}(URV8F_ZNQ=m+e_91B=L6`n7-4i^-LWd6GZD9^x+o9BR^3ch zBTyY{d_t(2zCZ3(`m|XSGkMMd7#Ic2S0pNpB2_h|8`+FV!A+g#&@xo|?O6)gVX3f` zAPm49wZ_#Xba&a30@m!>GbAZM!&Cni zGyf5IpuppeKjwJ$krI(?s@d%fVg#AtAAB4f}FksEyraH|DkY0rM^e-c9O_$J=8N>ZOi;bCZvB?kwYcew}C`Qiil! zZDzuYXA1;~_K7~_+DjrQRgz7*I|03-jJB!~X?@)-GAKi@^@JzH{O^elIc4hUetfei zt5GN*p8q-bPU;?Sj=o8TCh=KivD`};7W~D+EC0A#6h)H6>^CRM-`$SDL;?N9s68?+p z7*Dz({yp=Sx-|o#+RyRO(WXKxH-)ZTjtDHPTuEX@0WNuHk($J{j5(X!hUe;M-o~6y zD4N;PG%CvIQw2QPG4XXli~8|B2!fa*pBl^|JD(*hcY~)^)Yy1a_O+r5rn>nSqtCp0 z|G?!2+u?idIQX@{)ujk*VJ5sepaDHe{~ADJ=NjeicGGxVh=)(`OO>hvY>}=;ebHlDs5=29IODjQ%Q) zTj;^3jIWp5u_}RU;)iQ%N#7Q2{34e@Uq7kV{Td2|Eu^28WvjCzeS>G$0@~- z_wqh51@xxlud%-ilWe@~wdTuvQ6^6?uBQTwQ~%)X-h3!eJQ2d0)QT|y?|h98Rs;l zSh%h1E=YIBMJn~yR-L2%$Ro#|Z2QFtff{vSljZl$4z-P=d?QCa*2e}TKl0u$Mkt&A zs^$|<)^fS8A-+rF)I@$#^E9n&z3?=#viLV9UYcE}^96x?NN`T+oJl;8)rd8s81*Ri z*m2x#w?Hm};9I83mB8|#MlQDIEtL-(wRKwwB6kh)54~Dko#Q8&iE(kbm1*6d2EUcw z{1#0)#s7qDuu3#I?qyVHs`~F_$u#TCE-M`#ledcGkCjwlxgpD7B^P278%<(Z*xQ;% zLP@FA>~m8VDoT33uQ=-J`;>d8aO2sh;W&c217@Wx!;N48T`dk(quc6^u})56_tIlD z!sFYH0zTZ@8+ecs9!~|tc&|xLnkxC09p+A@KUV+$)$#|Y>iw7pVIaP6LwEQ0-+1A) z^bvCHVeZFF5%Xo3oW&`|5MthfA%L}aU03ros*7MN4gg*w;E z7kN57f!9q6&=rA`B;uO{Ce=oEM2GjMg>yuwQc*v%zf; z@AaVdCz&RUTpx(VvKj#4rbxl$__4AA8DRb*=Ns~@6V*B0IXRc81T${f+m9IU5o00U zYr)@{#O)g*`htmF=e!ceO5+CjF^vdA)MGg6?~>u49FbE6%#;;Q=WPVUZf=*X<2V=b za_A;OE<(%|YNnaV^O3&Sf~+RH)F1D=Z=Eyx5`4LYs%{7QwEbqX!D90lUuV6h=`$0e zTp@^&^Z(Bj|2OSDkgJPIIR5K4|C9Xx8M&zh{tuyMF8{BRVWbb|&;OQYw?;ieZS0$H zdT8D3cTbMu4~MMfFhzd4UF_itMU&lUmH>i5 zm*g|x=_qs?N0#9}kgFQlT@IuIdkKD)VH5)Dhy80697dHJMjkfs?-(Ukh4pGG=wtwj zj=#%N_fWC4L9#p=0H2z5YG*m9qv^o=;yg*IL5pXg3a=+n%&mJkAdPJuhgvo6COK%n z7{+z%*3Lj0c33~@BHEX5x*S&^2OhvU$bVI8|C@cl$m=p%N9|lD3?LU5g%VFpDBps9 z_);rAe*)5iepRLhOTq|Z#K1;b1Sm*pSc?~qKbM>@4jpa^V2Vf}A`LX!Z}P%A{#{_Z zCT;9Y_d0UCLhoJr#&)xq<0s{1Uy-`{Vdr=Kh8vZUNj2SUPO_fxhY6O4s4R>)nEh#} ztFT59iX8Uy`lNjKORT{j3CPF0V>oqYVl@1&RnqizWa#6N{Da57Ae>uhu1IQ@0ut4a zi@3n)0eiRyfx=HA0_~Xv*&R;&SV)nR^w+!vND|9`eMa9$v>wY(J>>+yX7ycK(J$8IU|J$Xo7>3i+t5kgp4+KB_B{kEbo^$X~jKn`*A=g-yBo)($v zvwfo29=FuPv9sV8P*p^g${8Z+(u8fY9 zj{1EEW^Y^^)x|I>M4V6==8bP!Tpk~J=?A5l3&HoTChYa04D%UJ)6F(#O+GK!i>3)T z6ii?x9k_^cZ1*fM??R+_(kStdWe#QXKuff>L5Ya7_R6{4Z0(grDgGgI08U&VkG2A}8i{ky@S zw81p8?ZAYu9aA$S?>^4Aw*SPprval1j;X%->Q8A1<`)41+r2WRTk|?cQu4+?bV?b& zm_a5{jw7$0dsrSN0pKpv)3*czH)yJWYDy$;Cu9ktsz0wZx`SNS#45+F<-N=-vR*Tm zy7=U~dIP5)fJLikXQdPAY+)>AlJQ2_lYL`u&VXFVEg+MlMR=S9frta`ez vF|h8SBZ9%S(3PolNrL6ScVxQQ&zQM|abLL7lK#eQ`T*3FwUmk#zybdc3>s`K literal 0 HcmV?d00001 diff --git a/doc/sysbench.update.ps56.tokudb754.png b/doc/sysbench.update.ps56.tokudb754.png new file mode 100644 index 0000000000000000000000000000000000000000..39b1c5917306dd4fd3b76a1e185239d1a10cc509 GIT binary patch literal 7434 zcmaJ_2Ut_fwoai32p}NM15yQ~7p0k?NKvE-(wm4NMXCu%$p(}vMY@0z1w=$ZdXW+Y zDIy3+l@^dLB`Uq;Z9Mng?|9$+UcQ~|H8X2wuUY@U*4mRO13fJUIxad01j3-BtziU# zzyJsYN~D2@Bz4v2w3&;W!Cka6UJJTWnFDw@~}&g0_Zl9Q9WcJ12j+qZEz+><9y%FD|M1j46J zpXTP~z(TO$ucz^6fOfxkHZ7=FnZ)8FkFPEJqI z6bPg{qUSs0*hDg9-G#L+Gc4WLKnLr?e`yms$tDlj`Bz#qO zGr75&@HUW)#*_IP8ymB;vw3-Wo0^(zZEdHfrcfwUlWLbcxMx~VZF3(8gt7Jb3r!Jc zBG71cL!{SE8Bar@?KhgP9D9h=2AXi_teG->)a!H+3&4; z;c7Z+L#on}T%(w8v}p2GfohGu=&r?bQQ3~c(z1bW zwwKy9;Oh6IGzXW~5Z)L_z?UjtMV^}+LBsRbUAwLpqVJy-%<+vIa=*K+5>UJqF`v~R zfM}K8b<&cR+|gte9kXKDR|0VZ--2{oW*t z-rt<|82a_i#%z_w<5KyveX|0eSJhQpH;}Lvm#*G2Ii6w>Rm(7X-RLl(2Hf|I^CSmm zyK?z`%=PE-L$!+Q1y50LyhpZ5#to$~4XZs!cjlq9*rw-3xKou;me69&SjJ(F8oAkV z3le)vkfhTbEL?rr!Gt%mXWueCd%oHvepk$@r~50B8duA((aFHdRX>sCCR&v`G1dch z^{X80eEOl=NMPu<4{iYcBR(*<@lk_!S$PWG5+i)Wa&tw!MTpxf*kV0Kck_(-IGgnW zyybPG@c4B8(2(u{c3%i!pOoao(4@|S?ubm6=~d9)#Q}oUu*q$20P29pFmc# z@7gPlDxH|l8;OzlOj%RB;8yu!!eS%!;7|p6_t4X$NB!|rIsW(AIeXf40&j-C7pw*T ztX5H#|DK#volRwLSw$J3R(1j}_ch7@pqA;S;0?rOU*gV?>Uzb9!F+gj?Xdb#P$ezN z5`7rG$I)}rJ4fZz*!8yxJn~h|%F|0G;ZKWdDM|0-xuM1T+nBe%T0Xek$o_6HYHQs) zRJVokm8Bg!^nBNH$wzN>Vk<+gaQW}AaTE2jv2)I$Jm4Mco@f2t zCU5JWriIA{*NTb0+6(yo=O^3pS{5!e-B-JV3U8pPX2do&&M6Ckp$0zqdC(xW)pirl zbpgf$Gwzt;)f)oyX+A}qFV)FSqb7a>)0ha5T1L)Klx18$)Nb|q_zIw>UfsaQG~Zud zWnOo4->Q|dWx`4fXULdg*;JogJ$vu+xvHar>+ND#*(U+>Ie)3h4Tm+9y-?=7h|7=l z&ZssjQ4U~q(!zA5%yL7OTZU2@ho(*5-qjsHT9r|lA;g;i^ZTkyc%N&w@T)`Nc(l&c%1AHl}&>JYK4@`$Dx-z3Mb!Y{4p!zw{7tsg_ACVb2$Yuf>&+klS3&S%sG`fA0&A}- z2%3H4djGe5N=O<0St#~%U85OYyOx5>6X?h&gD6O%VxlPvzF37_LFN9$vA zu%)}SSS3Xo5|twAbSAGYXWUn_dfWB4^qgteaS~QNup-_W&mU~xSJawssXtbUVI%IJ z9Hq!*wTep{LV7$B>3>_e&7sTAN?8QS#>ABALG`+WC-W*l-TBtwV(J5<7e*KrzT*tv z`X%->89q_sJcV3|>P^0H!t~h%3twinE6>K>5kRXnBv`vY)e=j;qEk}$NxCB2bm^7_ zK8!X!b^B7l5toa)jl9#>JWr)t-l(jBTRsL5RAA+g+v~K#i2l%0Ir`NF6XhrDi*~S= zbBDc?J;{&M5GYZn&~t-yo+F>$RWRclPC1+Uq>P1ihQ85LL|~rrP1ug9Xm_^ewa2EZgqT}|HoDRMDoGBXN%O@s(d$1ig zjvar0CuB?f>o#`l;&llNLRSZt&CO}WD{0r+{Oi)g6_;Wp=uqFY=yUqL%@yeO-^XYSLUrPM1C<(7Gf&zZ9TIq!_R92C2i1n(~WlMrGR%{gfo0-Z@T^Fxwoe* ze(DDr#atD9CQ0bLU~nj3qcO7tGq#3!40SIMgjlQ&AP=Wm{3L^c_nx$>CsAno8j5Ez zym)CVm~C%-35Kn*bfj1WgP7VgWU%VFco)?=JtKZ5X#7r2( z^=Rurq~wn|AFsrt=aBeeT#JX=UKi6&EX3hEJaONv)lp|}a=&>fJ9qY+X*CYFg`)GO zHE`TnE+JxLFDat*8s72iOs#sCZ#s$YnpOk2Jzj=didXGk5#dRY65al4oIB-?;gzG! zAVL#L>~PKtYfRt{Ng`qW7$0|Bmah-ApZ4D}iMG=k3$ zIBWP-V(ku;u0@End%#x_c=JmAMAV2xz4Z3knk&qJEUp;om=7TdeWT>ot^phYynD}bO~qSQ{}y2 zjeNe^0Ks~!Q~EhiGdx)GOS@hQDUc;K)b9=n8a|*Kb0n59%vN1FvH^H!XOmujv(_7g z$zO|cYwRLy?*qcI?dG6?Q@+gk!rGlk5DdLwwV#FNfFS2iosw0|#CKHNV80htA{*s(ctv;fnW!fR zBQZr(*<5|5!b<`|WcnEajKT}+LYa>6tFg`^3UlaD!Jw(FYSCRXeSy|z);$7PvIp&q z1@6~K>SW6bk+Zjd9nG@fT@@Y#c{L>r$HR-S^`qE{(|b}O5QnpMH^M*;U+vG=?Ti4M z(UoZx^&J<1Ht1-wUOzU#O%Zm$C&UYTRJv%vpsDaeO7~c^L<>-I)p&QqA%P){tM8=n z()E|K-^9+hy>L}nGZNTyK_(>XJKQZ|cDIau2kvA9o;z#XwHa)+0yX+s^6>9u@%aPN zApI2q5ifoS*<|M430_{%D;u{~P2PeVYq}BBW{GzJo^HyoXn*hHy6Y17ta-CU=P@$@pVB%Lv0*3{Gf6{Iy!^3Qh>7}w zZst(ax=}8V73}ZiB77w7XMi2zZ-dJ1Lznq4aH_w)6IeCO_~8(e@;EV0h(F)w(-QTo zN68_J_pEl6QD{fODnMJCvLbgA`on;QPxwdaC$~){K0?HMA<{pBBUdmtE{TAa#|sIa zzPARgN`FO_kSNV~KAQO(0HjkuKT6skT7gc~-l4l;zQz3c!R#go`@!W%1Am%PD%k1& zT<=e8tYF8S;`lpF>KYUC)o(v5K)?dUyh7H;3cAEE(vY6FQeP;c0oO@n-7#cbe@5%2 z@WRsa2%_+!84(FzchNwujyw{JK!9!W-|efLmj>;)2UuJ*!cHv0*UeQW5s_Sdc0z@a zF?KeiW>;@I0}w14YBIGB=Xhrud8lLv2*Z#FjmOX%f!A=H@h!-WHWA*wE z(Ew7&o<~|7R0wkIb}?(xNx}MDQ=bsduhwtFkE=y1o7H3TD~~+I&d(_G6Bo5M^^x% zc;wDs8_-`Ng+!Vca49b~dRf9BAZt(t2Yq7M4uwkm35XlfT{LZxt5536r5sIpPr*rA z|8q>ME*ec|7-ElIDoIM})|wdf9VLP=lqrcbtg`nXLI%~z28rgsE}NqVBB{h{#c~_Z zJc_0(uoKF=xUB2@(3r;Hmro^pMW-O)t44}b7(|VafbCs?2aiy{Dc6*z*ojWYOL6vD zPVkryqNqo+Qo=Ea{i5ZWcF#)g`luf2ted}}u^&$6JEdLnmYE#8 zO>%g!L98D2Fi+yoaEqzcwhX6F-9CWSR}4_BHV2Zu7Z=G0sYGrZ6LI5=eK1-6tZ ze#eO{)5PUi`1~=0uOLP)ceAApgPEc)2wfn8Za20DQghwXPv34N)`Ns6{_#R()EL@M zYugN@CqEb{@UXCY05M`|gKCA?bD*z(M$2tC0KsNre0-V;G= z4M$R~cd+|`tI6!#P*E`Ts!`Br zMqfDZ|ExUr3Cs+VLYA5v z=cDur|MsDyMq$5OPMyd5x0)OJ%|RjOWf#|eO;g{zN=Pv8YS z+alMh`-E)WDN;egp2L|+6;k+OA+eQz&LuS?m}{4o^!bR|EWzm1RY6wKlgr{Y**mnJ zLzBE4?Gec_36jsXYimEU@wjS`57lw1+O+pw9{*Io#~u)_@PbUAhcOi()62Jcvx)Mm zDB<8&;}l+;Zj##FRw3_5oFxqK&wY1$GVY?0gWQoIXH4zd+C%55Oq;juQztz@ObgFU z!RU|~6T$P;cFjUTgy7}&+sS7>Qx(_J*{rQ@m6|r!f&_Y;!4OtrhrR+9>^57?Gf6=Z`Vkyv)DMd!3k@y`({IpL_+wBbtZqSTK%ICct5+o(r9#lf2S zSc+66Zz8b^7Su-|Q7xaPSx4CrqOC%B-IYvenCkgWiT9#xKtW)PQ1-mrGMDE|(0Im5 z%F=|1XEFaA6LGaulJMs8$J2zdBx_(dI=MXC_xtcZtsb#|x1^L(ut?BCoXPHjc8vcp z9Ys2_e~I2@ZW1=jU_qeyy_MtyJtqV4-;};`zc3CFVksk| zOkIgRu-1VuY@QC#BhJMjC}nLaqz^VkcuE<0!H#m=45*H4M6@q{a?q4f8>lm z;rVazBy36i-}3o0#fdx9EAarNjt!L*m@{7UzNQ+(r#8N3zIL#&>j6KM;dkxwv0|65 z)Re!s8)my0&umUPQpL(<)cM^5jeFD~idIsvMI_WyasM?mcUcpf!T)O90zJ@0ysQX~ ztJC!llA-eTV9`mL2z4=bs|+ zd}tfbT1w0^^=5fm4c$Ct0CZ;QSKYKEdSL1m&l*evVWzY~8M()Ouf-a8)nuqNPDvvc z@gM1P2YEn9@Mah{2ejY3hNQwCb>W(g-4r}sp*Lke?ziXzeF8XVs4I{S!5wWhZD-<< zX7B?Fj-c(6rp*cjeV_y9&w4-+d61^nYyhYqA+FRKGs;1a+)6_G`U-jUV5(d|v)R=- zPZpx#Pf^WG@rWb{E_l8x{@N*y3LvFL2e^G8w6bYmQR}@!W1tY^0ufH;c_vVjB~IaI zAh4&Oj`3K7huhYHfMy{m{Hz4Nl7D`1Z1<@_17U99Nr6l&a={9t8V!ya^OC0eVPZ>< ztueFbtIjTbmyDbIaC<WZwt4cNX|s=YhD7)Ag8BQ8|E*-b6LQIvVU6u0 zeWRx$=Hl|owd_W?@;0g}FC9FHv&b9>4qxjN<4b7~JpBA*#r*>RyRszy3Q&hrXanQi zemhIBAg4#z2i0^lJ!n*T2^XSbqJfF<(&6&nqM=vGc`zvkSN`1bgug;((aFPI`TEq@ zL39p9kw8)SatRk3BMt+da;0yK~Gd}#2Wzyo+@2}ES zb+I?hD*^NSkQw11bhWOXFOS7xX1}597c};U(k7I8bR}`43B8@VAJt!sWgBNS4v#gw z;*syj*Yexk{DCdypC|TYT6Ok{t1miX`=Tqg9Q?jeA51RtrBPngdV1{&YV|zd586YX zuY!kOZ(Ek-F~jZESq03f2EhWY4R^{vTQYLkYmK@G+NH?HVC2>dZM|R6(q@s!-VGr-AREOK#$Ycm>Jt^%c zfPNPjz-0EoQgNMP@!6HT?|S6yY}9#~G%A3)1D&^xFUJ(3sbRij46EmhRk+e_GN|nV z`t4~JO(*eLxa}4ThYu%+I=s?mBX0Q^yzS%nI8Id#@$>?dZ~WaifG^&8g~hkphfFgY z>9(${DY(o!ilD0}>Sxa6*A6Bpz3vY!w6l8~`ebl;)4H4uk79g9eWPBui}6Qo+FtP( sU9WpSJ%fYzkQd>vZ@@n>0p;yER896mr Date: Sun, 21 Dec 2014 11:24:49 -0500 Subject: [PATCH 131/201] add sysbench update perf graph --- doc/sysbench.update.ma10.tokudb754.loglog.png | Bin 0 -> 6947 bytes doc/sysbench.update.ma10.tokudb754.png | Bin 0 -> 7351 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/sysbench.update.ma10.tokudb754.loglog.png create mode 100644 doc/sysbench.update.ma10.tokudb754.png diff --git a/doc/sysbench.update.ma10.tokudb754.loglog.png b/doc/sysbench.update.ma10.tokudb754.loglog.png new file mode 100644 index 0000000000000000000000000000000000000000..99b15ff642f8a3c7d0b03cc5229310b21c17a868 GIT binary patch literal 6947 zcmbVx2UJr{w{{W;B^2pMlYmqKQ4py@=pY@Wx1eIAH)+xiMWhLc0wPtaARXx~2m&HS zI!LdANC>@?KfK>}*ZSYP{&)S~y=$GEGkeB92$fJVK8U}sJj~^Z?}L$!$AN7 z4d8AefoKp20f2A-E(kZ0cjE@WDPsNyz8y0&v#6-3mX_9&Cr^Tcf>Kgas;a8cXmoFH z@5;&wUIkV}BpwrAGO>y^#LnYzn3)h;4s3B?Z>&k27RCc2MihYLT(IYvZzJo{2LOuqG)(y!nH+>{O zWX^WKtsczy;rL49{FB{med?PBqHGSy=0heM@6A)!Zx}vl*1ws$&O>GyFkHX1j)|`d zXx0qeuQ^a=ZhIpZ7i60+zBU_O(lhc&H1-qAdap&VHZYvmr!p67WE5bj<>D16I}K}C zpsC&Ha&7v&zqahGHo^KG{QU+xQ07DW>_hQcwG*#r_eGmo1B*A+H6%ApY;_G+l3SR| z>6+e-zS4f$0Iy9p+sK?V$fNx84mzQANLS?}PZ4{l$x`I}vTR*1;(MamTv&>r#YWYy z8*_xH#wzZQvoXAD$2ANxlgp%(C5+C!bI<#IOf6T2kRvF@ESju?ULd{Nqv}0`U9ifoNzwr8A57fSuzEE>Y=Fmxm? zN^erY!&Zv7W9I#xg=V)Fnd7JL7urp=*a?^J84oY*dFu`A8GbAf9Y6KQ_NF7{8iEx< zlRq({ik!Y-Y*A=^tXYzsH@CAsezcdaFqxjwUU7O*{_ZYc8N0LlQtgs^-d#q;64e@* zzWJ1QQYT4y+5R4Vl~Fxj?|E~>11rApJo=#W0^)CI=}L@^`t)9^n3wE%(s-Pw|mzACHEsy8o_)ilNT9O;F+8(b0=vqr%TGES#;A zIvZLknYj#dKA3KeVzlb-X8Dzq-V;9>8G=_F|6IxTz9A!B>>u#0THcE62mPNO``_M9 z=<18(dxpQ!v4%qVcO5u}*->Vrd#}!G3ws!m*uZ;J(ks?)zb0kDr?yLeOFw5Xb* z0J1SM-RRlxW0-!330?dmo(LUJ{#0<=WSk6BkTE)8Fj8F>wJlU5okA|;;ndZiZ{;eU zBy#uW+jH$4@%zR`T-GL&8=!l*6-qmoBiebVw3rPm5k6fKBZ4qr3xs&kKnxVRW_ZVS@BCnOn6#9beMU zm|oB(cg6DGMEw-MYE`$OxRADO&-$a$t?cW}b%d$})+@uWm{+I3VDp#eZCzlQFg3HQ zg`Zy}71ko4^Xs2DHZbYjO#C*fLa9ybn3iTpeDp+_C+!>fvJ?-P*|P8ZVV==t*(q{7Z|n@Nik+@sO0+dsN*dCqpnX(~6Y zI6b5}9Ud0Y^m*N)Rlc+t?E|sc`sD1J`mUp5vhGLsC$y-3uBofom0R1?Dx6a0U$VEp z$J~$)==E+QXUd@62|k<^u39T6rD@w9lYcGN3B&FUS`%zpT0I$zrjM0#Yx2~k8;6z0 zWby@>00Gr=e(J|!N9N=uEHE|~w%i*ot-0q!8eQLmF}u+4x@1F>5uXQ^P0ehA0Hmqh zvSG%LpDwHQ>yL&H@!yfpswv-m;tty4otBmFnu4%7b}X}0CjCM&(K^lE8^$b+OLJ)3 z&&n##4sJ3iMo*7m+-Q0eJX_m_wrdc?EVqxti&r+IqGrW*bb3}0%eBzD89%%0XsnG^ z6V1Hr?IdaYH6Qb=fEILoR#WvyZfYphM>5&$^Q7N;Iw+aqMG+mCXoV>9w?~UE@RHj< z4APVqEd)ETdVU>Idud(Lne$alr%AQ<+ySD{0S z*l0uCz}c4*B+jb^6sjBf2#jHIZmU6@`d@^r+xXh(d2)E8t+&D)53S4&w@F*$67hYD za!d%VnE=k2S)oqBBYLty?YZSmSs#zAugY#U*M4-vo7F%Z}&8Gk12s&fA&`IjQk1tw>jWY#a75&zmZ=J zHxz%?I=f`RuLXD$ub++*p)z6LaOU?cgT9hdaj4-;fS1Q|+lT8X0y=;=zJf3@YD*_( z5ijcj!vU-L@bhTJ9sJ<0nMPwMhg$D)WjZ0ikA)hfFMIYs2;oMsruM4qaU4hVcUJKU zlYeVvl8N5=5`UK3Ruw@K^2=E!Is)#4>HNP1hKjY{3f6B6WXE#7BE`QZf@aNI`#C+| zo%Pxf241~((hSmJKfjHgUG`+KWDaJJB}Y*ssY3@_1)(wCB3DhYjp;xDQcc0@a*-g2XVHaVgE)>Py88f#>QE`#9OkhnX217Zatg{utoQz1k7y5k7o7d%8yTPG43TY z&dUxR2K*6*@)2d6@u3rZp0T*5X{VlOkU&YkR{6C(iuqAr+2`}{KFh7|R|0K0+0EmX zqCO3%Jrs>w)LNW+uSRIPsPQJ!vvv^m-D{U`maE@HX-M9{I*~3W-UJ(X?Q3cWX|$Tu z6^1MuiLonKBzQH{GCl~4m#QheB4NTP`3s=Xed{F;g)M_^_%q@eUAL@=tu=ACw6 z%bkZ+0Lg1vsy?e*^>5dt=Vf@g+SzoQh#-Vhc-Ljm%v3UJ5~45J=Mp+qj22Ye{TaU= z^;d~i&xKC=~1Ujs()j&ZjoWR0SMcY)iwsgSsFKf3GN$?@a@UHX9D*)a-7Te9TB zUD|r&hR#?5kdNOzJ~p-pvJ<%eZlruow49MuIm2#s@lXzdS~4ZPZ{v-2oHq?q54T%Y zb3zw6boTj4P(~=&HP4TIURu33rQQU=&)sX9*gQ^gw=+suIiEgJc5+bVWu_1DV>Q|O z1Rs=+6M|AHIqd97n&HmpURHv^9m9COO2_WlOG>%_0>V`b;YQzv8y-dx3_`(|NzbR? zF>*B_Vm|Os`KNtu=mg+5^phJG4+qYd51p-c1atl^`-|c9Fql*$vZ)FMJPy+u8ym#yl}vI$w`=wLK6BF8?sznhuU=nKS`tKwNhlrZ9g5#In9_MTP?0r zs_aP4R!+_UUD8Q9r)t>wm9;BB@aeoasDvruf2GqyywMUgKLOh8u^4!GL^|MvzPgw` zGj29S6_**${!sYpo00R7m1Amff&|SWSwC8squd%MF_;ONNqIR#A%q@LdQz88 zAxX$4{OGt04!r-|n+L2r;m5`g~qxsPS0&VDP|qW0kLBfE8578G7&_5 zMZz$9^JAv${j>@`-n1nil`q8-IlU<>)MN1Q{@$gC(+;NSO1udn^YttxPzi-&(${|+ zEgwrTOabmnjg1wpohfERSIII!lHZNv*PdQIedGMSq@lYym%ROBz%l^B(_=2VQfk!_ zpbqy^h@i3~7+h-Ql;%*1UAv1kH}vc)X$U(?JX(F0kZr?^VHE5r>&2=O|FstZkd6=C z+G>T681I84`eMI8D4AXnXc(e@T3R$oN*xS|=`KiIy%j_C2dcX4prvrJOUI9PSHE0$ zRUQfnS)gdn7TWC2%wSQ+iNp_#X|_>%z6LVdfW-3awrtinf`zRTd8q)lzL4Ik ze(*k{x&jN<+emGNjq2r^m1_xiANGh8TuE_NBWbiEA-Vf^={fy zxMEXPBl&fJcIVKne+SBWLU|-Qb;mWGfUk!oe1VNB3Sz8+WTA@OF;bbABGz@aC3F|C zU<#gw&G(Qjigg<}miE0W;j@ zgc7BiV3pmYr&qhJ$N11sK{+=1I=~xtzcx}O)%H6d2X93PG$Vmwkk7q!Zv=+t9C=NS z%JLgod^1uWYi1G2U~6Upoi(kTSr7Bg+u6; z89B3u)#6;92%E%r3F~K+^7dm9i^tJ#3pOG>rh%hi<(}bvrSk&XN{RtKMcW9GUx?CUo%r&zknVa=dH(mxG}(ULiur%okEMAb{n`+~Qcn0Jix1-~v5V6ph8-&X5VF!^ z{{9W<_^V{sGt_RmvN7d$8_DJb(OD&<$Y}m1HuHc6zo*{GZVhRT>oyy}^fq6Dc#`6Wl(97tNAj2IJy zyXQ)$RxNht<<^^zyK)>aPjY!F)ZHPjXZUX?(aW>NyOb79#F> za1vhblbn})H^9kBa>@SxkwD$W6ZxMQ^#8b@{A~~_XP)6C!E28Hzj}Xb^uG~Q$f>U@ zz@`3Yqx=t@@t;)d7Q&46SvWbowG$WC2bA4jHkuD>k9y$)!Opc2)17P>=RFH2(b@B# zJpPIJ^JnVxJwt~*Y*yc(#ymcJQD+ETEUj|8K3z6E3jxh#xa}<-ynDW_w5dP!Utti9 zERbA_+I4QdTT^^BXlS5E*RuTP$3xbh&}4V z4@mK>N`g)K?H}B_KDL<})4igEK36rO+d2^v8rG99AFiD_) zw6F~eR(c*q>qs6}wU-#c7cQ#^psPsl5`8f}>5(N-bV=u@2cJ2H5DN1dVDMC^;5_Wq|zS6n}%}~!s}L(Qfh-S%pd)9fCIoZ_PsOJ z{f!b(9`n7-$=I?<#ZtktCdnM>GM9b$m;B1zE+W%7Rh8ST0kwp&72twIVT2!2QfjuT zAy7Zs65JzpRMe7cO$L?7ltldrP0Z<>oEo-^n)}jGN#a6}bbW9dsVDczF<;SM01dCm z_~kya=VLbf*=(NTHELTP(6}ZpWb^`Mlu5XjKRnjy1JzWWAmXC-Ml@ci$Im@X8lNTo zkv=|RRz|<>n;0DHgdW2^;FHOeW(9XOF@7Z|0+U7yUE@NY_u<&N2en|+^2ujMp3Az?X z@H3cxE2)}%yIwK&NU(*ooYV@DOMG|280XWo@NW I1!Tzo0T%U8`~Uy| literal 0 HcmV?d00001 diff --git a/doc/sysbench.update.ma10.tokudb754.png b/doc/sysbench.update.ma10.tokudb754.png new file mode 100644 index 0000000000000000000000000000000000000000..7297013b51fe5a1efd16fad99b1e4a74bf808b58 GIT binary patch literal 7351 zcmaKR1zeNu+x9kwBPFC!MoJ1uO$A{nEdr8)ltBv&P(W%UMFnX@a*`sF(zSu0bcqrY zLrJMg*VuRC^ZefL@Atj$yWh6^zOO!y^Ei+5+O=l}dYbe!Tr?mMh+bPu%@72FU_c-+ zfrH4kQfjdLq?N_^Tfn}u1LZF(2t9YOIB9)=FOY-_V#Er`t|GAA3l7*KG7?MXZEkMP%F2Sn;W!-5#>QrPdRj$A1*g>Q3fN4I(lYk~fljxbe85TKr@28O zZgFijRb$`u)ePFyA`!;$ndQ#Ou(XdO$2HQB5bP(Up>5$pmZFnlv3mOzKCP~6RKPg@ z+v{Z<)IWE9J3L8>uDe%*ekV}sM=N(uUaGhbHTb2?LHx+kfE4=q9VJGrqSm{8Y7?0U z-0HqrCgOJ%t{uIYE_jvtO?iKwk_RDt;hsyMLie>|A?RrHIo zh|cnR=Y^~JIN$X=em3%XNEUz$o&3_I+Nm;~np@_CO0QH9xC zJX)11q5NEOI=(4TuTE0CrhesW<&MNN@5@F(HPs(@4t7?`4^ZU9-N4H??{4Nl7LHzg zWtT))3;JZWZbK2q~9)deH7c^ z^l@b-Q(6LYb{pK)+@|Lvm@}lhw3_v^rs{IX*sc1`x1vlIHfK>08O3_AH|yC=p~ZQm zeR=A-pPwc0eLJGXFG5zH4pbF7$p`AX@YTy!HAa5(tF3f+ne>Ks%4hw?aO16ZX&;wC zsiMH_g5)y=yJo7=QwqXI-VMyQIeMJ@X|iKJH;6s9Z@G(eEM8Z9aSwVk&9}+3_N@IS z-Ra81eV+v7I0Y7d-#eP#E8w5w6^OIz!W4I!p6hmHT=>%Lb#ra+BCSEsWV51is@bwt znuT*dqUhJiN3oxlgc_&P7Xi}m9yj~jnD)Xn)o>DNuA{FzI~1KB*Ft}~dUe}#??!Jf z6>3h4Z?X-zhbin?jcXo$Df}G7(&zp5G$MWi%Y6oilR%RycCE^iPKdH99L*rU;BC}p06&v8N3c%46^F8`BFWl_K4E^ z(X2mM^6<%>=!f6fLW|1+rSMho;}|1p~f|h(hFg z1j32NPC3OAr(k+oIHycl0dp_kY|mE>3l6-F0#F3$iI8TXLN_KF<|9s(Kx__4QbN{~{JG z&HYh{kl=>Aw_~)H>m#Fl#Vuez0Up}Ojzz4vZubsypq$V_CzzJM&2t@Zk0i}logs~; zkhK#7-93$_j3*HjD_)zJ$N9SXp=?h+I#tJ7qd=+-}y=@^L7WoPh2+Tnl`b zTH_F~)|PFP9GI<|R?e7lN&ehS=>{+eYx=INtIT?(6HDY8vm z49u`bxrCKvz=rj=t_u{5j7jb&#m&s=HnQ8wF}!shJF|QchC(@5Y^|0qfZ0{D<4Q=m z&qJDfxKis3z24QMc%)efe^%g(zUTIPOjr0Ir`6_2*j=HIK!ugCwS~n z>z)h&q`uPcovRDJ3?+ICI7$)|6=OilujO(Z38A&~IsILwyWsypP~C3++^7pw*l#%n zYTN3yb-B35#RB678RTq*HaF#u-0>nk_u&Syv>11AD7%9Upn(*PI0Vs_0>hm0J)aMW zVy=Ei0j1KryXYGJdg3A$$`F1VQ*x|Z8n#Nupui7iKJ*Yud*!hOQSg^{-(yC=xG71s ziM`#I{J?2mHCLcQZl@Kx_B}*T+K4IOX2eSAA&r<`cf$U7yhKOL;i?($PtRZd;oauE zo7dOeg6z>>v2AQdlzZDBcEh`ug*F9JraH^(aLxwIm5_jOv&5P+1d-})$qV6X>W%dS z70Cm~?^F$;H-ubAOvg*1^^;PbZDjLL`CA|2eeD`(QHtQ_s}(oOK_9<{Cs&0XogS2{ zdvq8x6Jf*eh*rmD$fsP>Wb>bq^t=AmN-`Q|X)Tinw|3T98OBY&mzOfO5{bnL@|c*e^4W z-O;U!7UV^GYLRYVXm})utVxdTV6uIH7-!7deL-34G9$pqd$}!0ty}UO)j+Axtk396 zFoOH{xK0{tu=frvL*$C<&A|Eo_{Yk7o<`ttYxQSOp7Ga&#khA~P06wn!CS+Jp=K?2 zz-}+v53=Ybzy`9Wkg^!hzTP&_kg*(2%27(WSLcC3(@&1S5 zE<)`){6 zC0c=f;i2}ma%v@Z6}*Er8`phHNPjy+EW{80#X`G+*X*#f_f)j3L-0jHP5uXqH#df+-4zzh zO$lO`Vr;z;1+1-tq_c%rT_q2|5G56Dxaj`+6AY+*U;99-6HU8)V~3(Z&xg`apjhM4 zn9+J(ew(QF!QBrk1+!#!C2RN({9$myug99%@h)nwSZ&ds@yf0`$LJr*2RWx3;g|ON zi>;p}at(&71aJs0t<$1>$ofY}`BmjzD zJlnNjzA$R8eb79%Jvf~=n*-A=8`aOc-(<^=|B$fdWVCVdlx~@$A5vw;qZ-t&Hza(s z^Ro%+d3&j|TEd~{IiA1p z1h_0glEDiP?WyD0JA%Fd=yw+>M67(VSgrw z@~O-&cD(8My5niP4Rl1e`1$RRH*Qjg0Hs4q@dW;mhhn1dk~@W)#5W$f ziQ+TmC{*5iuYb5VuW!VsMv~c2+zrp_yFjUx77R~uvXj8q1{Z@6=qVc1NGps={C;}h zRZ6YYVEAk=LiwV6tp2LZer{E;-a-kavgtW9lyh%}V<7*xua|IACobm5O$=F27a%)- z=iOwQO+@>|Wjg>?2~Z*Y5$B#&Q4GxjxT=EP%OUXuTI$+853ZP=PWAwRTrppKo%NJY zAp0qonVQgl!d6hy%pWp#p-za1wEII_tc)eZrjy~9{nThe5w4?GgW5ro`c;C#5JO$V zK4-lki8Se%*>u6u+D%&}WNb3so+@F>D|e@?&hZ!i(E2*s%C0$G1*fs~FBv@ufu(PR zw_zDZt=Sq|OMe&&`z^lHr151@vpr9v@>QzaVVEGPY|O@JgKX|;t$crx!u`U_lBYj! z3Dm1x*3OaZcFkL&adAxWk3x#`omwq3xX4m zyk`C{4bO`bWeB<|c#;-<0K)qVueqxvkMkkeO~aY6FdI^0T+IdDGccr(GE?c_pqPl7 ztc#7%h;>0=oUwrtdt$#eEeH3T@gm z{a@|{q{iTN)OtwX!{1iYyypeD?HRAvh)S4$XF$oy6x^*h^wGPHVW8w3BpAp0naS6yV62_d`RN69`|d^&K-RR6>_@I6DeNKLam|;rzyLAKa6OmTj!od2^Gm)ON(b~ zV&;9G7%C7+0WY|jmL+0%`t&~{+m(xk?jEF7g+0Ny24Vc;GNZ6tGRn&?Pk#kr(&7?c z3Y~f7C9wpn<-B}mu)A^N$w}!L1wS9_Ks@49+f8juO3!zh7he}JAUMrmVv~>%dnJnb z%pfK?J#5$sI%@ld3#s!-iNFi%p@7_zfxaD&BHh>roc~F)tgk}9Ryg-PoM4}86Q-5% z)ZigMBjA%if^We2KS;aq+C=aO5dXM%dIyr0Id`i0$$=o3mOdVgROGR%^q? zD4*SO?G{*pUMx4{z7EZRAj35bAuxD5?*q00MWjgWB%^C{cf< zIH?cI){ygs0Sz{lu&HSEXh#(Ex0Oe;##ZA+tcKhrs84&aQHzxa!T2x6{cEf4Ck}(; zbcqPSh7A*x(M|~?74gl39tt)}z?#Bf8?={d?>WjnPcq)$kYYMXJT`0Ya~_a5@l2gp zv2E&F%BAdEyWl^#2}yO2xe@;)09D%A-MCr&_oVpYr65b{D6mQbm+x2aP>wQF%hR1^6_^uDC7%vF2WI_=2u2EU5Wg&uVyL_V15$}QyEhfUJ)+=n z2wqe7REXM7HWSiSd$kP&Wx5kbT`%9;wSQv6bx6t9Tm|3Tu>}5}TlJ&s0ATh8hrw&g zfpTMZtdKZ&zP`Cs?Fq&IP9&G%EgvIeY>~Qp*M5yYJH^h2NsM}eSG~t|${>Lc`PF{K zrt3s;ltT{BFJ;D7oP=Kx6aV%IzMX9)&U5;5g`lXcK-jl>XA43n628QyO00sDTn!Y(SH zk8=E(E$cZGjmXjv_#FYRfNWzsD4J=5z%|Gld@oot+A$VVaTj06%Y7yNOTY3IP z;qSaXBz|sdwNmOEHMlbOly#NPbYgQ~Zt02hI>)3Z8%;YpPoR}$T0K_zass$NGJu`V zv6Gv^JFUXGiUdLk6ij73>^3O`gyrw)Hrt{WanD_Y8Cbd_c{IkjzHSr&e3Z#H)~J;1 zRajiV$?+{R0>pVsOrZW^RRAlFYY?4m(HqQ=C}y}O{P3jmfCHe}1pl00Mr;cL{|;b! zN91e~p$8~QN_9KCM@^hN2D8l?e~#x=@5(!-TGI%Eq*v~S90&ct5q>*(N?sd};-A|Q zGxL1UMDkNb<9=sh2W|8Qyj~>k`jw4d1WGH0o!2stG{2JVsC4F7Md23mfe`VR^4Wa2 zX}&Ku<@|Hq&aWq&)$Y^nDGG04@>)!Y;aDyTXC7fBQFgmD#13@x!}LCQP17@Oqnx`9 zYmiAl5Whd^_R5dd@`RtBAMO&F{*jEMZVV4&Y<$q2e3GYG#tHy1XN_I8A=?)?bnkDm zdp(OUS`y$$Vgku?vh#&<7;v9rOfWikww%ZehEeyeixF=f|{29SVPy?T) zZ>9zpP@$Snby}2|aQ-|3665rxZGlUns#4NDksZG_pTKdzUu%@f# zJT$oxq}~M#GF}dfp!spgEPYAHnSXQke`ostmnLyUiW~aV!L+ofp()yfhAU=l zSl=cruE^^yxLIPW8S@;Nb`iXePoj*xNT9DR19`9pz$7J*DA<3BxsFzm)+FmcsU-LD z*4iKLhcZ)1|C?SIZ6WQD>Dmoge=)%N^9ChK-+3c$U9H!UgQg%0@!}+`OWC&Hask(1 z<*v19qY1rP3pLB?lbvqJ{I|&S&HL<#<%;aLptJ};v9>1{M9lEd;vvR4d*&D+F-BE% zl!yrO4wUsO@1^V%5X>lFDUfcj*;4uw#wX7)+OehrRoWIKpDpFjO2;gs!0>iH8t$Sd zu(UqUVx50?uTDd5D07|ul{@d$VKBFf8@&(s$G4iak5+))?x+31_vn1xYiSwHS`beg zKrOv9%zMs3yqeG1`_I@Csrq0LXhEwX#%cOEXt!7r+VO&xme|n9Mit9$#zruE9mvQl z1w`idZUI^7+_t(YYe~qH7JUrobRcid{(&@$?M4l*!?hWF1WidNhfK^X;`K4WCR4-9 z2lEDG^cho|*+lWD4g#J6+e0RLKstHl`tP`tXJo74bBRnQ*+gzWM+T^@Uxc zCa$~JA6tD5zFa%pZbCd~D~LC{M6u}CgwBVBb-B@UgPV`7Tf3yVwn?%$RZPts9e8ax zGN@BKkbG@k#TM)1rN>AJie4<-Jao8%N9U76LGV^;$V$@aaOAPD6>ir?=~pPoy^k6) zQN*yqIgM*DjKl-_yz(vb z6qajJFWT|1^Cv8?qV|ExK-xOTohuF3RnYgBR+%`wHAI_SCsc+fwJ2=!4H$}`&l)!wl#&q9cop(- zO5{z=IHpr}BcIBZ`C#mF+SKs60{Whm>av+vrMKO~m`^BMxr$@%IP|cBd=%*@xryZ~ z+_7Qsw8-L0*IwKwq6G4uds@WAt@{b1{cp^+f`Vv0Hh;>sEpFA-hk>3ondI>L43Fk+ z8+BPvm|`MInj%5;52nV|Y%DZGXYba3=z0f}kb%Uqb5b0*LUOK8r(`9*ypqNSR5;O% zikE8-k-@SSYZ^KYEheZhMx51v-RBmb(YZe#IR7TAYt*Gve{qCScpfH(U(yxx9N?YAjAnair>$QoV4k8#(6N* zIQ<3se?Bw{ENP^@q4&PgD8Ept=!?(O8hZAq6W@I`NiL%0r}i1_cSoZb3@A8f)uNEL zfJ41w|5>$He|-p~8I*Xu8Spmn-6riR?Lb`h@Kc8Fmur{2j3VkhbfZ02wpImm5`RAN z*#Pl4(#zfFMQ*AsXSz0+2#Jg-_KJ`Yn~627qiH@{pQClAIfrSz4o3xDNIjNSASKSL z814rm$jvZ+Q)++3V$&C*pgCB;PV#p*OInn&=hPtFLHhB#p1aIht$0FM4VAQ?Hx(j6 zAu&2or-YKjRpRsh)t+kQ_v@_6m=+kgKJX|SFQaT2z>LL-*ExO1V**dzN5&3Nq;3cg z9!Ge85nZDifR7+PmdVNWv~yjF0%z%oRJn;GS#{utWjUxtYE^bxQ%-l{2X?9cgxJF#YDR7Qj6{{ zmj=`KlpMgB@UtXrx2I9Sabbz;2xRNC({<87haFGZM^a=1s Date: Sun, 21 Dec 2014 19:23:28 +0100 Subject: [PATCH 132/201] Adding mariadb-version on the view creation to view frm. (MDEV-6916 followup) --- mysql-test/r/view.result | 2 ++ mysql-test/t/view.test | 10 ++++++++++ sql/sql_view.cc | 6 +++++- sql/table.h | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 2978fce3a98..cb40fbbcbca 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -5396,6 +5396,8 @@ SELECT `f1`(1); DROP FUNCTION f1; DROP VIEW v1; DROP TABLE t1, t2; +create view v1 as select 1; +drop view v1; # ----------------------------------------------------------------- # -- End of 5.5 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 9cb9deff3f8..8056836fe9a 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5335,6 +5335,16 @@ DROP FUNCTION f1; DROP VIEW v1; DROP TABLE t1, t2; + +create view v1 as select 1; + +--let $MYSQLD_DATADIR= `select @@datadir` +--let SEARCH_FILE= $MYSQLD_DATADIR/test/v1.frm +--let SEARCH_PATTERN=mariadb-version +--source include/search_pattern_in_file.inc + +drop view v1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.5 tests. --echo # ----------------------------------------------------------------- diff --git a/sql/sql_view.cc b/sql/sql_view.cc index b711f05be02..09784f7257a 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -730,7 +730,7 @@ err: /* number of required parameters for making view */ -static const int required_view_parameters= 14; +static const int required_view_parameters= 15; /* table of VIEW .frm field descriptors @@ -781,6 +781,9 @@ static File_option view_parameters[]= {{(char*) STRING_WITH_LEN("view_body_utf8")}, my_offsetof(TABLE_LIST, view_body_utf8), FILE_OPTIONS_ESTRING}, + {{ C_STRING_WITH_LEN("mariadb-version")}, + my_offsetof(TABLE_LIST, mariadb_version), + FILE_OPTIONS_ULONGLONG}, {{NullS, 0}, 0, FILE_OPTIONS_STRING} }; @@ -877,6 +880,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, } view->file_version= 1; + view->mariadb_version= MYSQL_VERSION_ID; view->calc_md5(md5); if (!(view->md5.str= (char*) thd->memdup(md5, 32))) { diff --git a/sql/table.h b/sql/table.h index ac15e389f75..8e8c2811b71 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1807,6 +1807,7 @@ struct TABLE_LIST LEX_STRING timestamp; /* GMT time stamp of last operation */ st_lex_user definer; /* definer of view */ ulonglong file_version; /* version of file's field set */ + ulonglong mariadb_version; /* version of server on creation */ ulonglong updatable_view; /* VIEW can be updated */ /** @brief The declared algorithm, if this is a view. From de9a378646852c5cd4f2e2b7fccc22b4a1a894f2 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sun, 21 Dec 2014 19:15:39 -0500 Subject: [PATCH 133/201] DB-766 use an extra flag that is supported on MySQL and does not require a tokutek patch to the wait_while_table_is_used function --- storage/tokudb/ha_tokudb.cc | 1 + storage/tokudb/ha_tokudb_alter_56.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 578b6c01856..07046fd6340 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -5981,6 +5981,7 @@ int ha_tokudb::extra(enum ha_extra_function operation) { using_ignore_no_key = false; break; case HA_EXTRA_NOT_USED: + case HA_EXTRA_PREPARE_FOR_RENAME: break; // must do nothing and return 0 default: break; diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index 1a03dc815a1..cae50446fa0 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -765,7 +765,9 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i #else THD::killed_state saved_killed_state = thd->killed; thd->killed = THD::NOT_KILLED; - for (volatile uint i = 0; wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED); i++) { + // MySQL does not handle HA_EXTRA_NOT_USED so we use HA_EXTRA_PREPARE_FOR_RENAME since it is passed through + // the partition storage engine and is treated as a NOP by tokudb + for (volatile uint i = 0; wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME); i++) { if (thd->killed != THD::NOT_KILLED) thd->killed = THD::NOT_KILLED; sleep(1); From 8051205d6f3f1e62d74b8cddc2d3d09dd38660d4 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Tue, 23 Dec 2014 21:21:23 +0400 Subject: [PATCH 134/201] Increased the version number --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8d4846bdd50..78c69c9f30d 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=41 +MYSQL_VERSION_PATCH=42 MYSQL_VERSION_EXTRA= From 5fafc3ce42c097d735416373316967927353a216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sun, 28 Dec 2014 13:24:53 +0200 Subject: [PATCH 135/201] MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled Patch by James Taylor. --- storage/xtradb/include/os0stacktrace.h | 4 ++-- storage/xtradb/srv/srv0start.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/xtradb/include/os0stacktrace.h b/storage/xtradb/include/os0stacktrace.h index 58e9a528593..e79347c6189 100644 --- a/storage/xtradb/include/os0stacktrace.h +++ b/storage/xtradb/include/os0stacktrace.h @@ -20,7 +20,7 @@ this program; if not, write to the Free Software Foundation, Inc., #ifndef os0stacktrace_h #define os0stacktrace_h -#ifdef __linux__ +#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS #if HAVE_EXECINFO_H #include #endif @@ -40,5 +40,5 @@ os_stacktrace_print( siginfo_t* info, /*!< in: signal information */ void* ucontext);/*!< in: signal context */ -#endif /* __linux__ */ +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */ #endif /* os0stacktrace.h */ diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c index 7b336c81b10..8b7e73235da 100644 --- a/storage/xtradb/srv/srv0start.c +++ b/storage/xtradb/srv/srv0start.c @@ -1274,7 +1274,7 @@ innobase_start_or_create_for_mysql(void) stacktrace feature. */ if (srv_use_stacktrace) { -#ifdef __linux__ +#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS struct sigaction sigact; sigact.sa_sigaction = os_stacktrace_print; @@ -1287,7 +1287,7 @@ innobase_start_or_create_for_mysql(void) srv_use_stacktrace = FALSE; } -#endif /* __linux__ */ +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */ } From de0907648639777fe671eb33495089549b49291a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sun, 28 Dec 2014 13:44:30 +0200 Subject: [PATCH 136/201] MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled Patch by James Taylor. --- storage/xtradb/include/os0stacktrace.h | 4 ++-- storage/xtradb/srv/srv0start.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/xtradb/include/os0stacktrace.h b/storage/xtradb/include/os0stacktrace.h index 58e9a528593..e79347c6189 100644 --- a/storage/xtradb/include/os0stacktrace.h +++ b/storage/xtradb/include/os0stacktrace.h @@ -20,7 +20,7 @@ this program; if not, write to the Free Software Foundation, Inc., #ifndef os0stacktrace_h #define os0stacktrace_h -#ifdef __linux__ +#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS #if HAVE_EXECINFO_H #include #endif @@ -40,5 +40,5 @@ os_stacktrace_print( siginfo_t* info, /*!< in: signal information */ void* ucontext);/*!< in: signal context */ -#endif /* __linux__ */ +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */ #endif /* os0stacktrace.h */ diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 003ad305309..8d4d7620f4d 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -1633,7 +1633,7 @@ innobase_start_or_create_for_mysql(void) stacktrace feature. */ if (srv_use_stacktrace) { -#ifdef __linux__ +#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS struct sigaction sigact; sigact.sa_sigaction = os_stacktrace_print; @@ -1646,7 +1646,7 @@ innobase_start_or_create_for_mysql(void) srv_use_stacktrace = FALSE; } -#endif /* __linux__ */ +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */ } #ifdef UNIV_DEBUG From f0be022cf01b5978534614a8e9c33db0224298c9 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 30 Dec 2014 17:10:54 +0200 Subject: [PATCH 137/201] MDEV-5539 Empty results in UNION with Sphinx engine The bug was fixed by Serg earlier by including Sphinx 2.2.6, but he forgot to update the test case. --- storage/sphinx/mysql-test/sphinx/union-5539.result | 4 ++++ storage/sphinx/mysql-test/sphinx/union-5539.test | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/storage/sphinx/mysql-test/sphinx/union-5539.result b/storage/sphinx/mysql-test/sphinx/union-5539.result index 414bcce30e9..ab694b7db6a 100644 --- a/storage/sphinx/mysql-test/sphinx/union-5539.result +++ b/storage/sphinx/mysql-test/sphinx/union-5539.result @@ -1,6 +1,10 @@ create table ts (id bigint unsigned not null, w int not null, query varchar(255) not null, index(query)) engine=sphinx connection="sphinx://127.0.0.1:PORT/*"; SELECT a.* FROM (SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500') AS a UNION SELECT b.* FROM (SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500') AS b; id w query +1 1 ;mode=extended2;limit=1000000;maxmatches=500 +2 1 ;mode=extended2;limit=1000000;maxmatches=500 +3 1 ;mode=extended2;limit=1000000;maxmatches=500 +4 1 ;mode=extended2;limit=1000000;maxmatches=500 SELECT a.* FROM (SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500') AS a UNION SELECT b.* FROM (SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500') AS b; id w query 1 1 ;mode=extended2;limit=1000000;maxmatches=500 diff --git a/storage/sphinx/mysql-test/sphinx/union-5539.test b/storage/sphinx/mysql-test/sphinx/union-5539.test index ec73be1ab3e..94cc2c024fb 100644 --- a/storage/sphinx/mysql-test/sphinx/union-5539.test +++ b/storage/sphinx/mysql-test/sphinx/union-5539.test @@ -5,11 +5,6 @@ eval create table ts (id bigint unsigned not null, w int not null, query varchar(255) not null, index(query)) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/*"; let $q1=SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500'; let $q2=SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500'; -######################## -# BUG BUG BUG !!! -# Note, the result below is incorrect! It should be updated when -# MDEV-5539 is fixed upstream!!! -######################## eval SELECT a.* FROM ($q1) AS a UNION SELECT b.* FROM ($q2) AS b; eval SELECT a.* FROM ($q2) AS a UNION SELECT b.* FROM ($q1) AS b; drop table ts; From 068416d3028899476dff87ffaafa742a498b3de8 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 2 Jan 2015 09:50:51 -0500 Subject: [PATCH 138/201] DB-785 add a txn api to check if a txn is prepared --- buildheader/make_tdb.cc | 1 + src/ydb_txn.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/buildheader/make_tdb.cc b/buildheader/make_tdb.cc index 9890b8ed34b..88f8882df78 100644 --- a/buildheader/make_tdb.cc +++ b/buildheader/make_tdb.cc @@ -585,6 +585,7 @@ static void print_db_txn_struct (void) { "uint64_t (*id64) (DB_TXN*)", "void (*set_client_id)(DB_TXN *, uint64_t client_id)", "uint64_t (*get_client_id)(DB_TXN *)", + "bool (*is_prepared)(DB_TXN *)", NULL}; sort_and_dump_fields("db_txn", false, extra); } diff --git a/src/ydb_txn.cc b/src/ydb_txn.cc index b6b8e154c6f..a4d99459edf 100644 --- a/src/ydb_txn.cc +++ b/src/ydb_txn.cc @@ -421,6 +421,11 @@ static int toku_txn_discard(DB_TXN *txn, uint32_t flags) { return 0; } +static bool toku_txn_is_prepared(DB_TXN *txn) { + TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn; + return toku_txn_get_state(ttxn) == TOKUTXN_PREPARING; +} + static inline void txn_func_init(DB_TXN *txn) { #define STXN(name) txn->name = locked_txn_ ## name STXN(abort); @@ -437,6 +442,7 @@ static inline void txn_func_init(DB_TXN *txn) { SUTXN(discard); #undef SUTXN txn->id64 = toku_txn_id64; + txn->is_prepared = toku_txn_is_prepared; } // From 7229b9f5f8dc8437b2b0c180066e3a23a2a774ba Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Fri, 2 Jan 2015 09:53:30 -0500 Subject: [PATCH 139/201] DB-785 turn off fsync on mariadb for 2PC transactions --- storage/tokudb/hatoku_hton.cc | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 438643d13d5..83a1053a2d8 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -415,10 +415,10 @@ static int tokudb_init_func(void *p) { tokudb_hton->commit = tokudb_commit; tokudb_hton->rollback = tokudb_rollback; #if TOKU_INCLUDE_XA - tokudb_hton->prepare=tokudb_xa_prepare; - tokudb_hton->recover=tokudb_xa_recover; - tokudb_hton->commit_by_xid=tokudb_commit_by_xid; - tokudb_hton->rollback_by_xid=tokudb_rollback_by_xid; + tokudb_hton->prepare = tokudb_xa_prepare; + tokudb_hton->recover = tokudb_xa_recover; + tokudb_hton->commit_by_xid = tokudb_commit_by_xid; + tokudb_hton->rollback_by_xid = tokudb_rollback_by_xid; #endif tokudb_hton->panic = tokudb_end; @@ -776,25 +776,29 @@ static void tokudb_cleanup_handlers(tokudb_trx_data *trx, DB_TXN *txn) { extern "C" enum durability_properties thd_get_durability_property(const MYSQL_THD thd); #endif -// Determine if an fsync is used when a transaction is committed. The MySQL durability property -// has precedence over the tokudb commit sync setting as it has a better idea of what is going on. -static bool tokudb_fsync_on_commit(THD *thd) { +// Determine if an fsync is used when a transaction is committed. +static bool tokudb_fsync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn) { #if MYSQL_VERSION_ID >= 50600 + // Check the client durability property which is set during 2PC if (thd_get_durability_property(thd) == HA_IGNORE_DURABILITY) return false; - else #endif - return THDVAR(thd, commit_sync) != 0; +#if defined(MARIADB_BASE_VERSION) + // Check is the txn is prepared and the binlog is open + if (txn->is_prepared(txn) && mysql_bin_log.is_open()) + return false; +#endif + return THDVAR(thd, commit_sync) != 0; } static int tokudb_commit(handlerton * hton, THD * thd, bool all) { TOKUDB_DBUG_ENTER(""); DBUG_PRINT("trans", ("ending transaction %s", all ? "all" : "stmt")); - uint32_t syncflag = tokudb_fsync_on_commit(thd) ? 0 : DB_TXN_NOSYNC; tokudb_trx_data *trx = (tokudb_trx_data *) thd_get_ha_data(thd, hton); DB_TXN **txn = all ? &trx->all : &trx->stmt; DB_TXN *this_txn = *txn; if (this_txn) { + uint32_t syncflag = tokudb_fsync_on_commit(thd, trx, this_txn) ? 0 : DB_TXN_NOSYNC; if (tokudb_debug & TOKUDB_DEBUG_TXN) { TOKUDB_TRACE("commit trx %u txn %p syncflag %u", all, this_txn, syncflag); } @@ -850,7 +854,7 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) { TOKUDB_DBUG_ENTER(""); int r = 0; - /* if support_xa is disable, just return */ + // if tokudb_support_xa is disable, just return if (!THDVAR(thd, support_xa)) { TOKUDB_DBUG_RETURN(r); } From 9cd31bc559f64cd8e5624d54f56f2d8697dbf667 Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Sun, 4 Jan 2015 12:13:54 -0500 Subject: [PATCH 140/201] DB-787 the tokudb_report_fractal_tree_info_for_db function can leak a db on an error path where db->open fails --- storage/tokudb/hatoku_hton.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 83a1053a2d8..ff849256f77 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -1614,12 +1614,12 @@ static ST_FIELD_INFO tokudb_fractal_tree_info_field_info[] = { static int tokudb_report_fractal_tree_info_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) { int error; - DB *db; uint64_t bt_num_blocks_allocated; uint64_t bt_num_blocks_in_use; uint64_t bt_size_allocated; uint64_t bt_size_in_use; + DB *db = NULL; error = db_create(&db, db_env, 0); if (error) { goto exit; @@ -1631,12 +1631,6 @@ static int tokudb_report_fractal_tree_info_for_db(const DBT *dname, const DBT *i error = db->get_fractal_tree_info64(db, &bt_num_blocks_allocated, &bt_num_blocks_in_use, &bt_size_allocated, &bt_size_in_use); - { - int close_error = db->close(db, 0); - if (!error) { - error = close_error; - } - } if (error) { goto exit; } @@ -1668,6 +1662,11 @@ static int tokudb_report_fractal_tree_info_for_db(const DBT *dname, const DBT *i error = schema_table_store_record(thd, table); exit: + if (db) { + int close_error = db->close(db, 0); + if (error == 0) + error = close_error; + } return error; } From 6e0a00ed7534eee7afce8f1cfa168d77d0832d5d Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 6 Jan 2015 09:52:09 +0100 Subject: [PATCH 141/201] MDEV-7353: rpl_mdev6386 fails sporadically in buildbot Use include/sync_with_master_gtid.inc instead of --sync_with_master to avoid a race in the test case. In parallel replication, the old-style slave position (which is used by --sync_with_master) is updated out-of-order between parallel threads. This makes it possible for the position to be updated past DROP TEMPORARY TABLE t2 just before the commit of INSERT INTO t1 SELECT * FROM t2 becomes visible. In this case, there is a small window where a SELECT just after --sync_with_master may not see the changes from the INSERT. --- mysql-test/suite/rpl/r/rpl_mdev6386.result | 2 ++ mysql-test/suite/rpl/t/rpl_mdev6386.test | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_mdev6386.result b/mysql-test/suite/rpl/r/rpl_mdev6386.result index 352b9d07fef..fa49d9a9c03 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev6386.result +++ b/mysql-test/suite/rpl/r/rpl_mdev6386.result @@ -22,6 +22,7 @@ INSERT INTO t2 VALUE (4, 1); INSERT INTO t2 VALUE (5, 1); INSERT INTO t1 SELECT * FROM t2; DROP TEMPORARY TABLE t2; +include/save_master_gtid.inc Contents on master: SELECT * FROM t1 ORDER BY a; a b @@ -41,6 +42,7 @@ SET sql_log_bin= 0; DELETE FROM t1 WHERE a=1; SET sql_log_bin= 1; include/start_slave.inc +include/sync_with_master_gtid.inc Contents on slave after: SELECT * FROM t1 ORDER BY a; a b diff --git a/mysql-test/suite/rpl/t/rpl_mdev6386.test b/mysql-test/suite/rpl/t/rpl_mdev6386.test index 5513d15a77d..3e4e79ea5a3 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev6386.test +++ b/mysql-test/suite/rpl/t/rpl_mdev6386.test @@ -31,7 +31,7 @@ INSERT INTO t2 VALUE (4, 1); INSERT INTO t2 VALUE (5, 1); INSERT INTO t1 SELECT * FROM t2; DROP TEMPORARY TABLE t2; ---save_master_pos +--source include/save_master_gtid.inc --echo Contents on master: SELECT * FROM t1 ORDER BY a; @@ -56,7 +56,7 @@ DELETE FROM t1 WHERE a=1; SET sql_log_bin= 1; --source include/start_slave.inc ---sync_with_master +--source include/sync_with_master_gtid.inc --echo Contents on slave after: SELECT * FROM t1 ORDER BY a; From afd373c11951f48f7f9dde9990e7be2c76456559 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 6 Jan 2015 10:18:04 +0100 Subject: [PATCH 142/201] - Set connection charset before calling mysql_real_connect for MYSQL tables. This should fix bug MDEV-7343. modified: storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/myconn.h storage/connect/reldef.cpp storage/connect/reldef.h storage/connect/table.cpp storage/connect/tabmysql.cpp storage/connect/xtable.h - Prevent double column evaluation when CONNECT does filtering modified: storage/connect/connect.cc - Export CreateFileMap and CloseMemMap (for OEM tables) modified: storage/connect/maputil.h - Add the compute function to be used on VALUE types. Preserve precision for DOUBLE values. modified: storage/connect/value.cpp storage/connect/value.h - Typo (in preparation to the future JSON table type) modified: storage/connect/ha_connect.cc storage/connect/mycat.cc storage/connect/plgdbsem.h --- storage/connect/connect.cc | 15 ++- storage/connect/ha_connect.cc | 9 ++ storage/connect/maputil.h | 4 +- storage/connect/mycat.cc | 11 +- storage/connect/myconn.cpp | 17 ++- storage/connect/myconn.h | 3 +- storage/connect/plgdbsem.h | 8 +- storage/connect/reldef.cpp | 3 + storage/connect/reldef.h | 2 + storage/connect/table.cpp | 2 + storage/connect/tabmysql.cpp | 4 +- storage/connect/value.cpp | 236 +++++++++++++++++++++++++++++++++- storage/connect/value.h | 16 ++- storage/connect/xtable.h | 1 + 14 files changed, 305 insertions(+), 26 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 87c782ba953..a54d8ebcc44 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -52,7 +52,7 @@ /* Routines called internally by semantic routines. */ /***********************************************************************/ void CntEndDB(PGLOBAL); -RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr= false); +RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool reset, bool mrr= false); /***********************************************************************/ /* MySQL routines called externally by semantic routines. */ @@ -388,7 +388,7 @@ bool CntRewindTable(PGLOBAL g, PTDB tdbp) /***********************************************************************/ /* Evaluate all columns after a record is read. */ /***********************************************************************/ -RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr) +RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool reset, bool mrr) { RCODE rc= RC_OK; PCOL colp; @@ -413,7 +413,8 @@ RCODE EvalColumns(PGLOBAL g, PTDB tdbp, bool mrr) for (colp= tdbp->GetColumns(); rc == RC_OK && colp; colp= colp->GetNext()) { - colp->Reset(); + if (reset) + colp->Reset(); // Virtual columns are computed by MariaDB if (!colp->GetColUse(U_VIRTUAL) && (!mrr || colp->GetKcol())) @@ -457,6 +458,10 @@ RCODE CntReadNext(PGLOBAL g, PTDB tdbp) goto err; } // endif rc + // Do it now to avoid double eval when filtering + for (PCOL colp= tdbp->GetColumns(); colp; colp= colp->GetNext()) + colp->Reset(); + do { if ((rc= (RCODE)tdbp->ReadDB(g)) == RC_OK) if (!ApplyFilter(g, tdbp->GetFilter())) @@ -466,7 +471,7 @@ RCODE CntReadNext(PGLOBAL g, PTDB tdbp) err: g->jump_level--; - return (rc != RC_OK) ? rc : EvalColumns(g, tdbp); + return (rc != RC_OK) ? rc : EvalColumns(g, tdbp, false); } // end of CntReadNext /***********************************************************************/ @@ -812,7 +817,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, rnd: if ((rc= (RCODE)ptdb->ReadDB(g)) == RC_OK) - rc= EvalColumns(g, ptdb, mrr); + rc= EvalColumns(g, ptdb, true, mrr); return rc; } // end of CntIndexRead diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index ae8f7f0efa8..9c847b1d250 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1055,6 +1055,14 @@ char *ha_connect::GetStringOption(char *opname, char *sdef) opval= (char*)options->colist; else if (!stricmp(opname, "Data_charset")) opval= (char*)options->data_charset; + else if (!stricmp(opname, "Table_charset")) { + const CHARSET_INFO *chif= (tshp) ? tshp->table_charset + : table->s->table_charset; + + if (chif) + opval= (char*)chif->csname; + + } // endif Table_charset if (!opval && options && options->oplist) opval= GetListOption(xp->g, opname, options->oplist); @@ -3806,6 +3814,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) case TAB_XML: case TAB_INI: case TAB_VEC: +// case TAB_JSON: if (options->filename && *options->filename) { char *s, path[FN_REFLEN], dbpath[FN_REFLEN]; #if defined(WIN32) diff --git a/storage/connect/maputil.h b/storage/connect/maputil.h index b5e54affcea..e310488eb5d 100644 --- a/storage/connect/maputil.h +++ b/storage/connect/maputil.h @@ -11,8 +11,8 @@ typedef struct { DWORD lenH; } MEMMAP; -HANDLE CreateFileMap(PGLOBAL, LPCSTR, MEMMAP *, MODE, bool); -bool CloseMemMap(void *memory, size_t dwSize); +DllExport HANDLE CreateFileMap(PGLOBAL, LPCSTR, MEMMAP *, MODE, bool); +DllExport bool CloseMemMap(void *memory, size_t dwSize); #ifdef __cplusplus } diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index fc6c29092a1..57b2e5d1a9c 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2013 +/* Copyright (C) Olivier Bertrand 2004 - 2014 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 @@ -18,7 +18,7 @@ /* ------------- */ /* Version 1.4 */ /* */ -/* Author: Olivier Bertrand 2012 - 2013 */ +/* Author: Olivier Bertrand 2012 - 2014 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -89,6 +89,7 @@ #include "tabpivot.h" #endif // PIVOT_SUPPORT #include "tabvir.h" +//#include "tabjson.h" #include "ha_connect.h" #include "mycat.h" @@ -139,6 +140,7 @@ TABTYPE GetTypeID(const char *type) : (!stricmp(type, "PIVOT")) ? TAB_PIVOT #endif : (!stricmp(type, "VIR")) ? TAB_VIR +// : (!stricmp(type, "JSON")) ? TAB_JSON : (!stricmp(type, "OEM")) ? TAB_OEM : TAB_NIY; } // end of GetTypeID @@ -159,6 +161,7 @@ bool IsFileType(TABTYPE type) case TAB_XML: case TAB_INI: case TAB_VEC: +// case TAB_JSON: isfile= true; break; default: @@ -181,6 +184,7 @@ bool IsExactType(TABTYPE type) case TAB_BIN: case TAB_DBF: // case TAB_XML: depends on Multiple || Xpand || Coltype +// case TAB_JSON: depends on Multiple || Xpand || Coltype case TAB_VEC: case TAB_VIR: exact= true; @@ -214,7 +218,7 @@ bool IsTypeNullable(TABTYPE type) } // end of IsTypeNullable /***********************************************************************/ -/* Return true for indexable table by XINDEX. */ +/* Return true for fixed record length tables. */ /***********************************************************************/ bool IsTypeFixed(TABTYPE type) { @@ -538,6 +542,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) case TAB_PIVOT: tdp= new(g) PIVOTDEF; break; #endif // PIVOT_SUPPORT case TAB_VIR: tdp= new(g) VIRDEF; break; +// case TAB_JSON: tdp= new(g) JSONDEF; break; default: sprintf(g->Message, MSG(BAD_TABLE_TYPE), am, name); } // endswitch diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 92c2faea676..2f3d75b52fa 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -430,10 +430,11 @@ int MYSQLC::GetResultSize(PGLOBAL g, PSZ sql) /***********************************************************************/ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, const char *user, const char *pwd, - int pt) + int pt, const char *csname) { const char *pipe = NULL; - uint cto = 6000, nrt = 12000; + uint cto = 6000, nrt = 12000; + my_bool my_true= 1; m_DB = mysql_init(NULL); @@ -470,6 +471,18 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, } // endif pwd #endif // 0 +/***********************************************************************/ +/* BUG# 17044 Federated Storage Engine is not UTF8 clean */ +/* Add set names to whatever charset the table is at open of table */ +/* this sets the csname like 'set names utf8'. */ +/***********************************************************************/ + if (csname) + mysql_options(m_DB, MYSQL_SET_CHARSET_NAME, csname); + + // Don't know what this one do but FEDERATED does it + mysql_options(m_DB, MYSQL_OPT_USE_THREAD_SPECIFIC_MEMORY, + (char*)&my_true); + if (!mysql_real_connect(m_DB, host, user, pwd, db, pt, pipe, CLIENT_MULTI_RESULTS)) { #if defined(_DEBUG) sprintf(g->Message, "mysql_real_connect failed: (%d) %s", diff --git a/storage/connect/myconn.h b/storage/connect/myconn.h index 65e6531aee4..79b8a43fe5a 100644 --- a/storage/connect/myconn.h +++ b/storage/connect/myconn.h @@ -67,7 +67,7 @@ class DllItem MYSQLC { int GetTableSize(PGLOBAL g, PSZ query); int Open(PGLOBAL g, const char *host, const char *db, const char *user= "root", const char *pwd= "*", - int pt= 0); + int pt= 0, const char *csname = NULL); int KillQuery(ulong id); int ExecSQL(PGLOBAL g, const char *query, int *w = NULL); int ExecSQLcmd(PGLOBAL g, const char *query, int *w); @@ -98,5 +98,6 @@ class DllItem MYSQLC { int m_Fields; // The number of result fields int m_Afrw; // The number of affected rows bool m_Use; // Use or store result set + const char *csname; // Table charset name }; // end of class MYSQLC diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index bbbbc1486b6..b4af13c57cc 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -74,9 +74,11 @@ enum TABTYPE {TAB_UNDEF = 0, /* Table of undefined type */ TAB_PLG = 20, /* PLG NIY */ TAB_PIVOT = 21, /* PIVOT table */ TAB_VIR = 22, /* Virtual tables */ - TAB_JCT = 23, /* Junction tables NIY */ - TAB_DMY = 24, /* DMY Dummy tables NIY */ - TAB_NIY = 25}; /* Table not implemented yet */ + TAB_JSON = 23, /* JSON tables */ + TAB_JSN = 24, /* Semi-json tables */ + TAB_JCT = 25, /* Junction tables NIY */ + TAB_DMY = 26, /* DMY Dummy tables NIY */ + TAB_NIY = 27}; /* Table not implemented yet */ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */ TYPE_AM_ROWID = 1, /* ROWID type (special column) */ diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index e469ae40f1f..51d777a7d17 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -202,6 +202,8 @@ TABDEF::TABDEF(void) Degree = 0; Pseudo = 0; Read_Only = false; + m_data_charset = NULL; + csname = NULL; } // end of TABDEF constructor /***********************************************************************/ @@ -224,6 +226,7 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR am) m_data_charset= data_charset_name ? get_charset_by_csname(data_charset_name, MY_CS_PRIMARY, 0): NULL; + csname = GetStringCatInfo(g, "Table_charset", NULL); // Get The column definitions if ((poff = GetColCatInfo(g)) < 0) diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h index a1dfe87dca8..6160ea71680 100644 --- a/storage/connect/reldef.h +++ b/storage/connect/reldef.h @@ -68,6 +68,7 @@ class DllExport TABDEF : public RELDEF { /* Logical table descriptor */ friend class CATALOG; friend class PLUGCAT; friend class MYCAT; + friend class TDBASE; public: // Constructor TABDEF(void); // Constructor @@ -110,6 +111,7 @@ class DllExport TABDEF : public RELDEF { /* Logical table descriptor */ int Pseudo; /* Bit: 1 ROWID Ok, 2 FILEID Ok */ bool Read_Only; /* true for read only tables */ const CHARSET_INFO *m_data_charset; + const char *csname; /* Table charset name */ }; // end of TABDEF /***********************************************************************/ diff --git a/storage/connect/table.cpp b/storage/connect/table.cpp index b093e2102c2..cbd5910d8c8 100644 --- a/storage/connect/table.cpp +++ b/storage/connect/table.cpp @@ -146,6 +146,7 @@ TDBASE::TDBASE(PTABDEF tdp) : TDB(tdp) Knum = 0; Read_Only = (tdp) ? tdp->IsReadOnly() : false; m_data_charset= (tdp) ? tdp->data_charset() : NULL; + csname = (tdp) ? tdp->csname : NULL; } // end of TDBASE constructor TDBASE::TDBASE(PTDBASE tdbp) : TDB(tdbp) @@ -161,6 +162,7 @@ TDBASE::TDBASE(PTDBASE tdbp) : TDB(tdbp) Knum = tdbp->Knum; Read_Only = tdbp->Read_Only; m_data_charset= tdbp->m_data_charset; + csname = tdbp->csname; } // end of TDBASE copy constructor /***********************************************************************/ diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 3ec9a1feaee..54627ba43fd 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -777,7 +777,7 @@ int TDBMYSQL::Cardinality(PGLOBAL g) char query[96]; MYSQLC myc; - if (myc.Open(g, Host, Database, User, Pwd, Port)) + if (myc.Open(g, Host, Database, User, Pwd, Port, csname)) return -1; strcpy(query, "SELECT COUNT(*) FROM "); @@ -871,7 +871,7 @@ bool TDBMYSQL::OpenDB(PGLOBAL g) /* servers allowing concurency in getting results ??? */ /*********************************************************************/ if (!Myc.Connected()) { - if (Myc.Open(g, Host, Database, User, Pwd, Port)) + if (Myc.Open(g, Host, Database, User, Pwd, Port, csname)) return true; } // endif Connected diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 7227e637a14..3ed58d3e257 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -330,7 +330,7 @@ int ConvertType(int target, int type, CONV kind, bool match) /***********************************************************************/ /* AllocateConstant: allocates a constant Value. */ /***********************************************************************/ -PVAL AllocateValue(PGLOBAL g, void *value, short type) +PVAL AllocateValue(PGLOBAL g, void *value, short type, short prec) { PVAL valp; @@ -351,7 +351,7 @@ PVAL AllocateValue(PGLOBAL g, void *value, short type) valp = new(g) TYPVAL(*(longlong*)value, TYPE_BIGINT); break; case TYPE_DOUBLE: - valp = new(g) TYPVAL(*(double *)value, TYPE_DOUBLE, 2); + valp = new(g) TYPVAL(*(double *)value, TYPE_DOUBLE, prec); break; case TYPE_TINY: valp = new(g) TYPVAL(*(char *)value, TYPE_TINY); @@ -475,7 +475,7 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns) break; case TYPE_DOUBLE: valp = new(g) TYPVAL(valp->GetFloatValue(), TYPE_DOUBLE, - valp->GetValPrec()); + (uns) ? uns : valp->GetValPrec()); break; case TYPE_TINY: if (un) @@ -542,6 +542,15 @@ BYTE VALUE::TestValue(PVAL vp) return (n > 0) ? 0x04 : (n < 0) ? 0x02 : 0x01; } // end of TestValue +/***********************************************************************/ +/* Compute a function on a string. */ +/***********************************************************************/ +bool VALUE::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) + { + strcpy(g->Message, "Compute not implemented for this value type"); + return true; + } // end of Compute + /* -------------------------- Class TYPVAL ---------------------------- */ /***********************************************************************/ @@ -930,6 +939,188 @@ int TYPVAL::CompareValue(PVAL vp) return (Tval > n) ? 1 : (Tval < n) ? (-1) : 0; } // end of CompareValue +#if 0 +/***********************************************************************/ +/* Return max type value if b is true, else min type value. */ +/***********************************************************************/ +template <> +short TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXINT16 : MININT16;} + +template <> +USHORT TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXUINT16 : 0;} + +template <> +int TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXINT32 : MININT32;} + +template <> +UINT TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXUINT32 : 0;} + +template <> +longlong TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXINT64 : MININT64;} + +template <> +ulonglong TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXUINT64 : 0;} + +template <> +double TYPVAL::MinMaxVal(bool b) + {assert(false); return 0.0;} + +template <> +char TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXINT8 : MININT8;} + +template <> +UCHAR TYPVAL::MinMaxVal(bool b) + {return (b) ? MAXUINT8 : 0;} + +/***********************************************************************/ +/* SafeAdd: adds a value and test whether overflow/underflow occured. */ +/***********************************************************************/ +template +TYPE TYPVAL::SafeAdd(TYPE n1, TYPE n2) + { + PGLOBAL& g = Global; + TYPE n = n1 + n2; + + if ((n2 > 0) && (n < n1)) { + // Overflow + strcpy(g->Message, MSG(FIX_OVFLW_ADD)); + longjmp(g->jumper[g->jump_level], 138); + } else if ((n2 < 0) && (n > n1)) { + // Underflow + strcpy(g->Message, MSG(FIX_UNFLW_ADD)); + longjmp(g->jumper[g->jump_level], 138); + } // endif's n2 + + return n; + } // end of SafeAdd + +template <> +inline double TYPVAL::SafeAdd(double n1, double n2) + { + assert(false); return 0; + } // end of SafeAdd + +/***********************************************************************/ +/* SafeMult: multiply values and test whether overflow occured. */ +/***********************************************************************/ +template +TYPE TYPVAL::SafeMult(TYPE n1, TYPE n2) + { + PGLOBAL& g = Global; + double n = (double)n1 * (double)n2; + + if (n > MinMaxVal(true)) { + // Overflow + strcpy(g->Message, MSG(FIX_OVFLW_TIMES)); + longjmp(g->jumper[g->jump_level], 138); + } else if (n < MinMaxVal(false)) { + // Underflow + strcpy(g->Message, MSG(FIX_UNFLW_TIMES)); + longjmp(g->jumper[g->jump_level], 138); + } // endif's n2 + + return (TYPE)n; + } // end of SafeMult + +template <> +inline double TYPVAL::SafeMult(double n1, double n2) + { + assert(false); return 0; + } // end of SafeMult +#endif // 0 + +/***********************************************************************/ +/* Compute defined functions for the type. */ +/***********************************************************************/ +template +bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) + { + bool rc = false; + TYPE val[2]; + + assert(np == 2); + + for (int i = 0; i < np; i++) + val[i] = GetTypedValue(vp[i]); + + switch (op) { + case OP_ADD: +// Tval = SafeAdd(val[0], val[1]); + Tval = val[0] + val[1]; + break; + case OP_MULT: +// Tval = SafeMult(val[0], val[1]); + Tval = val[0] * val[1]; + break; + default: + rc = Compall(g, vp, np, op); + break; + } // endswitch op + + return rc; + } // end of Compute + +#if 0 +template <> +bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) + { + bool rc = false; + double val[2]; + + assert(np == 2); + + for (int i = 0; i < np; i++) + val[i] = vp[i]->GetFloatValue(); + + switch (op) { + case OP_ADD: + Tval = val[0] + val[1]; + break; + case OP_MULT: + Tval = val[0] * val[1]; + break; + default: + rc = Compall(g, vp, np, op); + } // endswitch op + + return rc; + } // end of Compute +#endif // 0 + +/***********************************************************************/ +/* Compute a function for all types. */ +/***********************************************************************/ +template +bool TYPVAL::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op) + { + TYPE val[2]; + + for (int i = 0; i < np; i++) + val[i] = GetTypedValue(vp[i]); + + switch (op) { + case OP_MIN: + Tval = MY_MIN(val[0], val[1]); + break; + case OP_MAX: + Tval = MY_MAX(val[0], val[1]); + break; + default: +// sprintf(g->Message, MSG(BAD_EXP_OPER), op); + strcpy(g->Message, "Function not supported"); + return true; + } // endswitch op + + return false; + } // end of Compall + /***********************************************************************/ /* FormatValue: This function set vp (a STRING value) to the string */ /* constructed from its own value formated using the fmt format. */ @@ -1409,6 +1600,45 @@ int TYPVAL::CompareValue(PVAL vp) return (n > 0) ? 1 : (n < 0) ? -1 : 0; } // end of CompareValue +/***********************************************************************/ +/* Compute a function on a string. */ +/***********************************************************************/ +bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) + { + char *p[2], val[2][32]; + int i; + + for (i = 0; i < np; i++) + p[i] = vp[i]->GetCharString(val[i]); + + switch (op) { + case OP_CNC: + assert(np == 1 || np == 2); + + if (np == 2) + strncpy(Strp, p[0], Len); + + if ((i = Len - (signed)strlen(Strp)) > 0) + strncat(Strp, p[np - 1], i); + + break; + case OP_MIN: + assert(np == 2); + strcpy(Strp, (strcmp(p[0], p[1]) < 0) ? p[0] : p[1]); + break; + case OP_MAX: + assert(np == 2); + strcpy(Strp, (strcmp(p[0], p[1]) > 0) ? p[0] : p[1]); + break; + default: +// sprintf(g->Message, MSG(BAD_EXP_OPER), op); + strcpy(g->Message, "Function not supported"); + return true; + } // endswitch op + + return false; + } // end of Compute + /***********************************************************************/ /* FormatValue: This function set vp (a STRING value) to the string */ /* constructed from its own value formated using the fmt format. */ diff --git a/storage/connect/value.h b/storage/connect/value.h index 3ce7027aeeb..c2cc24894ae 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -29,12 +29,9 @@ enum CONV {CNV_ANY = 0, /* Convert to any type */ class CONSTANT; // For friend setting typedef struct _datpar *PDTP; // For DTVAL - /***********************************************************************/ /* Utilities used to test types and to allocated values. */ /***********************************************************************/ -PVAL AllocateValue(PGLOBAL, void *, short); - // Exported functions DllExport PSZ GetTypeName(int); DllExport int GetTypeSize(int, int); @@ -47,6 +44,7 @@ DllExport int GetFormatType(char); DllExport bool IsTypeChar(int type); DllExport bool IsTypeNum(int type); DllExport int ConvertType(int, int, CONV, bool match = false); +DllExport PVAL AllocateValue(PGLOBAL, void *, short, short = 2); DllExport PVAL AllocateValue(PGLOBAL, PVAL, int = TYPE_VOID, int = 0); DllExport PVAL AllocateValue(PGLOBAL, int, int len = 0, int prec = 0, bool uns = false, PSZ fmt = NULL); @@ -114,6 +112,7 @@ class DllExport VALUE : public BLOCK { virtual char *ShowValue(char *buf, int len = 0) = 0; virtual char *GetCharString(char *p) = 0; virtual bool IsEqual(PVAL vp, bool chktype) = 0; + virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op); virtual bool FormatValue(PVAL vp, char *fmt) = 0; protected: @@ -149,9 +148,9 @@ class DllExport TYPVAL : public VALUE { virtual bool IsZero(void) {return Tval == 0;} virtual void Reset(void) {Tval = 0;} virtual int GetValLen(void); - virtual int GetValPrec() {return 0;} + virtual int GetValPrec() {return Prec;} virtual int GetSize(void) {return sizeof(TYPE);} - virtual PSZ GetCharValue(void) {return VALUE::GetCharValue();} +//virtual PSZ GetCharValue(void) {return VALUE::GetCharValue();} virtual char GetTinyValue(void) {return (char)Tval;} virtual uchar GetUTinyValue(void) {return (uchar)Tval;} virtual short GetShortValue(void) {return (short)Tval;} @@ -184,12 +183,18 @@ class DllExport TYPVAL : public VALUE { virtual char *ShowValue(char *buf, int); virtual char *GetCharString(char *p); virtual bool IsEqual(PVAL vp, bool chktype); + virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op); virtual bool SetConstFormat(PGLOBAL, FORMAT&); virtual bool FormatValue(PVAL vp, char *fmt); virtual void Print(PGLOBAL g, FILE *, uint); virtual void Print(PGLOBAL g, char *, uint); protected: +//static TYPE MinMaxVal(bool b); +// TYPE SafeAdd(TYPE n1, TYPE n2); +// TYPE SafeMult(TYPE n1, TYPE n2); + bool Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op); + // Default constructor not to be used TYPVAL(void) : VALUE(TYPE_ERROR) {} @@ -253,6 +258,7 @@ class DllExport TYPVAL: public VALUE { virtual char *ShowValue(char *buf, int); virtual char *GetCharString(char *p); virtual bool IsEqual(PVAL vp, bool chktype); + virtual bool Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op); virtual bool FormatValue(PVAL vp, char *fmt); virtual bool SetConstFormat(PGLOBAL, FORMAT&); diff --git a/storage/connect/xtable.h b/storage/connect/xtable.h index 49fbbb0de26..501a5e87cfa 100644 --- a/storage/connect/xtable.h +++ b/storage/connect/xtable.h @@ -209,6 +209,7 @@ class DllExport TDBASE : public TDB { int Knum; // Size of key arrays bool Read_Only; // True for read only tables const CHARSET_INFO *m_data_charset; + const char *csname; // Table charset name }; // end of class TDBASE /***********************************************************************/ From d4bf64556ea8f8b5f4be052d683e87727aad872d Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 6 Jan 2015 11:32:40 +0100 Subject: [PATCH 143/201] - Typo to eliminate some GCC warnings modified: storage/connect/odbconn.cpp storage/connect/plgdbsem.h --- storage/connect/odbconn.cpp | 2 +- storage/connect/plgdbsem.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index b9cf8054e3a..ec8be43b059 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2453,7 +2453,7 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g) /***********************************************************************/ int ODBConn::Rewind(char *sql, ODBCCOL *tocols) { - int rc, rbuf; + int rc, rbuf = -1; if (!m_hstmt) rbuf = -1; diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index b4af13c57cc..24090e98804 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -74,8 +74,8 @@ enum TABTYPE {TAB_UNDEF = 0, /* Table of undefined type */ TAB_PLG = 20, /* PLG NIY */ TAB_PIVOT = 21, /* PIVOT table */ TAB_VIR = 22, /* Virtual tables */ - TAB_JSON = 23, /* JSON tables */ - TAB_JSN = 24, /* Semi-json tables */ +// TAB_JSON = 23, /* JSON tables */ +// TAB_JSN = 24, /* Semi-json tables */ TAB_JCT = 25, /* Junction tables NIY */ TAB_DMY = 26, /* DMY Dummy tables NIY */ TAB_NIY = 27}; /* Table not implemented yet */ From 4a3251595cc697bfdb15b67c07514bd3c4779e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 6 Jan 2015 16:08:42 +0200 Subject: [PATCH 144/201] MDEV-7403: should not pass recv_writer_thread_handle to CloseHandle() Analysis: For some reason actual thread handle is not returned on Windows instead lpThreadId was returned and thread handle was closed after thread create. Later CloseHandle was called for recv_writer_thread_handle and psort_info->thread_hdl. Fix: Return thread handle from os_thread_create() also on Windows and store these thread handles also in srv0start.cc so that they can be later closed. --- storage/innobase/os/os0thread.cc | 6 +-- storage/innobase/srv/srv0start.cc | 70 ++++++++++++++++++++---- storage/xtradb/os/os0thread.cc | 6 +-- storage/xtradb/srv/srv0start.cc | 89 ++++++++++++++++++++++++++----- 4 files changed, 141 insertions(+), 30 deletions(-) diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc index 6736df46a87..c855ac2c3b9 100644 --- a/storage/innobase/os/os0thread.cc +++ b/storage/innobase/os/os0thread.cc @@ -132,10 +132,8 @@ os_thread_create_func( if (thread_id) { *thread_id = win_thread_id; } - if (thread) { - CloseHandle(thread); - } - return((os_thread_t)win_thread_id); + + return((os_thread_t)thread); #else int ret; os_thread_t pthread; diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index d1be5be9238..c56f90ff0a8 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -131,6 +131,17 @@ static ulint n[SRV_MAX_N_IO_THREADS + 6]; /** io_handler_thread identifiers, 32 is the maximum number of purge threads */ static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 32]; +/** Thead handles */ +static os_thread_t thread_handles[SRV_MAX_N_IO_THREADS + 6 + 32]; +static os_thread_t buf_flush_page_cleaner_thread_handle; +static os_thread_t buf_dump_thread_handle; +static os_thread_t dict_stats_thread_handle; +/** Status variables, is thread started ?*/ +static bool thread_started[SRV_MAX_N_IO_THREADS + 6 + 32] = {false}; +static bool buf_flush_page_cleaner_thread_started = false; +static bool buf_dump_thread_started = false; +static bool dict_stats_thread_started = false; + /** We use this mutex to test the return value of pthread_mutex_trylock on successful locking. HP-UX does NOT return 0, though Linux et al do. */ static os_fast_mutex_t srv_os_test_mutex; @@ -1983,7 +1994,8 @@ innobase_start_or_create_for_mysql(void) n[i] = i; - os_thread_create(io_handler_thread, n + i, thread_ids + i); + thread_handles[i] = os_thread_create(io_handler_thread, n + i, thread_ids + i); + thread_started[i] = true; } #ifdef UNIV_LOG_ARCHIVE @@ -2647,19 +2659,22 @@ files_checked: if (!srv_read_only_mode) { /* Create the thread which watches the timeouts for lock waits */ - os_thread_create( + thread_handles[2 + SRV_MAX_N_IO_THREADS] = os_thread_create( lock_wait_timeout_thread, NULL, thread_ids + 2 + SRV_MAX_N_IO_THREADS); + thread_started[2 + SRV_MAX_N_IO_THREADS] = true; /* Create the thread which warns of long semaphore waits */ - os_thread_create( + thread_handles[3 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_error_monitor_thread, NULL, thread_ids + 3 + SRV_MAX_N_IO_THREADS); + thread_started[3 + SRV_MAX_N_IO_THREADS] = true; /* Create the thread which prints InnoDB monitor info */ - os_thread_create( + thread_handles[4 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_monitor_thread, NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); + thread_started[4 + SRV_MAX_N_IO_THREADS] = true; } /* Create the SYS_FOREIGN and SYS_FOREIGN_COLS system tables */ @@ -2686,26 +2701,30 @@ files_checked: if (!srv_read_only_mode) { - os_thread_create( + thread_handles[1 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_master_thread, NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS)); + thread_started[1 + SRV_MAX_N_IO_THREADS] = true; } if (!srv_read_only_mode && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) { - os_thread_create( + thread_handles[5 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_purge_coordinator_thread, NULL, thread_ids + 5 + SRV_MAX_N_IO_THREADS); + thread_started[5 + SRV_MAX_N_IO_THREADS] = true; + ut_a(UT_ARR_SIZE(thread_ids) > 5 + srv_n_purge_threads + SRV_MAX_N_IO_THREADS); /* We've already created the purge coordinator thread above. */ for (i = 1; i < srv_n_purge_threads; ++i) { - os_thread_create( + thread_handles[5 + i + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_worker_thread, NULL, thread_ids + 5 + i + SRV_MAX_N_IO_THREADS); + thread_started[5 + i + SRV_MAX_N_IO_THREADS] = true; } srv_start_wait_for_purge_to_start(); @@ -2715,7 +2734,8 @@ files_checked: } if (!srv_read_only_mode) { - os_thread_create(buf_flush_page_cleaner_thread, NULL, NULL); + buf_flush_page_cleaner_thread_handle = os_thread_create(buf_flush_page_cleaner_thread, NULL, NULL); + buf_flush_page_cleaner_thread_started = true; } #ifdef UNIV_DEBUG @@ -2860,10 +2880,12 @@ files_checked: if (!srv_read_only_mode) { /* Create the buffer pool dump/load thread */ - os_thread_create(buf_dump_thread, NULL, NULL); + buf_dump_thread_handle = os_thread_create(buf_dump_thread, NULL, NULL); + buf_dump_thread_started = true; /* Create the dict stats gathering thread */ - os_thread_create(dict_stats_thread, NULL, NULL); + dict_stats_thread_handle = os_thread_create(dict_stats_thread, NULL, NULL); + dict_stats_thread_started = true; /* Create the thread that will optimize the FTS sub-system. */ fts_optimize_init(); @@ -3032,6 +3054,34 @@ innobase_shutdown_for_mysql(void) dict_stats_thread_deinit(); } +#ifdef __WIN__ + /* MDEV-361: ha_innodb.dll leaks handles on Windows + MDEV-7403: should not pass recv_writer_thread_handle to + CloseHandle(). + + On Windows we should call CloseHandle() for all + open thread handles. */ + if (os_thread_count == 0) { + for (i = 0; i < SRV_MAX_N_IO_THREADS + 6 + 32; ++i) { + if (thread_started[i]) { + CloseHandle(thread_handles[i]); + } + } + + if (buf_flush_page_cleaner_thread_started) { + CloseHandle(buf_flush_page_cleaner_thread_handle); + } + + if (buf_dump_thread_started) { + CloseHandle(buf_dump_thread_handle); + } + + if (dict_stats_thread_started) { + CloseHandle(dict_stats_thread_handle); + } + } +#endif /* __WIN __ */ + /* This must be disabled before closing the buffer pool and closing the data dictionary. */ btr_search_disable(); diff --git a/storage/xtradb/os/os0thread.cc b/storage/xtradb/os/os0thread.cc index 848c0ca4212..9a2ee6e47ae 100644 --- a/storage/xtradb/os/os0thread.cc +++ b/storage/xtradb/os/os0thread.cc @@ -156,10 +156,8 @@ os_thread_create_func( if (thread_id) { *thread_id = win_thread_id; } - if (thread) { - CloseHandle(thread); - } - return((os_thread_t)win_thread_id); + + return((os_thread_t)thread); #else int ret; os_thread_t pthread; diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 8d4d7620f4d..7d1192d0dac 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -134,6 +134,21 @@ static ulint n[SRV_MAX_N_IO_THREADS + 6]; static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + SRV_MAX_N_PURGE_THREADS]; +/** Thead handles */ +static os_thread_t thread_handles[SRV_MAX_N_IO_THREADS + 6 + SRV_MAX_N_PURGE_THREADS]; +static os_thread_t buf_flush_page_cleaner_thread_handle; +static os_thread_t buf_dump_thread_handle; +static os_thread_t dict_stats_thread_handle; +static os_thread_t buf_flush_lru_manager_thread_handle; +static os_thread_t srv_redo_log_follow_thread_handle; +/** Status variables, is thread started ?*/ +static bool thread_started[SRV_MAX_N_IO_THREADS + 6 + SRV_MAX_N_PURGE_THREADS] = {false}; +static bool buf_flush_page_cleaner_thread_started = false; +static bool buf_dump_thread_started = false; +static bool dict_stats_thread_started = false; +static bool buf_flush_lru_manager_thread_started = false; +static bool srv_redo_log_follow_thread_started = false; + /** We use this mutex to test the return value of pthread_mutex_trylock on successful locking. HP-UX does NOT return 0, though Linux et al do. */ static os_fast_mutex_t srv_os_test_mutex; @@ -1532,8 +1547,9 @@ init_log_online(void) /* Create the thread that follows the redo log to output the changed page bitmap */ - os_thread_create(&srv_redo_log_follow_thread, NULL, + srv_redo_log_follow_thread_handle = os_thread_create(&srv_redo_log_follow_thread, NULL, thread_ids + 5 + SRV_MAX_N_IO_THREADS); + srv_redo_log_follow_thread_started = true; } } @@ -2059,7 +2075,8 @@ innobase_start_or_create_for_mysql(void) n[i] = i; - os_thread_create(io_handler_thread, n + i, thread_ids + i); + thread_handles[i] = os_thread_create(io_handler_thread, n + i, thread_ids + i); + thread_started[i] = true; } if (srv_n_log_files * srv_log_file_size * UNIV_PAGE_SIZE @@ -2722,19 +2739,22 @@ files_checked: if (!srv_read_only_mode) { /* Create the thread which watches the timeouts for lock waits */ - os_thread_create( + thread_handles[2 + SRV_MAX_N_IO_THREADS] = os_thread_create( lock_wait_timeout_thread, NULL, thread_ids + 2 + SRV_MAX_N_IO_THREADS); + thread_started[2 + SRV_MAX_N_IO_THREADS] = true; /* Create the thread which warns of long semaphore waits */ - os_thread_create( + thread_handles[3 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_error_monitor_thread, NULL, thread_ids + 3 + SRV_MAX_N_IO_THREADS); + thread_started[3 + SRV_MAX_N_IO_THREADS] = true; /* Create the thread which prints InnoDB monitor info */ - os_thread_create( + thread_handles[4 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_monitor_thread, NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); + thread_started[4 + SRV_MAX_N_IO_THREADS] = true; } /* Create the SYS_FOREIGN and SYS_FOREIGN_COLS system tables */ @@ -2761,26 +2781,30 @@ files_checked: if (!srv_read_only_mode) { - os_thread_create( + thread_handles[1 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_master_thread, NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS)); + thread_started[1 + SRV_MAX_N_IO_THREADS] = true; } if (!srv_read_only_mode && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) { - os_thread_create( + thread_handles[5 + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_purge_coordinator_thread, NULL, thread_ids + 5 + SRV_MAX_N_IO_THREADS); + thread_started[5 + SRV_MAX_N_IO_THREADS] = true; + ut_a(UT_ARR_SIZE(thread_ids) > 5 + srv_n_purge_threads + SRV_MAX_N_IO_THREADS); /* We've already created the purge coordinator thread above. */ for (i = 1; i < srv_n_purge_threads; ++i) { - os_thread_create( + thread_handles[5 + i + SRV_MAX_N_IO_THREADS] = os_thread_create( srv_worker_thread, NULL, thread_ids + 5 + i + SRV_MAX_N_IO_THREADS); + thread_started[5 + i + SRV_MAX_N_IO_THREADS] = true; } srv_start_wait_for_purge_to_start(); @@ -2790,9 +2814,12 @@ files_checked: } if (!srv_read_only_mode) { - os_thread_create(buf_flush_page_cleaner_thread, NULL, NULL); + buf_flush_page_cleaner_thread_handle = os_thread_create(buf_flush_page_cleaner_thread, NULL, NULL); + buf_flush_page_cleaner_thread_started = true; } - os_thread_create(buf_flush_lru_manager_thread, NULL, NULL); + + buf_flush_lru_manager_thread_handle = os_thread_create(buf_flush_lru_manager_thread, NULL, NULL); + buf_flush_lru_manager_thread_started = true; #ifdef UNIV_DEBUG /* buf_debug_prints = TRUE; */ @@ -2943,10 +2970,12 @@ files_checked: if (!srv_read_only_mode) { /* Create the buffer pool dump/load thread */ - os_thread_create(buf_dump_thread, NULL, NULL); + buf_dump_thread_handle = os_thread_create(buf_dump_thread, NULL, NULL); + buf_dump_thread_started = true; /* Create the dict stats gathering thread */ - os_thread_create(dict_stats_thread, NULL, NULL); + dict_stats_thread_handle = os_thread_create(dict_stats_thread, NULL, NULL); + dict_stats_thread_started = true; /* Create the thread that will optimize the FTS sub-system. */ fts_optimize_init(); @@ -3115,6 +3144,42 @@ innobase_shutdown_for_mysql(void) dict_stats_thread_deinit(); } +#ifdef __WIN__ + /* MDEV-361: ha_innodb.dll leaks handles on Windows + MDEV-7403: should not pass recv_writer_thread_handle to + CloseHandle(). + + On Windows we should call CloseHandle() for all + open thread handles. */ + if (os_thread_count == 0) { + for (i = 0; i < SRV_MAX_N_IO_THREADS + 6 + 32; ++i) { + if (thread_started[i]) { + CloseHandle(thread_handles[i]); + } + } + + if (buf_flush_page_cleaner_thread_started) { + CloseHandle(buf_flush_page_cleaner_thread_handle); + } + + if (buf_dump_thread_started) { + CloseHandle(buf_dump_thread_handle); + } + + if (dict_stats_thread_started) { + CloseHandle(dict_stats_thread_handle); + } + + if (buf_flush_lru_manager_thread_started) { + CloseHandle(buf_flush_lru_manager_thread_handle); + } + + if (srv_redo_log_follow_thread_started) { + CloseHandle(srv_redo_log_follow_thread_handle); + } + } +#endif /* __WIN __ */ + /* This must be disabled before closing the buffer pool and closing the data dictionary. */ btr_search_disable(); From 00649525ee8a37336221f1918943eca78f5453df Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Tue, 6 Jan 2015 16:32:41 +0100 Subject: [PATCH 145/201] MDEV-7189: main.processlist fails sporadically in buildbot The test case tried to trigger a DEBUG_SYNC point at the end of a SELECT SLEEP(5) statement. It did this by using EXECUTE 2, intending to trigger first at the end of SET DEBUG_SYNC, and second at the end of the SELECT SLEEP(5). However, in --ps-protocol mode, this does not work, because the SELECT is executed in two steps (Prepare followed by Execute). Thus, the DEBUG_SYNC got triggered too early, during the Prepare stage rather than Execute, and the test case could race and information_schema.processlist see the thread in the wrong state. This patch fixes by changing the way the DEBUG_SYNC point is triggered. Now we add a DBUG injection inside the code for SLEEP(5). This ensures that the DEBUG_SYNC point is not activated until the SLEEP(5) is running, ensuring that the following wait for completion will be effective. --- mysql-test/mysql-test-run.pl | 1 + mysql-test/r/processlist.result | 5 ++--- mysql-test/t/processlist.test | 18 +++++++++--------- sql/item_func.cc | 5 +++++ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 60f3475bd17..50fb36d8989 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2495,6 +2495,7 @@ sub environment_setup { # ---------------------------------------------------- my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'), "$basedir/extra/replace", + "$bindir/extra$opt_vs_config/replace", "$path_client_bindir/replace"); $ENV{'REPLACE'}= native_path($exe_replace); diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result index 0182245c278..eb3af67c5bf 100644 --- a/mysql-test/r/processlist.result +++ b/mysql-test/r/processlist.result @@ -7,9 +7,8 @@ SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed'; ID TIME TIME_MS TID 0 0.000 -SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2'; -SET DEBUG_SYNC= 'now WAIT_FOR query_done'; -SET DEBUG_SYNC= 'now SIGNAL nosignal'; +set debug_sync='reset'; +SET debug_dbug="+d,sleep_inject_query_done_debug_sync"; select sleep(5); sleep(5) 0 diff --git a/mysql-test/t/processlist.test b/mysql-test/t/processlist.test index 9c555c0f9fb..a8f8a4ed64c 100644 --- a/mysql-test/t/processlist.test +++ b/mysql-test/t/processlist.test @@ -2,6 +2,7 @@ # MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647) # +source include/have_debug.inc; source include/have_debug_sync.inc; let $tid= `SELECT CONNECTION_ID()`; @@ -21,6 +22,7 @@ SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed'; connection con1; --replace_result $tid TID reap; +set debug_sync='reset'; connection default; # @@ -28,15 +30,13 @@ connection default; # connection con1; -# Trigger a signal once the thread has gone from "Query" to "Sleep" command -# state. Note we need to execute this twice: Once at the end of SET DEBUG_SYNC, -# and once for the intended time, at the end of SELECT SLEEP(). -SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2'; -connection default; -# Wait for and clear the first signal set during SET DEBUG_SYNC. -SET DEBUG_SYNC= 'now WAIT_FOR query_done'; -SET DEBUG_SYNC= 'now SIGNAL nosignal'; -connection con1; +# This DBUG insertion triggers a DEBUG_SYNC signal "query_done" once +# the below SELECT SLEEP(5) has gone from "Query" to "Sleep" command +# state. (We cannot just set the DEBUG_SYNC directly here, because +# then it can trigger at the end of the SET DEBUG_SYNC statement (or +# at the end of the Prepare step of the SELECT, if --ps-protocol), +# thus occuring too early). +SET debug_dbug="+d,sleep_inject_query_done_debug_sync"; select sleep(5); #run a query that will take some time connection default; diff --git a/sql/item_func.cc b/sql/item_func.cc index 93eafdfa938..90257406e1e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4482,6 +4482,11 @@ longlong Item_func_sleep::val_int() mysql_cond_destroy(&cond); + DBUG_EXECUTE_IF("sleep_inject_query_done_debug_sync", { + debug_sync_set_action + (thd, STRING_WITH_LEN("dispatch_command_end SIGNAL query_done")); + };); + return test(!error); // Return 1 killed } From f27817c1d0e6d81392470e9086624e88ae08b11f Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Wed, 7 Jan 2015 14:45:39 +0100 Subject: [PATCH 146/201] MDEV-7326: Server deadlock in connection with parallel replication The bug occurs when a transaction does a retry after all transactions have done mark_start_commit() in a batch of group commit from the master. In this case, the retrying transaction can unmark_start_commit() after the following batch has already started running and de-allocated the GCO. Then after retry, the transaction will re-do mark_start_commit() on a de-allocated GCO, and also wakeup of later GCOs can be lost. This was seen "in the wild" by a user, even though it is not known exactly what circumstances can lead to retry of one transaction after all transactions in a group have reached the commit phase. The lifetime around GCO was somewhat clunky anyway. With this patch, a GCO lives until rpl_parallel_entry::last_committed_sub_id has reached the last transaction in the GCO. This guarantees that the GCO will still be alive when a transaction does mark_start_commit(). Also, we now loop over the list of active GCOs for wakeup, to ensure we do not lose a wakeup even in the problematic case. --- mysql-test/suite/rpl/r/rpl_parallel.result | 113 +++++++++++ mysql-test/suite/rpl/t/rpl_parallel.test | 207 +++++++++++++++++++++ sql/rpl_parallel.cc | 110 ++++++----- sql/rpl_parallel.h | 22 ++- sql/rpl_rli.cc | 19 +- sql/rpl_rli.h | 4 + 6 files changed, 420 insertions(+), 55 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result index a3b423a49c9..7ceb5ee6622 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-test/suite/rpl/r/rpl_parallel.result @@ -1023,6 +1023,119 @@ SET GLOBAL slave_parallel_threads=0; SET GLOBAL slave_parallel_threads=10; CHANGE MASTER TO master_use_gtid=slave_pos; include/start_slave.inc +*** MDEV-7326 Server deadlock in connection with parallel replication *** +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=3; +SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; +include/start_slave.inc +SET @old_format= @@SESSION.binlog_format; +SET binlog_format= STATEMENT; +INSERT INTO t1 VALUES (foo(50, +"rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", +"rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); +SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; +INSERT INTO t2 VALUES (foo(50, +"rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", +"rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); +SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; +INSERT INTO t1 VALUES (foo(51, +"rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", +"rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); +SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; +SET DEBUG_SYNC= "now SIGNAL t1_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; +INSERT INTO t1 VALUES (52); +SET BINLOG_FORMAT= @old_format; +SELECT * FROM t2 WHERE a>=50 ORDER BY a; +a +50 +SELECT * FROM t1 WHERE a>=50 ORDER BY a; +a +50 +51 +52 +SET DEBUG_SYNC= "now SIGNAL prep_cont"; +SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; +SET DEBUG_SYNC= "now SIGNAL t2_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; +SET DEBUG_SYNC= "now SIGNAL t1_cont2"; +SELECT * FROM t2 WHERE a>=50 ORDER BY a; +a +50 +SELECT * FROM t1 WHERE a>=50 ORDER BY a; +a +50 +51 +52 +SET DEBUG_SYNC="reset"; +include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +include/start_slave.inc +*** MDEV-7326 Server deadlock in connection with parallel replication *** +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=3; +SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; +include/start_slave.inc +SET @old_format= @@SESSION.binlog_format; +SET binlog_format= STATEMENT; +INSERT INTO t1 VALUES (foo(60, +"rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", +"rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); +SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; +INSERT INTO t2 VALUES (foo(60, +"rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", +"rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); +SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +INSERT INTO t1 VALUES (foo(61, +"rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", +"rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); +SET debug_sync='now WAIT_FOR master_queued1'; +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +INSERT INTO t6 VALUES (62); +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; +SET debug_sync='RESET'; +SET BINLOG_FORMAT= @old_format; +SELECT * FROM t2 WHERE a>=60 ORDER BY a; +a +60 +SELECT * FROM t1 WHERE a>=60 ORDER BY a; +a +60 +61 +SELECT * FROM t6 WHERE a>=60 ORDER BY a; +a +62 +SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; +SET DEBUG_SYNC= "now SIGNAL t1_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; +SET DEBUG_SYNC= "now SIGNAL prep_cont"; +SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; +SET DEBUG_SYNC= "now SIGNAL t2_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; +SET DEBUG_SYNC= "now SIGNAL t1_cont2"; +SELECT * FROM t2 WHERE a>=60 ORDER BY a; +a +60 +SELECT * FROM t1 WHERE a>=60 ORDER BY a; +a +60 +61 +SELECT * FROM t6 WHERE a>=60 ORDER BY a; +a +62 +SET DEBUG_SYNC="reset"; +include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +include/start_slave.inc include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index a56d45848a5..d4b99d4b0f7 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -1636,6 +1636,213 @@ CHANGE MASTER TO master_use_gtid=slave_pos; --source include/start_slave.inc +--echo *** MDEV-7326 Server deadlock in connection with parallel replication *** +# We use three transactions, each in a separate group commit. +# T1 does mark_start_commit(), then gets a deadlock error. +# T2 wakes up and starts running +# T1 does unmark_start_commit() +# T3 goes to wait for T2 to start its commit +# T2 does mark_start_commit() +# The bug was that at this point, T3 got deadlocked. Because T1 has unmarked(), +# T3 did not yet see the count_committing_event_groups reach its target value +# yet. But when T1 later re-did mark_start_commit(), it failed to send a wakeup +# to T3. + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=3; +SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; +--source include/start_slave.inc + +--connection server_1 +SET @old_format= @@SESSION.binlog_format; +SET binlog_format= STATEMENT; +# This debug_sync will linger on and be used to control T3 later. +INSERT INTO t1 VALUES (foo(50, + "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", + "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); +--save_master_pos +--connection server_2 +# Wait for the debug_sync point for T3 to be set. But let the preparation +# transaction remain hanging, so that T1 and T2 will be scheduled for the +# remaining two worker threads. +SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; + +--connection server_1 +INSERT INTO t2 VALUES (foo(50, + "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", + "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); +--save_master_pos + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; +# T1 has now done mark_start_commit(). It will later do a rollback and retry. + +--connection server_1 +# Use a MyISAM table for T2 and T3, so they do not trigger the +# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event. +INSERT INTO t1 VALUES (foo(51, + "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", + "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; +# T2 has now started running, but has not yet done mark_start_commit() +SET DEBUG_SYNC= "now SIGNAL t1_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; +# T1 has now done unmark_start_commit() in preparation for its retry. + +--connection server_1 +INSERT INTO t1 VALUES (52); +SET BINLOG_FORMAT= @old_format; +SELECT * FROM t2 WHERE a>=50 ORDER BY a; +SELECT * FROM t1 WHERE a>=50 ORDER BY a; + +--connection server_2 +# Let the preparation transaction complete, so that the same worker thread +# can continue with the transaction T3. +SET DEBUG_SYNC= "now SIGNAL prep_cont"; +SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; +# T3 has now gone to wait for T2 to start committing +SET DEBUG_SYNC= "now SIGNAL t2_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; +# T2 has now done mark_start_commit(). +# Let things run, and check that T3 does not get deadlocked. +SET DEBUG_SYNC= "now SIGNAL t1_cont2"; +--sync_with_master + +--connection server_1 +--save_master_pos +--connection server_2 +--sync_with_master +SELECT * FROM t2 WHERE a>=50 ORDER BY a; +SELECT * FROM t1 WHERE a>=50 ORDER BY a; +SET DEBUG_SYNC="reset"; + +# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** MDEV-7326 Server deadlock in connection with parallel replication *** +# Similar to the previous test, but with T2 and T3 in the same GCO. +# We use three transactions, T1 in one group commit and T2/T3 in another. +# T1 does mark_start_commit(), then gets a deadlock error. +# T2 wakes up and starts running +# T1 does unmark_start_commit() +# T3 goes to wait for T1 to start its commit +# T2 does mark_start_commit() +# The bug was that at this point, T3 got deadlocked. T2 increments the +# count_committing_event_groups but does not signal T3, as they are in +# the same GCO. Then later when T1 increments, it would also not signal +# T3, because now the count_committing_event_groups is not equal to the +# wait_count of T3 (it is one larger). + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=3; +SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; +--source include/start_slave.inc + +--connection server_1 +SET @old_format= @@SESSION.binlog_format; +SET binlog_format= STATEMENT; +# This debug_sync will linger on and be used to control T3 later. +INSERT INTO t1 VALUES (foo(60, + "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", + "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); +--save_master_pos +--connection server_2 +# Wait for the debug_sync point for T3 to be set. But let the preparation +# transaction remain hanging, so that T1 and T2 will be scheduled for the +# remaining two worker threads. +SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; + +--connection server_1 +INSERT INTO t2 VALUES (foo(60, + "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", + "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); +--save_master_pos + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; +# T1 has now done mark_start_commit(). It will later do a rollback and retry. + +# Do T2 and T3 in a single group commit. +# Use a MyISAM table for T2 and T3, so they do not trigger the +# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event. +--connection con_temp3 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +send INSERT INTO t1 VALUES (foo(61, + "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", + "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con_temp4 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send INSERT INTO t6 VALUES (62); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; + +--connection server_1 +SET debug_sync='RESET'; +SET BINLOG_FORMAT= @old_format; +SELECT * FROM t2 WHERE a>=60 ORDER BY a; +SELECT * FROM t1 WHERE a>=60 ORDER BY a; +SELECT * FROM t6 WHERE a>=60 ORDER BY a; + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; +# T2 has now started running, but has not yet done mark_start_commit() +SET DEBUG_SYNC= "now SIGNAL t1_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; +# T1 has now done unmark_start_commit() in preparation for its retry. + +--connection server_2 +# Let the preparation transaction complete, so that the same worker thread +# can continue with the transaction T3. +SET DEBUG_SYNC= "now SIGNAL prep_cont"; +SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; +# T3 has now gone to wait for T2 to start committing +SET DEBUG_SYNC= "now SIGNAL t2_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; +# T2 has now done mark_start_commit(). +# Let things run, and check that T3 does not get deadlocked. +SET DEBUG_SYNC= "now SIGNAL t1_cont2"; +--sync_with_master + +--connection server_1 +--save_master_pos +--connection server_2 +--sync_with_master +SELECT * FROM t2 WHERE a>=60 ORDER BY a; +SELECT * FROM t1 WHERE a>=60 ORDER BY a; +SELECT * FROM t6 WHERE a>=60 ORDER BY a; +SET DEBUG_SYNC="reset"; + +# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + # Clean up. --connection server_2 --source include/stop_slave.inc diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 1a9e269022a..46c3e4aaaf4 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -106,9 +106,10 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev) static void -finish_event_group(THD *thd, uint64 sub_id, rpl_parallel_entry *entry, - rpl_group_info *rgi) +finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id, + rpl_parallel_entry *entry, rpl_group_info *rgi) { + THD *thd= rpt->thd; wait_for_commit *wfc= &rgi->commit_orderer; int err; @@ -139,25 +140,47 @@ finish_event_group(THD *thd, uint64 sub_id, rpl_parallel_entry *entry, signal_error_to_sql_driver_thread(thd, rgi, err); thd->wait_for_commit_ptr= NULL; - /* - Record that this event group has finished (eg. transaction is - committed, if transactional), so other event groups will no longer - attempt to wait for us to commit. Once we have increased - entry->last_committed_sub_id, no other threads will execute - register_wait_for_prior_commit() against us. Thus, by doing one - extra (usually redundant) wakeup_subsequent_commits() we can ensure - that no register_wait_for_prior_commit() can ever happen without a - subsequent wakeup_subsequent_commits() to wake it up. - - We can race here with the next transactions, but that is fine, as - long as we check that we do not decrease last_committed_sub_id. If - this commit is done, then any prior commits will also have been - done and also no longer need waiting for. - */ mysql_mutex_lock(&entry->LOCK_parallel_entry); + /* + We need to mark that this event group started its commit phase, in case we + missed it before (otherwise we would deadlock the next event group that is + waiting for this). In most cases (normal DML), it will be a no-op. + */ + rgi->mark_start_commit_no_lock(); + if (entry->last_committed_sub_id < sub_id) + { + /* + Record that this event group has finished (eg. transaction is + committed, if transactional), so other event groups will no longer + attempt to wait for us to commit. Once we have increased + entry->last_committed_sub_id, no other threads will execute + register_wait_for_prior_commit() against us. Thus, by doing one + extra (usually redundant) wakeup_subsequent_commits() we can ensure + that no register_wait_for_prior_commit() can ever happen without a + subsequent wakeup_subsequent_commits() to wake it up. + + We can race here with the next transactions, but that is fine, as + long as we check that we do not decrease last_committed_sub_id. If + this commit is done, then any prior commits will also have been + done and also no longer need waiting for. + */ entry->last_committed_sub_id= sub_id; + /* Now free any GCOs in which all transactions have committed. */ + group_commit_orderer *tmp_gco= rgi->gco; + while (tmp_gco && + (!tmp_gco->next_gco || tmp_gco->last_sub_id > sub_id)) + tmp_gco= tmp_gco->prev_gco; + while (tmp_gco) + { + group_commit_orderer *prev_gco= tmp_gco->prev_gco; + tmp_gco->next_gco->prev_gco= NULL; + rpt->loc_free_gco(tmp_gco); + tmp_gco= prev_gco; + } + } + /* If this event group got error, then any following event groups that have not yet started should just skip their group, preparing for stop of the @@ -166,12 +189,6 @@ finish_event_group(THD *thd, uint64 sub_id, rpl_parallel_entry *entry, if (unlikely(rgi->worker_error) && entry->stop_on_error_sub_id == (uint64)ULONGLONG_MAX) entry->stop_on_error_sub_id= sub_id; - /* - We need to mark that this event group started its commit phase, in case we - missed it before (otherwise we would deadlock the next event group that is - waiting for this). In most cases (normal DML), it will be a no-op. - */ - rgi->mark_start_commit_no_lock(); mysql_mutex_unlock(&entry->LOCK_parallel_entry); thd->clear_error(); @@ -329,6 +346,7 @@ do_retry: until after the unmark. */ rgi->unmark_start_commit(); + DEBUG_SYNC(thd, "rpl_parallel_retry_after_unmark"); /* We might get the deadlock error that causes the retry during commit, while @@ -517,7 +535,7 @@ handle_rpl_parallel_thread(void *arg) bool in_event_group= false; bool skip_event_group= false; rpl_group_info *group_rgi= NULL; - group_commit_orderer *gco, *tmp_gco; + group_commit_orderer *gco; uint64 event_gtid_sub_id= 0; rpl_sql_thread_info sql_info(NULL); int err; @@ -610,7 +628,7 @@ handle_rpl_parallel_thread(void *arg) */ group_rgi->cleanup_context(thd, 1); in_event_group= false; - finish_event_group(thd, group_rgi->gtid_sub_id, + finish_event_group(rpt, group_rgi->gtid_sub_id, qev->entry_for_queued, group_rgi); rpt->loc_free_rgi(group_rgi); @@ -664,8 +682,12 @@ handle_rpl_parallel_thread(void *arg) mysql_mutex_lock(&entry->LOCK_parallel_entry); if (!gco->installed) { - if (gco->prev_gco) - gco->prev_gco->next_gco= gco; + group_commit_orderer *prev_gco= gco->prev_gco; + if (prev_gco) + { + prev_gco->last_sub_id= gco->prior_sub_id; + prev_gco->next_gco= gco; + } gco->installed= true; } wait_count= gco->wait_count; @@ -682,6 +704,8 @@ handle_rpl_parallel_thread(void *arg) if (thd->check_killed() && !rgi->worker_error) { DEBUG_SYNC(thd, "rpl_parallel_start_waiting_for_prior_killed"); + thd->clear_error(); + thd->get_stmt_da()->reset_diagnostics_area(); thd->send_kill_message(); slave_output_error_info(rgi, thd); signal_error_to_sql_driver_thread(thd, rgi, 1); @@ -698,18 +722,6 @@ handle_rpl_parallel_thread(void *arg) } while (wait_count > entry->count_committing_event_groups); } - if ((tmp_gco= gco->prev_gco)) - { - /* - Now all the event groups in the previous batch have entered their - commit phase, and will no longer access their gco. So we can free - it here. - */ - DBUG_ASSERT(!tmp_gco->prev_gco); - gco->prev_gco= NULL; - rpt->loc_free_gco(tmp_gco); - } - if (entry->force_abort && wait_count > entry->stop_count) { /* @@ -773,6 +785,7 @@ handle_rpl_parallel_thread(void *arg) { DEBUG_SYNC(thd, "rpl_parallel_before_mark_start_commit"); rgi->mark_start_commit(); + DEBUG_SYNC(thd, "rpl_parallel_after_mark_start_commit"); } /* @@ -793,6 +806,7 @@ handle_rpl_parallel_thread(void *arg) thd->get_stmt_da()->reset_diagnostics_area(); my_error(ER_LOCK_DEADLOCK, MYF(0)); err= 1; + DEBUG_SYNC(thd, "rpl_parallel_simulate_temp_err_xid"); }); if (!err) #endif @@ -832,7 +846,7 @@ handle_rpl_parallel_thread(void *arg) if (end_of_group) { in_event_group= false; - finish_event_group(thd, event_gtid_sub_id, entry, rgi); + finish_event_group(rpt, event_gtid_sub_id, entry, rgi); rpt->loc_free_rgi(rgi); thd->rgi_slave= group_rgi= rgi= NULL; skip_event_group= false; @@ -873,7 +887,7 @@ handle_rpl_parallel_thread(void *arg) */ mysql_mutex_unlock(&rpt->LOCK_rpl_thread); signal_error_to_sql_driver_thread(thd, group_rgi, 1); - finish_event_group(thd, group_rgi->gtid_sub_id, + finish_event_group(rpt, group_rgi->gtid_sub_id, group_rgi->parallel_entry, group_rgi); in_event_group= false; mysql_mutex_lock(&rpt->LOCK_rpl_thread); @@ -922,7 +936,6 @@ handle_rpl_parallel_thread(void *arg) static void dealloc_gco(group_commit_orderer *gco) { - DBUG_ASSERT(!gco->prev_gco /* Must only free after dealloc previous */); mysql_cond_destroy(&gco->COND_group_commit_orderer); my_free(gco); } @@ -1303,7 +1316,8 @@ rpl_parallel_thread::free_rgi(rpl_group_info *rgi) group_commit_orderer * -rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev) +rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev, + uint64 prior_sub_id) { group_commit_orderer *gco; mysql_mutex_assert_owner(&LOCK_rpl_thread); @@ -1319,6 +1333,7 @@ rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev) gco->wait_count= wait_count; gco->prev_gco= prev; gco->next_gco= NULL; + gco->prior_sub_id= prior_sub_id; gco->installed= false; return gco; } @@ -1327,7 +1342,6 @@ rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev) void rpl_parallel_thread::loc_free_gco(group_commit_orderer *gco) { - DBUG_ASSERT(!gco->prev_gco /* Must not free until wait has completed. */); if (!loc_gco_list) loc_gco_last_ptr_ptr= &gco->next_gco; else @@ -1534,8 +1548,12 @@ static void free_rpl_parallel_entry(void *element) { rpl_parallel_entry *e= (rpl_parallel_entry *)element; - if (e->current_gco) + while (e->current_gco) + { + group_commit_orderer *prev_gco= e->current_gco->prev_gco; dealloc_gco(e->current_gco); + e->current_gco= prev_gco; + } mysql_cond_destroy(&e->COND_parallel_entry); mysql_mutex_destroy(&e->LOCK_parallel_entry); my_free(e); @@ -2007,7 +2025,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, uint64 count= e->count_queued_event_groups; group_commit_orderer *gco; - if (!(gco= cur_thread->get_gco(count, e->current_gco))) + if (!(gco= cur_thread->get_gco(count, e->current_gco, e->current_sub_id))) { cur_thread->free_rgi(rgi); cur_thread->free_qev(qev); diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 239818855b8..2604cd98527 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -39,9 +39,12 @@ struct inuse_relaylog; rpl_parallel_entry::count_committing_event_groups has reached gco->next_gco->wait_count. - - When gco->wait_count is reached for a worker and the wait completes, - the worker frees gco->prev_gco; at this point it is guaranteed not to - be needed any longer. + - The gco lives until all its event groups have completed their commit. + This is detected by rpl_parallel_entry::last_committed_sub_id being + greater than or equal gco->last_sub_id. Once this happens, the gco is + freed. Note that since update of last_committed_sub_id can happen + out-of-order, the thread that frees a given gco can be for any later + event group, not necessarily an event group from the gco being freed. */ struct group_commit_orderer { /* Wakeup condition, used with rpl_parallel_entry::LOCK_parallel_entry. */ @@ -49,6 +52,16 @@ struct group_commit_orderer { uint64 wait_count; group_commit_orderer *prev_gco; group_commit_orderer *next_gco; + /* + The sub_id of last event group in this the previous GCO. + Only valid if prev_gco != NULL. + */ + uint64 prior_sub_id; + /* + The sub_id of the last event group in this GCO. Only valid when next_gco + is non-NULL. + */ + uint64 last_sub_id; bool installed; }; @@ -168,7 +181,8 @@ struct rpl_parallel_thread { LOCK_rpl_thread mutex. */ void free_rgi(rpl_group_info *rgi); - group_commit_orderer *get_gco(uint64 wait_count, group_commit_orderer *prev); + group_commit_orderer *get_gco(uint64 wait_count, group_commit_orderer *prev, + uint64 first_sub_id); /* Put a gco on the local free list, to be later released to the global free list by batch_free(). diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 629e046ed0a..a751dd16650 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1849,11 +1849,20 @@ void rpl_group_info::slave_close_thread_tables(THD *thd) static void -mark_start_commit_inner(rpl_parallel_entry *e, group_commit_orderer *gco) +mark_start_commit_inner(rpl_parallel_entry *e, group_commit_orderer *gco, + rpl_group_info *rgi) { + group_commit_orderer *tmp; uint64 count= ++e->count_committing_event_groups; - if (gco->next_gco && gco->next_gco->wait_count == count) - mysql_cond_broadcast(&gco->next_gco->COND_group_commit_orderer); + /* Signal any following GCO whose wait_count has been reached now. */ + tmp= gco; + while ((tmp= tmp->next_gco)) + { + uint64 wait_count= tmp->wait_count; + if (wait_count > count) + break; + mysql_cond_broadcast(&tmp->COND_group_commit_orderer); + } } @@ -1862,7 +1871,7 @@ rpl_group_info::mark_start_commit_no_lock() { if (did_mark_start_commit) return; - mark_start_commit_inner(parallel_entry, gco); + mark_start_commit_inner(parallel_entry, gco, this); did_mark_start_commit= true; } @@ -1877,7 +1886,7 @@ rpl_group_info::mark_start_commit() e= this->parallel_entry; mysql_mutex_lock(&e->LOCK_parallel_entry); - mark_start_commit_inner(e, gco); + mark_start_commit_inner(e, gco, this); mysql_mutex_unlock(&e->LOCK_parallel_entry); did_mark_start_commit= true; } diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 9885417aa3f..fb4e3261468 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -563,6 +563,10 @@ struct rpl_group_info (When we execute in parallel the transactions that group committed together on the master, we still need to wait for any prior transactions to have reached the commit stage). + + The pointed-to gco is only valid for as long as + gtid_sub_id < parallel_entry->last_committed_sub_id. After that, it can + be freed by another thread. */ group_commit_orderer *gco; From 85c65f4e1caa0dd28bc279ee1e83712f57ba3747 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Fri, 9 Jan 2015 23:36:50 +0100 Subject: [PATCH 147/201] - Fix MDEV-7427 by not reallocating the date format in ScanRecord on each inserted row. modified: storage/connect/ha_connect.cc storage/connect/ha_connect.h --- storage/connect/ha_connect.cc | 42 ++++++++++++++++++++++++++--------- storage/connect/ha_connect.h | 5 ++++- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 9c847b1d250..d6738a0eb8b 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -714,7 +714,7 @@ ha_connect::ha_connect(handlerton *hton, TABLE_SHARE *table_arg) datapath= "./"; #endif // !WIN32 tdbp= NULL; - sdvalin= NULL; + sdvalin1= sdvalin2= sdvalin3= sdvalin4= NULL; sdvalout= NULL; xmod= MODE_ANY; istable= false; @@ -1815,7 +1815,7 @@ int ha_connect::CloseTable(PGLOBAL g) { int rc= CntCloseTable(g, tdbp, nox, abort); tdbp= NULL; - sdvalin=NULL; + sdvalin1= sdvalin2= sdvalin3= sdvalin4= NULL; sdvalout=NULL; valid_info= false; indexing= -1; @@ -1969,7 +1969,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) char *fmt; int rc= 0; PCOL colp; - PVAL value; + PVAL value, sdvalin; Field *fp; PTDBASE tp= (PTDBASE)tdbp; String attribute(attr_buffer, sizeof(attr_buffer), @@ -2012,25 +2012,45 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) value->SetValue(fp->val_real()); break; case TYPE_DATE: - if (!sdvalin) - sdvalin= (DTVAL*)AllocateValue(xp->g, TYPE_DATE, 19); - // Get date in the format produced by MySQL fields switch (fp->type()) { case MYSQL_TYPE_DATE: - fmt= "YYYY-MM-DD"; + if (!sdvalin2) { + sdvalin2= (DTVAL*)AllocateValue(xp->g, TYPE_DATE, 19); + fmt= "YYYY-MM-DD"; + ((DTVAL*)sdvalin2)->SetFormat(g, fmt, strlen(fmt)); + } // endif sdvalin1 + + sdvalin= sdvalin2; break; case MYSQL_TYPE_TIME: - fmt= "hh:mm:ss"; + if (!sdvalin3) { + sdvalin3= (DTVAL*)AllocateValue(xp->g, TYPE_DATE, 19); + fmt= "hh:mm:ss"; + ((DTVAL*)sdvalin3)->SetFormat(g, fmt, strlen(fmt)); + } // endif sdvalin1 + + sdvalin= sdvalin3; break; case MYSQL_TYPE_YEAR: - fmt= "YYYY"; + if (!sdvalin4) { + sdvalin4= (DTVAL*)AllocateValue(xp->g, TYPE_DATE, 19); + fmt= "YYYY"; + ((DTVAL*)sdvalin4)->SetFormat(g, fmt, strlen(fmt)); + } // endif sdvalin1 + + sdvalin= sdvalin4; break; default: - fmt= "YYYY-MM-DD hh:mm:ss"; + if (!sdvalin1) { + sdvalin1= (DTVAL*)AllocateValue(xp->g, TYPE_DATE, 19); + fmt= "YYYY-MM-DD hh:mm:ss"; + ((DTVAL*)sdvalin1)->SetFormat(g, fmt, strlen(fmt)); + } // endif sdvalin1 + + sdvalin= sdvalin1; } // endswitch type - ((DTVAL*)sdvalin)->SetFormat(g, fmt, strlen(fmt)); sdvalin->SetNullable(colp->IsNullable()); fp->val_str(&attribute); sdvalin->SetValue_psz(attribute.c_ptr_safe()); diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 6c3ed87d5f6..922a69a3991 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -543,7 +543,10 @@ protected: query_id_t creat_query_id; // The one when handler was allocated char *datapath; // Is the Path of DB data directory PTDB tdbp; // To table class object - PVAL sdvalin; // Used to convert date values + PVAL sdvalin1; // Used to convert date values + PVAL sdvalin2; // Used to convert date values + PVAL sdvalin3; // Used to convert date values + PVAL sdvalin4; // Used to convert date values PVAL sdvalout; // Used to convert date values bool istable; // True for table handler char partname[64]; // The partition name From 2ab49689c689b1c1daeb080ea568c268c5256952 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 10 Jan 2015 14:07:46 +0100 Subject: [PATCH 148/201] MDEV-7410 Temporary table name conflict between sessions workaround for missing SP auto-reparse. allow the user to disable stored_program_cache_size, if he wants --- .../r/stored_program_cache_basic.result | 6 +-- .../r/stored_program_cache_func.result | 52 +++++++++++++++++++ .../sys_vars/t/stored_program_cache_func.test | 43 +++++++++++++++ sql/sys_vars.cc | 2 +- 4 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/stored_program_cache_func.result create mode 100644 mysql-test/suite/sys_vars/t/stored_program_cache_func.test diff --git a/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result b/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result index f1638520f72..7f882255567 100644 --- a/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result +++ b/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result @@ -23,7 +23,7 @@ Warnings: Warning 1292 Truncated incorrect stored_program_cache value: '-1' SELECT @@global.stored_program_cache; @@global.stored_program_cache -256 +0 SET @@global.stored_program_cache =100000000000; Warnings: Warning 1292 Truncated incorrect stored_program_cache value: '100000000000' @@ -31,11 +31,9 @@ SELECT @@global.stored_program_cache; @@global.stored_program_cache 524288 SET @@global.stored_program_cache = 0; -Warnings: -Warning 1292 Truncated incorrect stored_program_cache value: '0' SELECT @@global.stored_program_cache; @@global.stored_program_cache -256 +0 SET @@global.stored_program_cache = 10000.01; ERROR 42000: Incorrect argument type to variable 'stored_program_cache' SET @@global.stored_program_cache = ON; diff --git a/mysql-test/suite/sys_vars/r/stored_program_cache_func.result b/mysql-test/suite/sys_vars/r/stored_program_cache_func.result new file mode 100644 index 00000000000..11151847d6b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/stored_program_cache_func.result @@ -0,0 +1,52 @@ +create procedure p1() select 1; +flush status; +show status like 'handler_read_key'; +Variable_name Value +Handler_read_key 0 +call p1; +1 +1 +show status like 'handler_read_key'; +Variable_name Value +Handler_read_key 1 +call p1; +1 +1 +show status like 'handler_read_key'; +Variable_name Value +Handler_read_key 1 +set global stored_program_cache=0; +call p1; +1 +1 +show status like 'handler_read_key'; +Variable_name Value +Handler_read_key 2 +call p1; +1 +1 +show status like 'handler_read_key'; +Variable_name Value +Handler_read_key 3 +drop procedure p1; +set global stored_program_cache=default; +create procedure pr(i int) begin +create table t1 (a int, b int); +if (i = 1) then alter table t1 drop a; +else alter table t1 drop b; +end if; +select * from t1; +drop table t1; +end | +call pr(1); +b +call pr(2); +ERROR 42S22: Unknown column 'test.t1.b' in 'field list' +drop table t1; +set global stored_program_cache=0; +call pr(1); +b +call pr(2); +a +drop procedure pr; +set global stored_program_cache=default; diff --git a/mysql-test/suite/sys_vars/t/stored_program_cache_func.test b/mysql-test/suite/sys_vars/t/stored_program_cache_func.test new file mode 100644 index 00000000000..f85fc8eb1bf --- /dev/null +++ b/mysql-test/suite/sys_vars/t/stored_program_cache_func.test @@ -0,0 +1,43 @@ +create procedure p1() select 1; + +flush status; +show status like 'handler_read_key'; +call p1; +show status like 'handler_read_key'; +call p1; +show status like 'handler_read_key'; + +set global stored_program_cache=0; + +call p1; +show status like 'handler_read_key'; +call p1; +show status like 'handler_read_key'; + +drop procedure p1; +set global stored_program_cache=default; + +# Test for missing SP automatic reparsing. +# when MDEV-5816 is implemented, it should be removed. + +--delimiter | +create procedure pr(i int) begin + create table t1 (a int, b int); + if (i = 1) then alter table t1 drop a; + else alter table t1 drop b; + end if; + select * from t1; + drop table t1; +end | +--delimiter ; +call pr(1); +--error ER_BAD_FIELD_ERROR +call pr(2); +drop table t1; + +set global stored_program_cache=0; +call pr(1); +call pr(2); +drop procedure pr; +set global stored_program_cache=default; + diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 7cad362f6f2..47bf6baa46b 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3679,7 +3679,7 @@ static Sys_var_ulong Sys_sp_cache_size( "The soft upper limit for number of cached stored routines for " "one connection.", GLOBAL_VAR(stored_program_cache_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(256, 512 * 1024), DEFAULT(256), BLOCK_SIZE(1)); + VALID_RANGE(0, 512 * 1024), DEFAULT(256), BLOCK_SIZE(1)); export const char *plugin_maturity_names[]= { "unknown", "experimental", "alpha", "beta", "gamma", "stable", 0 }; From 39556a7814556a9a1796f5dfc0740c63b17fcca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 13 Jan 2015 16:48:11 +0200 Subject: [PATCH 149/201] MDEV-7262: innodb.innodb-mdev7046 fail on BuildBot Test causes OS error printout and we need to supress this error message on tests. Additionally, test could cause different error codes on different OSs. --- mysql-test/suite/innodb/t/innodb-mdev7046.test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index 3c74ff64275..24f1d3ab321 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -5,6 +5,7 @@ --disable_result_log --disable_warnings + # Ignore OS errors call mtr.add_suppression("InnoDB: File ./test/t1*"); call mtr.add_suppression("InnoDB: Error number*"); @@ -27,7 +28,7 @@ drop table t1; DROP DATABASE test;CREATE DATABASE test;USE test; SET @@session.storage_engine=MYISAM; ---error 0,1 +--error 0,1,1103 CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); drop table if exists t1; CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); @@ -42,5 +43,5 @@ let $datadir=`select @@datadir`; --enable_result_log --enable_warnings +# make sure that we have at least some ouput to avoid mtr warning --echo 1 - From 70b4e6d368671773cb75830b672c871b2c47b887 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 13 Jan 2015 17:24:31 +0100 Subject: [PATCH 150/201] - Add ConnectTimout and QueryTimout options for ODBC tables. Should fix MDEV-7415. (To be specified in option_list) modified: storage/connect/ha_connect.cc storage/connect/odbccat.h storage/connect/odbconn.cpp storage/connect/odbconn.h storage/connect/tabodbc.cpp storage/connect/tabodbc.h --- storage/connect/ha_connect.cc | 16 +++++++++++----- storage/connect/odbccat.h | 10 +++++++--- storage/connect/odbconn.cpp | 25 +++++++++++++++++-------- storage/connect/odbconn.h | 4 ---- storage/connect/tabodbc.cpp | 35 ++++++++++++++++++++++++++--------- storage/connect/tabodbc.h | 11 +++++++++-- 6 files changed, 70 insertions(+), 31 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index d6738a0eb8b..1eab61f9115 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1,4 +1,4 @@ -/* Copyright (C) Olivier Bertrand 2004 - 2014 +/* Copyright (C) Olivier Bertrand 2004 - 2015 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 @@ -170,7 +170,7 @@ #define SZWMIN 4194304 // Minimum work area size 4M extern "C" { - char version[]= "Version 1.03.0005 November 08, 2014"; + char version[]= "Version 1.03.0005 January 13, 2015"; char compver[]= "Version 1.03.0005 " __DATE__ " " __TIME__; #if defined(WIN32) @@ -4830,6 +4830,9 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, #endif // WIN32 int port= 0, hdr= 0, mxr __attribute__((unused))= 0, mxe= 0, rc= 0; int cop __attribute__((unused)) = 0; +#if defined(ODBC_SUPPORT) + int cto= -1, qto= -1; +#endif // ODBC_SUPPORT uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL); bool bif, ok= false, dbf= false; TABTYPE ttp= TAB_UNDEF; @@ -4889,6 +4892,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, port= atoi(GetListOption(g, "port", topt->oplist, "0")); #if defined(ODBC_SUPPORT) mxr= atoi(GetListOption(g,"maxres", topt->oplist, "0")); + cto= atoi(GetListOption(g,"ConnectTimeout", topt->oplist, "-1")); + qto= atoi(GetListOption(g,"QueryTimeout", topt->oplist, "-1")); #endif mxe= atoi(GetListOption(g,"maxerr", topt->oplist, "0")); #if defined(PROMPT_OK) @@ -5107,14 +5112,15 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, case FNC_NO: case FNC_COL: if (src) { - qrp= ODBCSrcCols(g, dsn, (char*)src); + qrp= ODBCSrcCols(g, dsn, (char*)src, cto, qto); src= NULL; // for next tests } else - qrp= ODBCColumns(g, dsn, shm, tab, NULL, mxr, fnc == FNC_COL); + qrp= ODBCColumns(g, dsn, shm, tab, NULL, + mxr, cto, qto, fnc == FNC_COL); break; case FNC_TABLE: - qrp= ODBCTables(g, dsn, shm, tab, mxr, true); + qrp= ODBCTables(g, dsn, shm, tab, mxr, cto, qto, true); break; case FNC_DSN: qrp= ODBCDataSources(g, mxr, true); diff --git a/storage/connect/odbccat.h b/storage/connect/odbccat.h index 9cc14695977..8642d915211 100644 --- a/storage/connect/odbccat.h +++ b/storage/connect/odbccat.h @@ -1,3 +1,7 @@ +// Timeout and net wait defaults +#define DEFAULT_LOGIN_TIMEOUT -1 // means do not set +#define DEFAULT_QUERY_TIMEOUT -1 // means do not set + /***********************************************************************/ /* ODBC catalog function prototypes. */ /***********************************************************************/ @@ -6,8 +10,8 @@ char *ODBCCheckConnection(PGLOBAL g, char *dsn, int cop); #endif // PROMPT_OK PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info); PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, - char *colpat, int maxres, bool info); -PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src); + char *colpat, int maxres, int cto, int qto, bool info); +PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, int cto, int qto); PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, - int maxres, bool info); + int maxres, int cto, int qto, bool info); PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info); diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index ec8be43b059..3e616ec8f04 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -1,7 +1,7 @@ /************ Odbconn C++ Functions Source Code File (.CPP) ************/ -/* Name: ODBCONN.CPP Version 2.0 */ +/* Name: ODBCONN.CPP Version 2.1 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2015 */ /* */ /* This file contains the ODBC connection classes functions. */ /***********************************************************************/ @@ -291,7 +291,7 @@ static void ResetNullValues(CATPARM *cap) /* of an ODBC table that will be retrieved by GetData commands. */ /***********************************************************************/ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, - char *colpat, int maxres, bool info) + char *colpat, int maxres, int cto, int qto, bool info) { int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT, TYPE_INT, @@ -310,6 +310,8 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, /************************************************************************/ if (!info) { ocp = new(g) ODBConn(g, NULL); + ocp->SetLoginTimeout((DWORD)cto); + ocp->SetQueryTimeout((DWORD)qto); if (ocp->Open(dsn, 10) < 1) // openReadOnly + noODBCdialog return NULL; @@ -386,10 +388,12 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table, /* ODBCSrcCols: constructs the result blocks containing the */ /* description of all the columns of a Srcdef option. */ /**************************************************************************/ -PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src) +PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, int cto, int qto) { ODBConn *ocp = new(g) ODBConn(g, NULL); + ocp->SetLoginTimeout((DWORD)cto); + ocp->SetQueryTimeout((DWORD)qto); return ocp->GetMetaData(g, dsn, src); } // end of ODBCSrcCols @@ -570,7 +574,7 @@ PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info) /* an ODBC database that will be retrieved by GetData commands. */ /**************************************************************************/ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, - int maxres, bool info) + int maxres, int cto, int qto, bool info) { int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_STRING}; @@ -590,6 +594,8 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat, /* Open the connection with the ODBC data source. */ /**********************************************************************/ ocp = new(g) ODBConn(g, NULL); + ocp->SetLoginTimeout((DWORD)cto); + ocp->SetQueryTimeout((DWORD)qto); if (ocp->Open(dsn, 2) < 1) // 2 is openReadOnly return NULL; @@ -1134,10 +1140,13 @@ void ODBConn::AllocConnect(DWORD Options) } // endif #endif // _DEBUG - rc = SQLSetConnectOption(m_hdbc, SQL_LOGIN_TIMEOUT, m_LoginTimeout); + if ((signed)m_LoginTimeout >= 0) { + rc = SQLSetConnectOption(m_hdbc, SQL_LOGIN_TIMEOUT, m_LoginTimeout); - if (trace && rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) - htrc("Warning: Failure setting login timeout\n"); + if (trace && rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) + htrc("Warning: Failure setting login timeout\n"); + + } // endif Timeout if (!m_Updatable) { rc = SQLSetConnectOption(m_hdbc, SQL_ACCESS_MODE, SQL_MODE_READ_ONLY); diff --git a/storage/connect/odbconn.h b/storage/connect/odbconn.h index 021b4fe45fb..dfdb9fe7f56 100644 --- a/storage/connect/odbconn.h +++ b/storage/connect/odbconn.h @@ -33,10 +33,6 @@ typedef unsigned char *PUCHAR; #endif // !WIN32 -// Timeout and net wait defaults -#define DEFAULT_LOGIN_TIMEOUT 15 // seconds to before fail on connect -#define DEFAULT_QUERY_TIMEOUT 15 // seconds to before fail waiting for results - // Field Flags, used to indicate status of fields //efine SQL_FIELD_FLAG_DIRTY 0x1 //efine SQL_FIELD_FLAG_NULL 0x2 diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index ee137187af8..2b771bcbead 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -1,11 +1,11 @@ /************* Tabodbc C++ Program Source Code File (.CPP) *************/ /* PROGRAM NAME: TABODBC */ /* ------------- */ -/* Version 2.8 */ +/* Version 2.9 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2000-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -94,7 +94,7 @@ bool ExactInfo(void); ODBCDEF::ODBCDEF(void) { Connect= Tabname= Tabschema= Tabcat= Srcdef= Qchar= Qrystr= Sep= NULL; - Catver = Options = Quoted = Maxerr = Maxres = 0; + Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = 0; Scrollable = Memory = Xsrc = false; } // end of ODBCDEF constructor @@ -130,6 +130,8 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Quoted = GetIntCatInfo("Quoted", 0); Options = ODBConn::noOdbcDialog; //Options = ODBConn::noOdbcDialog | ODBConn::useCursorLib; + Cto= GetIntCatInfo("ConnectTimeout", DEFAULT_LOGIN_TIMEOUT); + Qto= GetIntCatInfo("QueryTimeout", DEFAULT_QUERY_TIMEOUT); Scrollable = GetBoolCatInfo("Scrollable", false); Memory = GetBoolCatInfo("Memory", false); Pseudo = 2; // FILID is Ok but not ROWID @@ -193,6 +195,8 @@ TDBODBC::TDBODBC(PODEF tdp) : TDBASE(tdp) Qrystr = tdp->Qrystr; Sep = tdp->GetSep(); Options = tdp->Options; + Cto = tdp->Cto; + Qto = tdp->Qto; Quoted = MY_MAX(0, tdp->GetQuoted()); Rows = tdp->GetElemt(); Catver = tdp->Catver; @@ -207,6 +211,8 @@ TDBODBC::TDBODBC(PODEF tdp) : TDBASE(tdp) Qrystr = NULL; Sep = 0; Options = 0; + Cto = DEFAULT_LOGIN_TIMEOUT; + Qto = DEFAULT_QUERY_TIMEOUT; Quoted = 0; Rows = 0; Catver = 0; @@ -248,6 +254,8 @@ TDBODBC::TDBODBC(PTDBODBC tdbp) : TDBASE(tdbp) MulConn = tdbp->MulConn; DBQ = tdbp->DBQ; Options = tdbp->Options; + Cto = tdbp->Cto; + Qto = tdbp->Qto; Quoted = tdbp->Quoted; Rows = tdbp->Rows; Fpos = tdbp->Fpos; @@ -690,6 +698,9 @@ int TDBODBC::Cardinality(PGLOBAL g) char qry[96], tbn[64]; ODBConn *ocp = new(g) ODBConn(g, this); + ocp->SetLoginTimeout((DWORD)Cto); + ocp->SetQueryTimeout((DWORD)Qto); + if (ocp->Open(Connect, Options) < 1) return -1; @@ -791,9 +802,11 @@ bool TDBODBC::OpenDB(PGLOBAL g) /* and if so to allocate just a new result set. But this only for */ /* drivers allowing concurency in getting results ??? */ /*********************************************************************/ - if (!Ocp) + if (!Ocp) { Ocp = new(g) ODBConn(g, this); - else if (Ocp->IsOpen()) + Ocp->SetLoginTimeout((DWORD)Cto); + Ocp->SetQueryTimeout((DWORD)Qto); + } else if (Ocp->IsOpen()) Ocp->Close(); if (Ocp->Open(Connect, Options) < 1) @@ -1400,9 +1413,11 @@ bool TDBXDBC::OpenDB(PGLOBAL g) /* and if so to allocate just a new result set. But this only for */ /* drivers allowing concurency in getting results ??? */ /*********************************************************************/ - if (!Ocp) + if (!Ocp) { Ocp = new(g) ODBConn(g, this); - else if (Ocp->IsOpen()) + Ocp->SetLoginTimeout((DWORD)Cto); + Ocp->SetQueryTimeout((DWORD)Qto); + } else if (Ocp->IsOpen()) Ocp->Close(); if (Ocp->Open(Connect, Options) < 1) @@ -1539,6 +1554,8 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp) Dsn = tdp->GetConnect(); Schema = tdp->GetTabschema(); Tab = tdp->GetTabname(); + Cto = tdp->Cto; + Qto = tdp->Qto; } // end of TDBOTB constructor /***********************************************************************/ @@ -1546,7 +1563,7 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp) /***********************************************************************/ PQRYRES TDBOTB::GetResult(PGLOBAL g) { - return ODBCTables(g, Dsn, Schema, Tab, Maxres, false); + return ODBCTables(g, Dsn, Schema, Tab, Maxres, Cto, Qto, false); } // end of GetResult /* ---------------------------TDBOCL class --------------------------- */ @@ -1556,7 +1573,7 @@ PQRYRES TDBOTB::GetResult(PGLOBAL g) /***********************************************************************/ PQRYRES TDBOCL::GetResult(PGLOBAL g) { - return ODBCColumns(g, Dsn, Schema, Tab, NULL, Maxres, false); + return ODBCColumns(g, Dsn, Schema, Tab, NULL, Maxres, Cto, Qto, false); } // end of GetResult /* ------------------------ End of Tabodbc --------------------------- */ diff --git a/storage/connect/tabodbc.h b/storage/connect/tabodbc.h index 4fa0f2b751c..d8644c8b6de 100644 --- a/storage/connect/tabodbc.h +++ b/storage/connect/tabodbc.h @@ -1,7 +1,7 @@ /*************** Tabodbc H Declares Source Code File (.H) **************/ -/* Name: TABODBC.H Version 1.7 */ +/* Name: TABODBC.H Version 1.8 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2000-2014 */ +/* (C) Copyright to the author Olivier BERTRAND 2000-2015 */ /* */ /* This file contains the TDBODBC classes declares. */ /***********************************************************************/ @@ -24,6 +24,7 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */ friend class TDBODBC; friend class TDBXDBC; friend class TDBDRV; + friend class TDBOTB; public: // Constructor ODBCDEF(void); @@ -56,6 +57,8 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */ PSZ Sep; /* Decimal separator */ int Catver; /* ODBC version for catalog functions */ int Options; /* Open connection options */ + int Cto; /* Open connection timeout */ + int Qto; /* Query (command) timeout */ int Quoted; /* Identifier quoting level */ int Maxerr; /* Maxerr for an Exec table */ int Maxres; /* Maxres for a catalog table */ @@ -135,6 +138,8 @@ class TDBODBC : public TDBASE { char *Qrystr; // The original query char Sep; // The decimal separator int Options; // Connect options + int Cto; // Connect timeout + int Qto; // Query timeout int Quoted; // The identifier quoting level int Fpos; // Position of last read record int AftRows; // The number of affected rows @@ -311,6 +316,8 @@ class TDBOTB : public TDBDRV { char *Dsn; // Points to connection string char *Schema; // Points to schema name or NULL char *Tab; // Points to ODBC table name or pattern + int Cto; // Connect timeout + int Qto; // Query timeout }; // end of class TDBOTB /***********************************************************************/ From 7f9f3139d79d2b5e0a1c1eb47b02a5976d572670 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 13 Jan 2015 19:27:28 +0100 Subject: [PATCH 151/201] MDEV-7333 "'show table status like 'table_name'" on tokudb table lead to MariaDB crash adjust enum values when reading them from frm --- mysql-test/r/frm_bad_row_type-7333.result | 14 ++++++++++++ mysql-test/std_data/bad_row_type.MYD | 0 mysql-test/std_data/bad_row_type.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/bad_row_type.frm | Bin 0 -> 1760 bytes mysql-test/t/frm_bad_row_type-7333.test | 14 ++++++++++++ sql/handler.h | 5 ++++- sql/table.cc | 26 +++++++++++++++++++--- 7 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 mysql-test/r/frm_bad_row_type-7333.result create mode 100644 mysql-test/std_data/bad_row_type.MYD create mode 100644 mysql-test/std_data/bad_row_type.MYI create mode 100644 mysql-test/std_data/bad_row_type.frm create mode 100644 mysql-test/t/frm_bad_row_type-7333.test diff --git a/mysql-test/r/frm_bad_row_type-7333.result b/mysql-test/r/frm_bad_row_type-7333.result new file mode 100644 index 00000000000..198b494d3f8 --- /dev/null +++ b/mysql-test/r/frm_bad_row_type-7333.result @@ -0,0 +1,14 @@ +call mtr.add_suppression("bad_row_type.frm: invalid value 11 for the field row_format"); +select * from bad_row_type; +category_id category_name +show create table bad_row_type; +Table Create Table +bad_row_type CREATE TABLE `bad_row_type` ( + `category_id` int(11) NOT NULL AUTO_INCREMENT, + `category_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`category_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +show table status like 'bad_row_type'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +bad_row_type MyISAM 10 Dynamic 0 0 0 281474976710655 1024 0 1 x x NULL utf8_general_ci NULL +drop table bad_row_type; diff --git a/mysql-test/std_data/bad_row_type.MYD b/mysql-test/std_data/bad_row_type.MYD new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/std_data/bad_row_type.MYI b/mysql-test/std_data/bad_row_type.MYI new file mode 100644 index 0000000000000000000000000000000000000000..731a83ed078a355a792863b72bae6f36b06c841b GIT binary patch literal 1024 zcmezOkDZZ$kujQK149bK5e7yEAW{U9K=2<-Vj=!R0Yr)giwayq4tJ4dVCKMRm|RE$ z`)Mc}>=GnCObId#aV-O}?qCKgWM%~#zzjqjKw1RCW?*DvV+4i;1IQ!+WD7uSpo}0; loC^e5?7^}QU@M`vgYMP|Co_@PLhh;U^;tGXo4TDKc;}FtCESiVWNk(VvVA4C~t%83bU87zBQ5 zN2F9Y3qIM&{zP6lcYjQSEO&B#Zb4CMadBpT9(O}Yes*a}QhZfTW)etK6VO0LpebBH zHVe>NAg_Umfk7I``5zGE>FXF2`5&Zi6b!=<7>(Is7^$OPA~6Km7normalized_path.str, value, name); + return 0; +} + + /* Read data from a binary .frm file from MySQL 3.23 - 5.0 into TABLE_SHARE */ @@ -983,9 +1000,12 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (!head[32]) // New frm file in 3.23 { share->avg_row_length= uint4korr(head+34); - share->transactional= (ha_choice) (head[39] & 3); - share->page_checksum= (ha_choice) ((head[39] >> 2) & 3); - share->row_type= (row_type) head[40]; + share->transactional= (ha_choice) + enum_value_with_check(thd, share, "transactional", (head[39] & 3), HA_CHOICE_MAX); + share->page_checksum= (ha_choice) + enum_value_with_check(thd, share, "page_checksum", (head[39] >> 2) & 3, HA_CHOICE_MAX); + share->row_type= (row_type) + enum_value_with_check(thd, share, "row_format", head[40], ROW_TYPE_MAX); share->table_charset= get_charset((((uint) head[41]) << 8) + (uint) head[38],MYF(0)); share->null_field_first= 1; From e53b41a9eca3884e23d7eb7463c94020617c55c3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 13 Jan 2015 19:28:03 +0100 Subject: [PATCH 152/201] cleanup --- sql/handler.cc | 4 +--- sql/handler.h | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 086a6534120..7e756ff7848 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -86,9 +86,7 @@ static const LEX_STRING sys_table_aliases[]= }; const char *ha_row_type[] = { - "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", - "PAGE", - "?","?","?" + "", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE" }; const char *tx_isolation_names[] = diff --git a/sql/handler.h b/sql/handler.h index 8f8b4fd93af..642a922b544 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -369,9 +369,7 @@ enum legacy_db_type enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED, - ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, - /** Unused. Reserved for future versions. */ - ROW_TYPE_PAGE }; + ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE }; /* not part of the enum, so that it shouldn't be in switch(row_type) */ #define ROW_TYPE_MAX ((uint)ROW_TYPE_PAGE + 1) From 5900333aa5683bf0ef0698ccc911c6c07004ee3a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 14 Jan 2015 12:10:13 +0100 Subject: [PATCH 153/201] MDEV-7404 REPAIR multiple tables crash in MDL_ticket::has_stronger_or_equal_type mysql_alter_table() that is used in mysql_recreate_table() doesn't expect many tables in the TABLE_LIST. --- .../suite/innodb/r/multi_repair-7404.result | 21 +++++++++++++++++++ .../suite/innodb/t/multi_repair-7404.test | 18 ++++++++++++++++ sql/sql_table.cc | 14 ++++++++----- 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/innodb/r/multi_repair-7404.result create mode 100644 mysql-test/suite/innodb/t/multi_repair-7404.test diff --git a/mysql-test/suite/innodb/r/multi_repair-7404.result b/mysql-test/suite/innodb/r/multi_repair-7404.result new file mode 100644 index 00000000000..b3db5755b87 --- /dev/null +++ b/mysql-test/suite/innodb/r/multi_repair-7404.result @@ -0,0 +1,21 @@ +create table `t1`(`a` int) engine=innodb partition by key (`a`); +create table `t2`(`b` int) engine=innodb; +create table `t3`(`c` int) engine=innodb; +insert t1 values (1); +insert t2 values (2); +insert t3 values (3); +repair table `t1`,`t2`,`t3`; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +test.t3 repair status OK +select * from t1; +a +1 +select * from t2; +b +2 +select * from t3; +c +3 +drop table t1, t2, t3; diff --git a/mysql-test/suite/innodb/t/multi_repair-7404.test b/mysql-test/suite/innodb/t/multi_repair-7404.test new file mode 100644 index 00000000000..0775cd8b200 --- /dev/null +++ b/mysql-test/suite/innodb/t/multi_repair-7404.test @@ -0,0 +1,18 @@ +# +# MDEV-7404 REPAIR multiple tables crash in MDL_ticket::has_stronger_or_equal_type +# + +--source include/have_partition.inc +--source include/have_innodb.inc +create table `t1`(`a` int) engine=innodb partition by key (`a`); +create table `t2`(`b` int) engine=innodb; +create table `t3`(`c` int) engine=innodb; +insert t1 values (1); +insert t2 values (2); +insert t3 values (3); +repair table `t1`,`t2`,`t3`; +select * from t1; +select * from t2; +select * from t3; +drop table t1, t2, t3; + diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 77dbc765809..477ecf4a350 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7644,12 +7644,12 @@ err: /* - Recreates tables by calling mysql_alter_table(). + Recreates one table by calling mysql_alter_table(). SYNOPSIS mysql_recreate_table() thd Thread handler - tables Tables to recreate + table_list Table to recreate RETURN Like mysql_alter_table(). @@ -7658,9 +7658,9 @@ bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list) { HA_CREATE_INFO create_info; Alter_info alter_info; + TABLE_LIST *next_table= table_list->next_global; DBUG_ENTER("mysql_recreate_table"); - DBUG_ASSERT(!table_list->next_global); /* table_list->table has been closed and freed. Do not reference uninitialized data. open_tables() could fail. @@ -7672,15 +7672,19 @@ bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list) table_list->lock_type= TL_READ_NO_INSERT; /* Same applies to MDL request. */ table_list->mdl_request.set_type(MDL_SHARED_NO_WRITE); + /* hide following tables from open_tables() */ + table_list->next_global= NULL; bzero((char*) &create_info, sizeof(create_info)); create_info.row_type=ROW_TYPE_NOT_USED; create_info.default_table_charset=default_charset_info; /* Force alter table to recreate table */ alter_info.flags= (ALTER_CHANGE_COLUMN | ALTER_RECREATE); - DBUG_RETURN(mysql_alter_table(thd, NullS, NullS, &create_info, + bool res= mysql_alter_table(thd, NullS, NullS, &create_info, table_list, &alter_info, 0, - (ORDER *) 0, 0, 0)); + (ORDER *) 0, 0, 0); + table_list->next_global= next_table; + DBUG_RETURN(res); } From d9d994089fc574d1973b476673ccbc8a6481f8c6 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 14 Jan 2015 18:24:23 -0500 Subject: [PATCH 154/201] MDEV-7368 : SLES: Failed to start mysql.service: Unit mysql.service failed to load Added 'systemctl daemon-reload' command in postin and postun rpm scripts. --- support-files/rpm/server-postin.sh | 53 ++++++++++++++++-------------- support-files/rpm/server-postun.sh | 7 ++++ 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh index 91885f73466..cd2aec4d84a 100644 --- a/support-files/rpm/server-postin.sh +++ b/support-files/rpm/server-postin.sh @@ -1,6 +1,10 @@ # Make MySQL start/shutdown automatically when the machine does it. if [ $1 = 1 ] ; then + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 + fi + if [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add mysql fi @@ -51,30 +55,31 @@ fi SETARGETDIR=/etc/selinux/targeted/src/policy SEDOMPROG=$SETARGETDIR/domains/program SECONPROG=$SETARGETDIR/file_contexts/program -if [ -f /etc/redhat-release ] \ - && grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \ - || grep -q "CentOS release 4" /etc/redhat-release ; then - echo - echo - echo 'Notes regarding SELinux on this platform:' - echo '=========================================' - echo - echo 'The default policy might cause server startup to fail because it is ' - echo 'not allowed to access critical files. In this case, please update ' - echo 'your installation. ' - echo - echo 'The default policy might also cause inavailability of SSL related ' - echo 'features because the server is not allowed to access /dev/random ' - echo 'and /dev/urandom. If this is a problem, please do the following: ' - echo - echo ' 1) install selinux-policy-targeted-sources from your OS vendor' - echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':' - echo ' allow mysqld_t random_device_t:chr_file read;' - echo ' allow mysqld_t urandom_device_t:chr_file read;' - echo ' 3) cd to '$SETARGETDIR' and issue the following command:' - echo ' make load' - echo - echo +if [ -f /etc/redhat-release ] ; then + if grep '\(Red Hat Enterprise Linux ..\|CentOS\) release 4' \ + /etc/redhat-release >/dev/null 2>&1; then + echo + echo + echo 'Notes regarding SELinux on this platform:' + echo '=========================================' + echo + echo 'The default policy might cause server startup to fail because it is ' + echo 'not allowed to access critical files. In this case, please update ' + echo 'your installation. ' + echo + echo 'The default policy might also cause inavailability of SSL related ' + echo 'features because the server is not allowed to access /dev/random ' + echo 'and /dev/urandom. If this is a problem, please do the following: ' + echo + echo ' 1) install selinux-policy-targeted-sources from your OS vendor' + echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':' + echo ' allow mysqld_t random_device_t:chr_file read;' + echo ' allow mysqld_t urandom_device_t:chr_file read;' + echo ' 3) cd to '$SETARGETDIR' and issue the following command:' + echo ' make load' + echo + echo + fi fi if [ -x sbin/restorecon ] ; then diff --git a/support-files/rpm/server-postun.sh b/support-files/rpm/server-postun.sh index dcf67173a02..412c6f4c67b 100644 --- a/support-files/rpm/server-postun.sh +++ b/support-files/rpm/server-postun.sh @@ -6,3 +6,10 @@ if [ $1 -ge 1 ]; then fi fi fi + +if [ $1 = 0 ] ; then + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload > /dev/null 2>&1 + fi +fi + From ca6b86f42043d1eb80e8afd110c66ca79e948ef0 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 14 Jan 2015 17:50:38 +0400 Subject: [PATCH 155/201] MDEV-7448 - mtr may leave stale mysqld Let mtr handle SIGHUP the same way as SIGINT. This solves stale mysqld processes left after broken/closed ssh connection. --- mysql-test/lib/My/SafeProcess/Base.pm | 1 + mysql-test/lib/My/SafeProcess/safe_process.cc | 3 +++ mysql-test/mysql-test-run.pl | 2 ++ 3 files changed, 6 insertions(+) diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm index 0e8c191c440..1ac0120a735 100644 --- a/mysql-test/lib/My/SafeProcess/Base.pm +++ b/mysql-test/lib/My/SafeProcess/Base.pm @@ -180,6 +180,7 @@ sub create_process { } $SIG{INT}= 'DEFAULT'; + $SIG{HUP}= 'DEFAULT'; # Make this process it's own process group to be able to kill # it and any childs(that hasn't changed group themself) diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index f19ca622278..d6110f5f8c8 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -141,6 +141,7 @@ extern "C" void handle_signal(int sig) // Ignore further signals signal(SIGTERM, SIG_IGN); signal(SIGINT, SIG_IGN); + signal(SIGHUP, SIG_IGN); // Continune execution, allow the child to be started and // finally terminated by monitor loop @@ -164,6 +165,7 @@ int main(int argc, char* const argv[] ) /* Install signal handlers */ sigaction(SIGTERM, &sa,NULL); sigaction(SIGINT, &sa,NULL); + sigaction(SIGHUP, &sa, NULL); sigaction(SIGCHLD, &sa,NULL); sigaction(SIGABRT, &sa_abort,NULL); @@ -231,6 +233,7 @@ int main(int argc, char* const argv[] ) // Use default signal handlers in child signal(SIGTERM, SIG_DFL); signal(SIGINT, SIG_DFL); + signal(SIGHUP, SIG_DFL); signal(SIGCHLD, SIG_DFL); // Make this process it's own process group to be able to kill diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 50fb36d8989..daf9c6744da 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -109,6 +109,7 @@ require "lib/mtr_gprof.pl"; require "lib/mtr_misc.pl"; $SIG{INT}= sub { mtr_error("Got ^C signal"); }; +$SIG{HUP}= sub { mtr_error("Hangup detected on controlling terminal"); }; our $mysql_version_id; my $mysql_version_extra; @@ -908,6 +909,7 @@ sub run_worker ($) { my ($server_port, $thread_num)= @_; $SIG{INT}= sub { exit(1); }; + $SIG{HUP}= sub { exit(1); }; # Connect to server my $server = new IO::Socket::INET From 02099a335e1193f020bc167ccea5a1c3e9612a86 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Wed, 14 Jan 2015 18:19:05 +0100 Subject: [PATCH 156/201] MDEV-7467: sporadic failure in rpl.rpl_gtid_crash The test case injects a DBUG that will crash the server during replication, then does a START SLAVE. We need to use --error 0,2006,2013 on the START SLAVE, so that we will not fail the test if the server has time to crash before the START SLAVE returns to the client. Fixes a failure seen in Buildbot. --- mysql-test/suite/rpl/t/rpl_gtid_crash.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index a6d07ed69f0..90b4e454a74 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -215,6 +215,7 @@ EOF wait EOF SET GLOBAL debug_dbug="+d,inject_crash_before_flush_rli"; +--error 0,2006,2013 START SLAVE; --connection server_1 @@ -239,6 +240,7 @@ EOF wait EOF SET GLOBAL debug_dbug="+d,inject_crash_after_flush_rli"; +--error 0,2006,2013 START SLAVE; --connection server_1 From 919825a3ad5eb0f954d5db1a94d942ee86b7396a Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 14 Jan 2015 18:26:29 -0500 Subject: [PATCH 157/201] MDEV-7368 : SLES: Failed to start mysql.service: Unit mysql.service failed to load Added 'systemctl daemon-reload' command in postin and postun rpm scripts. --- support-files/rpm/server-postin.sh | 53 ++++++++++++++++-------------- support-files/rpm/server-postun.sh | 7 ++++ 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh index 91885f73466..cd2aec4d84a 100644 --- a/support-files/rpm/server-postin.sh +++ b/support-files/rpm/server-postin.sh @@ -1,6 +1,10 @@ # Make MySQL start/shutdown automatically when the machine does it. if [ $1 = 1 ] ; then + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 + fi + if [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add mysql fi @@ -51,30 +55,31 @@ fi SETARGETDIR=/etc/selinux/targeted/src/policy SEDOMPROG=$SETARGETDIR/domains/program SECONPROG=$SETARGETDIR/file_contexts/program -if [ -f /etc/redhat-release ] \ - && grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \ - || grep -q "CentOS release 4" /etc/redhat-release ; then - echo - echo - echo 'Notes regarding SELinux on this platform:' - echo '=========================================' - echo - echo 'The default policy might cause server startup to fail because it is ' - echo 'not allowed to access critical files. In this case, please update ' - echo 'your installation. ' - echo - echo 'The default policy might also cause inavailability of SSL related ' - echo 'features because the server is not allowed to access /dev/random ' - echo 'and /dev/urandom. If this is a problem, please do the following: ' - echo - echo ' 1) install selinux-policy-targeted-sources from your OS vendor' - echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':' - echo ' allow mysqld_t random_device_t:chr_file read;' - echo ' allow mysqld_t urandom_device_t:chr_file read;' - echo ' 3) cd to '$SETARGETDIR' and issue the following command:' - echo ' make load' - echo - echo +if [ -f /etc/redhat-release ] ; then + if grep '\(Red Hat Enterprise Linux ..\|CentOS\) release 4' \ + /etc/redhat-release >/dev/null 2>&1; then + echo + echo + echo 'Notes regarding SELinux on this platform:' + echo '=========================================' + echo + echo 'The default policy might cause server startup to fail because it is ' + echo 'not allowed to access critical files. In this case, please update ' + echo 'your installation. ' + echo + echo 'The default policy might also cause inavailability of SSL related ' + echo 'features because the server is not allowed to access /dev/random ' + echo 'and /dev/urandom. If this is a problem, please do the following: ' + echo + echo ' 1) install selinux-policy-targeted-sources from your OS vendor' + echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':' + echo ' allow mysqld_t random_device_t:chr_file read;' + echo ' allow mysqld_t urandom_device_t:chr_file read;' + echo ' 3) cd to '$SETARGETDIR' and issue the following command:' + echo ' make load' + echo + echo + fi fi if [ -x sbin/restorecon ] ; then diff --git a/support-files/rpm/server-postun.sh b/support-files/rpm/server-postun.sh index dcf67173a02..412c6f4c67b 100644 --- a/support-files/rpm/server-postun.sh +++ b/support-files/rpm/server-postun.sh @@ -6,3 +6,10 @@ if [ $1 -ge 1 ]; then fi fi fi + +if [ $1 = 0 ] ; then + if [ -x /usr/bin/systemctl ] ; then + /usr/bin/systemctl daemon-reload > /dev/null 2>&1 + fi +fi + From df2db863414dc592b7868517bcc0246de5f41007 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 15 Jan 2015 15:55:09 +0100 Subject: [PATCH 158/201] MDEV-7430: rpl.rpl_gtid_crash still fails in buildbot The problem was a too low timeout for slave reconnect. It was set to 9 seconds (10 retries with 1 second in-between). This is occasinally too short on some Buildbot hosts, when the test crashes and restarts the master while the slave IO thread is running. Fix by increasing --master-retry-count for this test. --- mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt | 1 + 1 file changed, 1 insertion(+) create mode 100644 mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt b/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt new file mode 100644 index 00000000000..69c1a64e388 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash-slave.opt @@ -0,0 +1 @@ +--master-retry-count=100 From 26a8a95cb3cbb5b843721baade5e52ac4703b8d6 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Thu, 15 Jan 2015 20:15:50 +0400 Subject: [PATCH 159/201] MDEV-7431 main.log_tables fails sporadically in buildbot Structure of the table created by the test to archive mysql.slow_log data didn't match the structure of mysql.slow_log. The failure only appeared if the slow_log was not empty, which was very rare. Updated the structure of the table. --- mysql-test/r/log_tables.result | 3 ++- mysql-test/t/log_tables.test | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 4471c01c99b..04cd2f01050 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -536,7 +536,8 @@ CREATE TABLE `db_17876.slow_log_data` ( `last_insert_id` int(11) default NULL, `insert_id` int(11) default NULL, `server_id` int(11) default NULL, -`sql_text` mediumtext +`sql_text` mediumtext, +`thread_id` bigint(21) unsigned default NULL ); CREATE TABLE `db_17876.general_log_data` ( `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 8a2bd4cf6c1..6fd26ab2011 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -727,7 +727,8 @@ CREATE TABLE `db_17876.slow_log_data` ( `last_insert_id` int(11) default NULL, `insert_id` int(11) default NULL, `server_id` int(11) default NULL, - `sql_text` mediumtext + `sql_text` mediumtext, + `thread_id` bigint(21) unsigned default NULL ); CREATE TABLE `db_17876.general_log_data` ( From 813af4cde83ff5082ae783c8bec2be581eec4d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 16 Jan 2015 11:26:03 +0200 Subject: [PATCH 160/201] Fix try for Buildbot test failure for tests innodb_bug12400341 innodb-mdev7046 innodb_stats_fetch_nonexistent --- mysql-test/suite/innodb/r/innodb_bug12400341.result | 2 +- .../suite/innodb/r/innodb_stats_fetch_nonexistent.result | 1 + mysql-test/suite/innodb/t/innodb-mdev7046.test | 1 + mysql-test/suite/innodb/t/innodb_bug12400341.test | 5 ++++- .../suite/innodb/t/innodb_stats_fetch_nonexistent.test | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result index 86eaa83980d..c382bd12616 100644 --- a/mysql-test/suite/innodb/r/innodb_bug12400341.result +++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result @@ -1,4 +1,4 @@ -call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too*"); set @old_innodb_undo_logs = @@innodb_undo_logs; set global innodb_undo_logs=1; show variables like "max_connections"; diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result b/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result index 4d1b8817bf1..befbb709c19 100644 --- a/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result +++ b/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table*"); CREATE TABLE test_ps_fetch_nonexistent (a INT, PRIMARY KEY (a)) ENGINE=INNODB STATS_PERSISTENT=1; diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index 24f1d3ab321..4033f284e65 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -9,6 +9,7 @@ # Ignore OS errors call mtr.add_suppression("InnoDB: File ./test/t1*"); call mtr.add_suppression("InnoDB: Error number*"); +call mtr.add_suppression("InnoDB: File ./test/t1#p#p1#sp#p1sp0.ibd: 'rename' returned OS error*"); # MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) # after Operating system error number 36 in a file operation diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test index 173d42665be..a60a5104c3f 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -11,7 +11,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n # and cause unstable result. --source include/not_valgrind.inc -call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); +# Previous undo slots cause unnecessary failures +--source include/not_windows.inc + +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too*"); --disable_query_log set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug; diff --git a/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test b/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test index 6c7365c52d1..dbafb33965c 100644 --- a/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test +++ b/mysql-test/suite/innodb/t/innodb_stats_fetch_nonexistent.test @@ -4,6 +4,8 @@ -- source include/have_innodb.inc +call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table*"); + -- vertical_results CREATE TABLE test_ps_fetch_nonexistent From 6164157b3f86af4e67658ae2f4d86effc05806fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 16 Jan 2015 12:00:07 +0200 Subject: [PATCH 161/201] MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL Analysis: Problem was that value->is_null() function is called even when user had explicitly set the value for timestamp field. Calling this function had the side effect that expression was evaluated twice. Fix: (by Sergei Golubchik) check instead value->null_value. --- mysql-test/r/type_timestamp.result | 44 +++++++++++++++++++++++++++++ mysql-test/t/type_timestamp.test | 45 ++++++++++++++++++++++++++++++ sql/field.cc | 2 +- 3 files changed, 90 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index e7add0d80a7..bfe7cb94895 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -645,3 +645,47 @@ MAX(dt) = '2011-01-06 12:34:30' 1 DROP TABLE t1; End of 5.5 tests +# +# MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL +# +create table t1(value timestamp not null); +set @a:=0; +create function f1 () returns timestamp +begin +set @a = @a + 1; +return NULL; +end// +set timestamp=12340; +insert t1 values (f1()); +select @a, value from t1; +@a value +1 1970-01-01 05:25:40 +set timestamp=12350; +update t1 set value = f1(); +select @a, value from t1; +@a value +2 1970-01-01 05:25:50 +drop table t1; +drop function f1; +set timestamp=0; +create table t1(value timestamp null); +set @a:=0; +create function f1 () returns timestamp +begin +set @a = @a + 1; +return NULL; +end// +set timestamp=12340; +insert t1 values (f1()); +select @a, value from t1; +@a value +1 NULL +set timestamp=12350; +update t1 set value = f1(); +select @a, value from t1; +@a value +2 NULL +drop table t1; +drop function f1; +set timestamp=0; +End of 10.0 tests diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 1c17743e7f1..d0e8be22bdd 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -446,3 +446,48 @@ SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1; DROP TABLE t1; --echo End of 5.5 tests + +--echo # +--echo # MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL +--echo # + +create table t1(value timestamp not null); +set @a:=0; +delimiter //; +create function f1 () returns timestamp +begin + set @a = @a + 1; + return NULL; +end// +delimiter ;// +set timestamp=12340; +insert t1 values (f1()); +select @a, value from t1; +set timestamp=12350; +update t1 set value = f1(); +select @a, value from t1; +drop table t1; +drop function f1; +set timestamp=0; + +# Verify no regressions to TIMESTAMP NULL +create table t1(value timestamp null); +set @a:=0; +delimiter //; +create function f1 () returns timestamp +begin + set @a = @a + 1; + return NULL; +end// +delimiter ;// +set timestamp=12340; +insert t1 values (f1()); +select @a, value from t1; +set timestamp=12350; +update t1 set value = f1(); +select @a, value from t1; +drop table t1; +drop function f1; +set timestamp=0; + +--echo End of 10.0 tests diff --git a/sql/field.cc b/sql/field.cc index ad59b4a63bd..e7e046a8458 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4899,7 +4899,7 @@ void Field_timestamp::set_explicit_default(Item *value) { if (((value->type() == Item::DEFAULT_VALUE_ITEM && !((Item_default_value*)value)->arg) || - (!maybe_null() && value->is_null()))) + (!maybe_null() && value->null_value))) return; set_has_explicit_value(); } From 2fc0b22f2abd193b1d7091d5764a1ee254e79da6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 16 Jan 2015 17:54:00 +0100 Subject: [PATCH 162/201] restore an incorrectly merged line it's in the dead code (ifdef-ed out) so it doesn't matter what it is. still better to keep it closer to the upstream --- storage/tokudb/ha_tokudb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index c17a4628a11..6c4055fc621 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -833,7 +833,7 @@ static inline bool key_is_clustering(const KEY *key) { #else static inline bool key_is_clustering(const KEY *key) { - return key->option_struct && key->option_struct->clustering; + return key->flags & HA_CLUSTERING; } #endif From 3f118a74bea0af77963bd2f2370a065c6fc80d84 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 16 Jan 2015 18:13:02 +0100 Subject: [PATCH 163/201] MDEV-6347 Build RHEL7 packages add "mysql-compat-server" alias to MariaDB-server package --- cmake/cpack_rpm.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index f5642ff4a00..bd8d96154b2 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -188,6 +188,7 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7") ALTERNATIVE_NAME("client" "mysql") ALTERNATIVE_NAME("devel" "mariadb-devel") ALTERNATIVE_NAME("server" "mariadb-server") + ALTERNATIVE_NAME("server" "mysql-compat-server") ALTERNATIVE_NAME("shared" "mariadb-libs") ALTERNATIVE_NAME("shared" "mysql-libs") ALTERNATIVE_NAME("test" "mariadb-test") From f5beda4866b71a6a1d4b28191355c827670d92dc Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 17 Jan 2015 11:54:41 +0100 Subject: [PATCH 164/201] - Fix two bugs concerning Discovery of CSV tables: Sep_char default is now ',' like when discovery is not used If data_charset is UTF8, column names retrieved from the header are no longer converted to UTF8 considering they already are. modified: storage/connect/ha_connect.cc --- storage/connect/ha_connect.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 1eab61f9115..eee0c334bb1 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4867,7 +4867,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, fncn= topt->catfunc; fnc= GetFuncID(fncn); sep= topt->separator; - spc= (!sep || !strcmp(sep, "\\t")) ? '\t' : *sep; + spc= (!sep) ? ',' : (!strcmp(sep, "\\t")) ? '\t' : *sep; qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0; hdr= (int)topt->header; tbl= topt->tablist; @@ -5237,7 +5237,13 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, for (crp= qrp->Colresp; crp; crp= crp->Next) switch (crp->Fld) { case FLD_NAME: - cnm= encode(g, crp->Kdata->GetCharValue(i)); + if (ttp == TAB_CSV && topt->data_charset && + (!stricmp(topt->data_charset, "UTF8") || + !stricmp(topt->data_charset, "UTF-8"))) + cnm= crp->Kdata->GetCharValue(i); + else + cnm= encode(g, crp->Kdata->GetCharValue(i)); + break; case FLD_TYPE: typ= crp->Kdata->GetIntValue(i); From fb3f46967cfe4f3f28d13f5083a76b7c939e2724 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 17 Jan 2015 12:19:06 +0100 Subject: [PATCH 165/201] - Fix two bugs concerning Discovery of CSV tables: Sep_char default is now ',' like when discovery is not used If data_charset is UTF8, column names retrieved from the header are no longer converted to UTF8 considering they already are (MDEV-7421) modified: storage/connect/ha_connect.cc --- storage/connect/ha_connect.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 1eab61f9115..eee0c334bb1 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -4867,7 +4867,7 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, fncn= topt->catfunc; fnc= GetFuncID(fncn); sep= topt->separator; - spc= (!sep || !strcmp(sep, "\\t")) ? '\t' : *sep; + spc= (!sep) ? ',' : (!strcmp(sep, "\\t")) ? '\t' : *sep; qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0; hdr= (int)topt->header; tbl= topt->tablist; @@ -5237,7 +5237,13 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd, for (crp= qrp->Colresp; crp; crp= crp->Next) switch (crp->Fld) { case FLD_NAME: - cnm= encode(g, crp->Kdata->GetCharValue(i)); + if (ttp == TAB_CSV && topt->data_charset && + (!stricmp(topt->data_charset, "UTF8") || + !stricmp(topt->data_charset, "UTF-8"))) + cnm= crp->Kdata->GetCharValue(i); + else + cnm= encode(g, crp->Kdata->GetCharValue(i)); + break; case FLD_TYPE: typ= crp->Kdata->GetIntValue(i); From 252be4c9e75ea126ec32619c136961d53bdabe59 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 17 Jan 2015 16:10:45 +0400 Subject: [PATCH 166/201] A post-fix for: MDEV-7254 Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL The test type_timestamp failed depending on the build machine time zone. Setting a fixed time zone for the test. --- mysql-test/r/type_timestamp.result | 2 ++ mysql-test/t/type_timestamp.test | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index bfe7cb94895..38838e72e96 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -648,6 +648,7 @@ End of 5.5 tests # # MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL # +SET time_zone='+02:00'; create table t1(value timestamp not null); set @a:=0; create function f1 () returns timestamp @@ -688,4 +689,5 @@ select @a, value from t1; drop table t1; drop function f1; set timestamp=0; +SET time_zone=DEFAULT; End of 10.0 tests diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index d0e8be22bdd..77ce8c595ca 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -451,6 +451,7 @@ DROP TABLE t1; --echo # MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL --echo # +SET time_zone='+02:00'; create table t1(value timestamp not null); set @a:=0; delimiter //; @@ -489,5 +490,6 @@ select @a, value from t1; drop table t1; drop function f1; set timestamp=0; +SET time_zone=DEFAULT; --echo End of 10.0 tests From 6e6750ad6c0a733b78bf106bcc45311f61015a9b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 17 Jan 2015 17:52:03 +0400 Subject: [PATCH 167/201] MDEV-7366 SELECT 'a' = BINARY 'A' returns 1 (utf8 charset, utf8_unicode_ci collation) Fixing a wrong assymetric code in Arg_comparator::set_cmp_func(). It existed for a long time, but showed up in 10.0.14 after the fix for "MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)". --- mysql-test/r/ctype_uca.result | 10 +++++++ mysql-test/t/ctype_uca.test | 7 +++++ sql/item_cmpfunc.cc | 51 ++++++++++++++++++++++++----------- sql/item_cmpfunc.h | 14 +++++----- 4 files changed, 61 insertions(+), 21 deletions(-) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 94db9d8f783..3bdf9b994c6 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -13126,5 +13126,15 @@ DROP TABLE t1; # END of ctype_myanmar.inc # # +# MDEV-7366 SELECT 'a' = BINARY 'A' returns 1 (utf8 charset, utf8_unicode_ci collation) +# +SET NAMES utf8 COLLATE utf8_unicode_ci; +SELECT 'a' = BINARY 'A'; +'a' = BINARY 'A' +0 +SELECT BINARY 'A' = 'a'; +BINARY 'A' = 'a' +0 +# # End of MariaDB-10.0 tests # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index fa33535c9b1..14bff41b851 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -587,6 +587,13 @@ SET NAMES utf8 COLLATE utf8_myanmar_ci; SET collation_connection=ucs2_myanmar_ci; --source include/ctype_myanmar.inc +--echo # +--echo # MDEV-7366 SELECT 'a' = BINARY 'A' returns 1 (utf8 charset, utf8_unicode_ci collation) +--echo # +SET NAMES utf8 COLLATE utf8_unicode_ci; +SELECT 'a' = BINARY 'A'; +SELECT BINARY 'A' = 'a'; + --echo # --echo # End of MariaDB-10.0 tests --echo # diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 62f63501d86..1f1982ffb80 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -621,17 +621,6 @@ int Arg_comparator::set_compare_func(Item_result_field *item, Item_result type) } case STRING_RESULT: { - /* - We must set cmp_charset here as we may be called from for an automatic - generated item, like in natural join - */ - if (cmp_collation.set((*a)->collation, (*b)->collation) || - cmp_collation.derivation == DERIVATION_NONE) - { - my_coll_agg_error((*a)->collation, (*b)->collation, - owner->func_name()); - return 1; - } if (cmp_collation.collation == &my_charset_bin) { /* @@ -754,6 +743,37 @@ bool get_mysql_time_from_str(THD *thd, String *str, timestamp_type warn_type, } +/** + Aggregate comparator argument charsets for comparison. + One of the arguments ("a" or "b") can be replaced, + typically by Item_string or Item_func_conv_charset. + + @return Aggregation result + @retval false - if no conversion is needed, + or if one of the arguments was converted + @retval true - on error, if arguments are not comparable. + + TODO: get rid of this method eventually and refactor the calling code. + Argument conversion should happen on the Item_func level. + Arg_comparator should get comparable arguments. +*/ +bool Arg_comparator::agg_arg_charsets_for_comparison() +{ + if (cmp_collation.set((*a)->collation, (*b)->collation, MY_COLL_CMP_CONV) || + cmp_collation.derivation == DERIVATION_NONE) + { + my_coll_agg_error((*a)->collation, (*b)->collation, owner->func_name()); + return true; + } + if (agg_item_set_converter(cmp_collation, owner->func_name(), + a, 1, MY_COLL_CMP_CONV, 1) || + agg_item_set_converter(cmp_collation, owner->func_name(), + b, 1, MY_COLL_CMP_CONV, 1)) + return true; + return false; +} + + /** Prepare the comparator (set the comparison function) for comparing items *a1 and *a2 in the context of 'type'. @@ -781,10 +801,11 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg, (*a)->result_type() == STRING_RESULT && (*b)->result_type() == STRING_RESULT) { - DTCollation coll; - coll.set((*a)->collation.collation); - if (agg_item_set_converter(coll, owner->func_name(), - b, 1, MY_COLL_CMP_CONV, 1)) + /* + We must set cmp_collation here as we may be called from for an automatic + generated item, like in natural join + */ + if (agg_arg_charsets_for_comparison()) return 1; } if (type == INT_RESULT && diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index affed52cfd2..5d11057228c 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -48,6 +48,14 @@ class Arg_comparator: public Sql_alloc THD *thd; Item *a_cache, *b_cache; // Cached values of a and b items // when one of arguments is NULL. + int set_compare_func(Item_result_field *owner, Item_result type); + inline int set_compare_func(Item_result_field *owner_arg) + { + return set_compare_func(owner_arg, item_cmp_type((*a)->result_type(), + (*b)->result_type())); + } + bool agg_arg_charsets_for_comparison(); + public: DTCollation cmp_collation; /* Allow owner function to use string buffers. */ @@ -58,12 +66,6 @@ public: Arg_comparator(Item **a1, Item **a2): a(a1), b(a2), set_null(TRUE), comparators(0), thd(0), a_cache(0), b_cache(0) {}; - int set_compare_func(Item_result_field *owner, Item_result type); - inline int set_compare_func(Item_result_field *owner_arg) - { - return set_compare_func(owner_arg, item_cmp_type((*a)->result_type(), - (*b)->result_type())); - } int set_cmp_func(Item_result_field *owner_arg, Item **a1, Item **a2, Item_result type); From 09d54b37f5968da4105dcb5d4f4e3afaeb44923f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Sat, 17 Jan 2015 16:58:10 +0000 Subject: [PATCH 168/201] MDEV-7362: ANALYZE TABLES crash with table-independent-statistics gathering FULLTEXT indexes do not permit index first lookups. By calling: ha_index_first() with a garbage parameter, random data gets overwritten that causes the table->field array to be corrupted. Subsequently, when the field array is accessed, a segfault occurs. By not allowing index statistics for FULLTEXT indexes, the problem is resolved. --- .../r/statistics_index_crash-7362.result | 33 +++++++++++++++++++ mysql-test/t/statistics_index_crash-7362.test | 30 +++++++++++++++++ sql/sql_statistics.cc | 10 ++++-- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/statistics_index_crash-7362.result create mode 100644 mysql-test/t/statistics_index_crash-7362.test diff --git a/mysql-test/r/statistics_index_crash-7362.result b/mysql-test/r/statistics_index_crash-7362.result new file mode 100644 index 00000000000..99f65d7e1b7 --- /dev/null +++ b/mysql-test/r/statistics_index_crash-7362.result @@ -0,0 +1,33 @@ +CREATE TABLE t1 (a longtext, FULLTEXT KEY (`a`)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (unhex('3E0D0A4141414142334E7A6143317963324541414141424977414141674541726D')); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +SELECT * FROM mysql.index_stats WHERE index_name='a' AND table_name='t1'; +db_name table_name index_name prefix_arity avg_frequency +test t1 a 1 NULL +DROP TABLE t1; +CREATE TABLE t1 (a longtext, FULLTEXT KEY (`a`)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (unhex('3E0D0A4141414142334E7A6143317963324541414141424977414141674541726D')); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +SELECT * FROM mysql.index_stats WHERE index_name='a' AND table_name='t1'; +db_name table_name index_name prefix_arity avg_frequency +test t1 a 1 NULL +DROP TABLE t1; +CREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM; +INSERT INTO geom VALUES +(MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +ANALYZE TABLE geom PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.geom analyze status Engine-independent statistics collected +test.geom analyze status OK +SELECT * FROM mysql.index_stats WHERE index_name='g' AND table_name='geom'; +db_name table_name index_name prefix_arity avg_frequency +test geom g 1 NULL +DROP TABLE geom; diff --git a/mysql-test/t/statistics_index_crash-7362.test b/mysql-test/t/statistics_index_crash-7362.test new file mode 100644 index 00000000000..3873b896dae --- /dev/null +++ b/mysql-test/t/statistics_index_crash-7362.test @@ -0,0 +1,30 @@ +# Test cases that cover the crashes within: +# MDEV-7362 ANALYZE TABLES crash with table-independent-statistics gathering +# MDEV-7380 engine-independent stats SEGV on ANALYZE TABLE (#2) + +--source include/have_stat_tables.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (a longtext, FULLTEXT KEY (`a`)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (unhex('3E0D0A4141414142334E7A6143317963324541414141424977414141674541726D')); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +--sorted_result +SELECT * FROM mysql.index_stats WHERE index_name='a' AND table_name='t1'; +DROP TABLE t1; + +CREATE TABLE t1 (a longtext, FULLTEXT KEY (`a`)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (unhex('3E0D0A4141414142334E7A6143317963324541414141424977414141674541726D')); +ANALYZE TABLE t1 PERSISTENT FOR ALL; +--sorted_result +SELECT * FROM mysql.index_stats WHERE index_name='a' AND table_name='t1'; +DROP TABLE t1; + +CREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM; +INSERT INTO geom VALUES + (MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), + (MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), + (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +ANALYZE TABLE geom PERSISTENT FOR ALL; +--sorted_result +SELECT * FROM mysql.index_stats WHERE index_name='g' AND table_name='geom'; +DROP TABLE geom; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index d368145ca73..4ce1f3ec22a 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -2355,9 +2355,15 @@ int collect_statistics_for_index(THD *thd, TABLE *table, uint index) int rc= 0; KEY *key_info= &table->key_info[index]; ha_rows rows= 0; - Index_prefix_calc index_prefix_calc(table, key_info); + DBUG_ENTER("collect_statistics_for_index"); + /* No statistics for FULLTEXT indexes. */ + if (key_info->flags & HA_FULLTEXT) + DBUG_RETURN(rc); + + Index_prefix_calc index_prefix_calc(table, key_info); + DEBUG_SYNC(table->in_use, "statistics_collection_start1"); DEBUG_SYNC(table->in_use, "statistics_collection_start2"); @@ -2391,7 +2397,7 @@ int collect_statistics_for_index(THD *thd, TABLE *table, uint index) if (!rc) index_prefix_calc.get_avg_frequency(); - DBUG_RETURN(rc); + DBUG_RETURN(rc); } From c11a054a98f72bac2334c8c6b0b66feb94e8248f Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sun, 18 Jan 2015 01:54:11 +0400 Subject: [PATCH 169/201] MDEV-7152 Wrong result set for WHERE a='oe' COLLATE utf8_german2_ci AND a='oe' - The code that tested if WHERE expr=value AND expr=const can be rewritten to: WHERE const=value AND expr=const was incomplete in case of STRING_RESULT. - Moving the test into a new function, to reduce duplicate code. --- mysql-test/r/ctype_uca.result | 23 +++++++++ mysql-test/t/ctype_uca.test | 12 +++++ sql/sql_select.cc | 97 +++++++++++++++++++++++++++++------ 3 files changed, 116 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 3bdf9b994c6..16b60aed07f 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -13136,5 +13136,28 @@ SELECT BINARY 'A' = 'a'; BINARY 'A' = 'a' 0 # +# Wrong result set for WHERE a='oe' COLLATE utf8_german2_ci AND a='oe' +# +SET NAMES utf8 COLLATE utf8_german2_ci; +CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf8); +INSERT INTO t1 VALUES ('ö'),('oe'); +SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_ci; +a +oe +SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; +a +oe +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_ci; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'oe') and (`test`.`t1`.`a` = 'oe')) +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'oe') and (`test`.`t1`.`a` = 'oe')) +DROP TABLE t1; +# # End of MariaDB-10.0 tests # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 14bff41b851..95008d83a38 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -594,6 +594,18 @@ SET NAMES utf8 COLLATE utf8_unicode_ci; SELECT 'a' = BINARY 'A'; SELECT BINARY 'A' = 'a'; +--echo # +--echo # Wrong result set for WHERE a='oe' COLLATE utf8_german2_ci AND a='oe' +--echo # +SET NAMES utf8 COLLATE utf8_german2_ci; +CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf8); +INSERT INTO t1 VALUES ('ö'),('oe'); +SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_ci; +SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_ci; +EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; +DROP TABLE t1; + --echo # --echo # End of MariaDB-10.0 tests --echo # diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2e8ed7c5dbd..2eb2ddc057e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12213,8 +12213,8 @@ public: { TRASH(ptr, size); } Item *and_level; - Item_func *cmp_func; - COND_CMP(Item *a,Item_func *b) :and_level(a),cmp_func(b) {} + Item_bool_func2 *cmp_func; + COND_CMP(Item *a,Item_bool_func2 *b) :and_level(a),cmp_func(b) {} }; /** @@ -13603,6 +13603,75 @@ static void update_const_equal_items(COND *cond, JOIN_TAB *tab, bool const_key) } +/** + Check if + WHERE expr=value AND expr=const + can be rewritten as: + WHERE const=value AND expr=const + + @param target - the target operator whose "expr" argument will be + replaced to "const". + @param target_expr - the target's "expr" which will be replaced to "const". + @param target_value - the target's second argument, it will remain unchanged. + @param source - the equality expression ("=" or "<=>") that + can be used to rewrite the "target" part + (under certain conditions, see the code). + @param source_expr - the source's "expr". It should be exactly equal to + the target's "expr" to make condition rewrite possible. + @param source_const - the source's "const" argument, it will be inserted + into "target" instead of "expr". +*/ +static bool +can_change_cond_ref_to_const(Item_bool_func2 *target, + Item *target_expr, Item *target_value, + Item_bool_func2 *source, + Item *source_expr, Item *source_const) +{ + if (!target_expr->eq(source_expr,0) || + target_value == source_const || + target_expr->cmp_context != source_expr->cmp_context) + return false; + if (target_expr->cmp_context == STRING_RESULT) + { + /* + In this example: + SET NAMES utf8 COLLATE utf8_german2_ci; + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf8); + INSERT INTO t1 VALUES ('o-umlaut'),('oe'); + SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe'; + + the query should return only the row with 'oe'. + It should not return 'o-umlaut', because 'o-umlaut' does not match + the right part of the condition: a='oe' + ('o-umlaut' is not equal to 'oe' in utf8_general_ci, + which is the collation of the field "a"). + + If we change the right part from: + ... AND a='oe' + to + ... AND 'oe' COLLATE utf8_german2_ci='oe' + it will be evalulated to TRUE and removed from the condition, + so the overall query will be simplified to: + + SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci; + + which will erroneously start to return both 'oe' and 'o-umlaut'. + So changing "expr" to "const" is not possible if the effective + collations of "target" and "source" are not exactly the same. + + Note, the code before the fix for MDEV-7152 only checked that + collations of "source_const" and "target_value" are the same. + This was not enough, as the bug report demonstrated. + */ + return + target->compare_collation() == source->compare_collation() && + target_value->collation.collation == source_const->collation.collation; + } + return true; // Non-string comparison +} + + /* change field = field to field = const for each found field = const in the and_level @@ -13611,6 +13680,7 @@ static void update_const_equal_items(COND *cond, JOIN_TAB *tab, bool const_key) static void change_cond_ref_to_const(THD *thd, I_List *save_list, Item *and_father, Item *cond, + Item_bool_func2 *field_value_owner, Item *field, Item *value) { if (cond->type() == Item::COND_ITEM) @@ -13621,7 +13691,7 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, Item *item; while ((item=li++)) change_cond_ref_to_const(thd, save_list,and_level ? cond : item, item, - field, value); + field_value_owner, field, value); return; } if (cond->eq_cmp_result() == Item::COND_OK) @@ -13633,11 +13703,8 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, Item *right_item= args[1]; Item_func::Functype functype= func->functype(); - if (right_item->eq(field,0) && left_item != value && - right_item->cmp_context == field->cmp_context && - (left_item->result_type() != STRING_RESULT || - value->result_type() != STRING_RESULT || - left_item->collation.collation == value->collation.collation)) + if (can_change_cond_ref_to_const(func, right_item, left_item, + field_value_owner, field, value)) { Item *tmp=value->clone_item(); if (tmp) @@ -13656,11 +13723,8 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, func->set_cmp_func(); } } - else if (left_item->eq(field,0) && right_item != value && - left_item->cmp_context == field->cmp_context && - (right_item->result_type() != STRING_RESULT || - value->result_type() != STRING_RESULT || - right_item->collation.collation == value->collation.collation)) + else if (can_change_cond_ref_to_const(func, left_item, right_item, + field_value_owner, field, value)) { Item *tmp= value->clone_item(); if (tmp) @@ -13709,7 +13773,8 @@ propagate_cond_constants(THD *thd, I_List *save_list, Item **args= cond_cmp->cmp_func->arguments(); if (!args[0]->const_item()) change_cond_ref_to_const(thd, &save,cond_cmp->and_level, - cond_cmp->and_level, args[0], args[1]); + cond_cmp->and_level, + cond_cmp->cmp_func, args[0], args[1]); } } } @@ -13731,14 +13796,14 @@ propagate_cond_constants(THD *thd, I_List *save_list, resolve_const_item(thd, &args[1], args[0]); func->update_used_tables(); change_cond_ref_to_const(thd, save_list, and_father, and_father, - args[0], args[1]); + func, args[0], args[1]); } else if (left_const) { resolve_const_item(thd, &args[0], args[1]); func->update_used_tables(); change_cond_ref_to_const(thd, save_list, and_father, and_father, - args[1], args[0]); + func, args[1], args[0]); } } } From 32be7dffbe7c9bf5c65210e2775e6e2d3d6d411e Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 18 Jan 2015 13:39:59 +0200 Subject: [PATCH 170/201] Return to original stage after mysql_lock_tables Stage "Filling schema table" is now properly shown in 'show processlist' mysys/mf_keycache.c: Simple cleanup with more comments sql/lock.cc: Return to original stage after mysql_lock_tables Made 'Table lock' as a true stage sql/sql_show.cc: Restore original stage after get_schema_tables_result --- mysys/mf_keycache.c | 35 +++++++++++++++++++++++------------ sql/lock.cc | 9 +++++---- sql/mysqld.cc | 4 ++++ sql/mysqld.h | 2 ++ sql/sql_show.cc | 7 ++++--- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 5505693ce2c..b9da197d311 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1020,11 +1020,11 @@ void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup) */ static void link_into_queue(KEYCACHE_WQUEUE *wqueue, - struct st_my_thread_var *thread) + struct st_my_thread_var *thread) { struct st_my_thread_var *last; - DBUG_ASSERT(!thread->next && !thread->prev); + if (! (last= wqueue->last_thread)) { /* Queue is empty */ @@ -1033,10 +1033,15 @@ static void link_into_queue(KEYCACHE_WQUEUE *wqueue, } else { - thread->prev= last->next->prev; - last->next->prev= &thread->next; - thread->next= last->next; - last->next= thread; + DBUG_ASSERT(last->next->prev == &last->next); + /* Add backlink to previous element */ + thread->prev= last->next->prev; + /* Fix first in list to point backwords to current */ + last->next->prev= &thread->next; + /* Next should point to the first element in list */ + thread->next= last->next; + /* Fix old element to point to new one */ + last->next= thread; } wqueue->last_thread= thread; } @@ -1057,17 +1062,22 @@ static void link_into_queue(KEYCACHE_WQUEUE *wqueue, */ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, - struct st_my_thread_var *thread) + struct st_my_thread_var *thread) { KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id)); DBUG_ASSERT(thread->next && thread->prev); + if (thread->next == thread) + { /* The queue contains only one member */ wqueue->last_thread= NULL; + } else { + /* Remove current element from list */ thread->next->prev= thread->prev; - *thread->prev=thread->next; + *thread->prev= thread->next; + /* If first element, change list pointer to point to previous element */ if (wqueue->last_thread == thread) wqueue->last_thread= STRUCT_PTR(struct st_my_thread_var, next, thread->prev); @@ -1111,10 +1121,10 @@ static void wait_on_queue(KEYCACHE_WQUEUE *wqueue, { struct st_my_thread_var *last; struct st_my_thread_var *thread= my_thread_var; - - /* Add to queue. */ DBUG_ASSERT(!thread->next); DBUG_ASSERT(!thread->prev); /* Not required, but must be true anyway. */ + + /* Add to queue. */ if (! (last= wqueue->last_thread)) thread->next= thread; else @@ -1125,7 +1135,7 @@ static void wait_on_queue(KEYCACHE_WQUEUE *wqueue, wqueue->last_thread= thread; /* - Wait until thread is removed from queue by the signalling thread. + Wait until thread is removed from queue by the signaling thread. The loop protects against stray signals. */ do @@ -1163,10 +1173,11 @@ static void release_whole_queue(KEYCACHE_WQUEUE *wqueue) if (!(last= wqueue->last_thread)) return; - next= last->next; + next= last->next; /* First (oldest) element */ do { thread=next; + DBUG_ASSERT(thread); KEYCACHE_DBUG_PRINT("release_whole_queue: signal", ("thread %ld", thread->id)); /* Signal the thread. */ diff --git a/sql/lock.cc b/sql/lock.cc index fbed8d8331c..e713990bd58 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -301,15 +301,16 @@ bool mysql_lock_tables(THD *thd, MYSQL_LOCK *sql_lock, uint flags) int rc= 1; ulong timeout= (flags & MYSQL_LOCK_IGNORE_TIMEOUT) ? LONG_TIMEOUT : thd->variables.lock_wait_timeout; - + PSI_stage_info org_stage; DBUG_ENTER("mysql_lock_tables(sql_lock)"); - THD_STAGE_INFO(thd, stage_system_lock); + thd->enter_stage(&stage_system_lock, &org_stage, __func__, __FILE__, + __LINE__); if (sql_lock->table_count && lock_external(thd, sql_lock->table, sql_lock->table_count)) goto end; - thd_proc_info(thd, "Table lock"); + THD_STAGE_INFO(thd, stage_table_lock); /* Copy the lock data array. thr_multi_lock() reorders its contents. */ memmove(sql_lock->locks + sql_lock->lock_count, sql_lock->locks, @@ -323,7 +324,7 @@ bool mysql_lock_tables(THD *thd, MYSQL_LOCK *sql_lock, uint flags) (void) unlock_external(thd, sql_lock->table, sql_lock->table_count); end: - THD_STAGE_INFO(thd, stage_after_table_lock); + THD_STAGE_INFO(thd, org_stage); if (thd->killed) { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 760ae6fa0d7..e0eaf55daf9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9458,6 +9458,8 @@ PSI_stage_info stage_sql_thd_waiting_until_delay= { 0, "Waiting until MASTER_DEL PSI_stage_info stage_storing_result_in_query_cache= { 0, "storing result in query cache", 0}; PSI_stage_info stage_storing_row_into_queue= { 0, "storing row into queue", 0}; PSI_stage_info stage_system_lock= { 0, "System lock", 0}; +PSI_stage_info stage_table_lock= { 0, "Table lock", 0}; +PSI_stage_info stage_filling_schema_table= { 0, "Filling schema table", 0}; PSI_stage_info stage_update= { 0, "update", 0}; PSI_stage_info stage_updating= { 0, "updating", 0}; PSI_stage_info stage_updating_main_table= { 0, "updating main table", 0}; @@ -9591,6 +9593,8 @@ PSI_stage_info *all_server_stages[]= & stage_storing_result_in_query_cache, & stage_storing_row_into_queue, & stage_system_lock, + & stage_table_lock, + & stage_filling_schema_table, & stage_update, & stage_updating, & stage_updating_main_table, diff --git a/sql/mysqld.h b/sql/mysqld.h index d66ea8f2e97..f6d9dbea48a 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -413,6 +413,8 @@ extern PSI_stage_info stage_statistics; extern PSI_stage_info stage_storing_result_in_query_cache; extern PSI_stage_info stage_storing_row_into_queue; extern PSI_stage_info stage_system_lock; +extern PSI_stage_info stage_table_lock; +extern PSI_stage_info stage_filling_schema_table; extern PSI_stage_info stage_update; extern PSI_stage_info stage_updating; extern PSI_stage_info stage_updating_main_table; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 70173fb354f..9dbee701061 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -8081,12 +8081,13 @@ bool get_schema_tables_result(JOIN *join, THD *thd= join->thd; LEX *lex= thd->lex; bool result= 0; - const char *old_proc_info; + PSI_stage_info org_stage; DBUG_ENTER("get_schema_tables_result"); Warnings_only_error_handler err_handler; thd->push_internal_handler(&err_handler); - old_proc_info= thd_proc_info(thd, "Filling schema table"); + thd->enter_stage(&stage_filling_schema_table, &org_stage, __func__, __FILE__, + __LINE__); JOIN_TAB *tab; for (tab= first_linear_tab(join, WITHOUT_BUSH_ROOTS, WITH_CONST_TABLES); @@ -8190,7 +8191,7 @@ bool get_schema_tables_result(JOIN *join, } else if (result) my_error(ER_UNKNOWN_ERROR, MYF(0)); - thd_proc_info(thd, old_proc_info); + THD_STAGE_INFO(thd, org_stage); DBUG_RETURN(result); } From 7cb4a1c61f3327dbb86b6160ec2421bf827cea20 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 18 Jan 2015 20:38:07 +0200 Subject: [PATCH 171/201] Fixed MDEV-7314: Deadlock when doing insert-select with Aria mysql-test/suite/maria/insert_select.result: Added test case mysql-test/suite/maria/insert_select.test: Added test case mysys/thr_lock.c: Ensure we don't allow concurrent_insert when a read_no_write lock is in use --- mysql-test/suite/maria/insert_select.result | 17 +++++++++++++ mysql-test/suite/maria/insert_select.test | 27 +++++++++++++++++++++ mysys/thr_lock.c | 3 ++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/maria/insert_select.result create mode 100644 mysql-test/suite/maria/insert_select.test diff --git a/mysql-test/suite/maria/insert_select.result b/mysql-test/suite/maria/insert_select.result new file mode 100644 index 00000000000..2f25cc5855c --- /dev/null +++ b/mysql-test/suite/maria/insert_select.result @@ -0,0 +1,17 @@ +drop table if exists t1; +Warnings: +Note 1051 Unknown table 'test.t1' +# +# MDEV-7314 +# Concurrent "INSERT INTO table SELECT MAX(id)+1 FROM table" are +# hitting deadlocks on Aria tables using ROW_FORMAT=PAGE +# +create table t1 (pk int primary key) engine=Aria; +insert into t1 values (1); +insert into t1 select sleep(2)+1 from t1; +insert into t1 select 2 from t1; +select * from t1; +pk +1 +2 +drop table t1; diff --git a/mysql-test/suite/maria/insert_select.test b/mysql-test/suite/maria/insert_select.test new file mode 100644 index 00000000000..f5869edd4ce --- /dev/null +++ b/mysql-test/suite/maria/insert_select.test @@ -0,0 +1,27 @@ +-- source include/have_maria.inc +--source include/have_binlog_format_statement.inc + +drop table if exists t1; + +--echo # +--echo # MDEV-7314 +--echo # Concurrent "INSERT INTO table SELECT MAX(id)+1 FROM table" are +--echo # hitting deadlocks on Aria tables using ROW_FORMAT=PAGE +--echo # + +create table t1 (pk int primary key) engine=Aria; +insert into t1 values (1); + +send insert into t1 select sleep(2)+1 from t1; + +--connect (con1,localhost,root,,) + +--error 0,1062 +insert into t1 select 2 from t1; + +--connection default +--error 0,1062 +--reap + +select * from t1; +drop table t1; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 60e01974320..20af094f711 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -833,7 +833,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, ulong lock_wait_timeout) if (((lock_type == TL_WRITE_ALLOW_WRITE || (lock_type == TL_WRITE_CONCURRENT_INSERT && - lock->allow_multiple_concurrent_insert)) && + lock->allow_multiple_concurrent_insert && + !lock->read_no_write_count)) && ! lock->write_wait.data && lock->write.data->type == lock_type) || has_old_lock(lock->write.data, data->owner)) From 06ae6c6dfe6e1e3225815ab0de070db3475eefa1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 00:11:05 +0100 Subject: [PATCH 172/201] 5.6.22 --- btr/btr0cur.cc | 65 ++-- buf/buf0buf.cc | 7 +- buf/buf0flu.cc | 34 +- dict/dict0dict.cc | 29 +- fil/fil0fil.cc | 26 +- fts/fts0fts.cc | 672 +++++++++++++++++++++++++++++---------- fts/fts0opt.cc | 18 +- handler/ha_innodb.cc | 54 +++- handler/handler0alter.cc | 9 +- ibuf/ibuf0ibuf.cc | 4 +- include/btr0cur.ic | 4 +- include/dict0dict.h | 2 +- include/fil0fil.h | 4 +- include/fts0priv.ic | 26 +- lock/lock0lock.cc | 27 +- log/log0log.cc | 6 +- os/os0thread.cc | 3 + page/page0zip.cc | 13 +- row/row0mysql.cc | 8 +- sync/sync0rw.cc | 1 + 20 files changed, 754 insertions(+), 258 deletions(-) diff --git a/btr/btr0cur.cc b/btr/btr0cur.cc index 768d8f61367..a68f1290fe4 100644 --- a/btr/btr0cur.cc +++ b/btr/btr0cur.cc @@ -2363,6 +2363,38 @@ btr_cur_pess_upd_restore_supremum( page_rec_get_heap_no(rec)); } +/*************************************************************//** +Check if the total length of the modified blob for the row is within 10% +of the total redo log size. This constraint on the blob length is to +avoid overwriting the redo logs beyond the last checkpoint lsn. +@return DB_SUCCESS or DB_TOO_BIG_RECORD. */ +static +dberr_t +btr_check_blob_limit(const big_rec_t* big_rec_vec) +{ + const ib_uint64_t redo_size = srv_n_log_files * srv_log_file_size + * UNIV_PAGE_SIZE; + const ulint redo_10p = redo_size / 10; + ulint total_blob_len = 0; + dberr_t err = DB_SUCCESS; + + /* Calculate the total number of bytes for blob data */ + for (ulint i = 0; i < big_rec_vec->n_fields; i++) { + total_blob_len += big_rec_vec->fields[i].len; + } + + if (total_blob_len > redo_10p) { + ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data" + " length (" ULINTPF ") is greater than" + " 10%% of the total redo log size (" UINT64PF + "). Please increase total redo log size.", + total_blob_len, redo_size); + err = DB_TOO_BIG_RECORD; + } + + return(err); +} + /*************************************************************//** Performs an update of a record on a page of a tree. It is assumed that mtr holds an x-latch on the tree and on the cursor page. If the @@ -2578,26 +2610,14 @@ make_external: } if (big_rec_vec) { - const ulint redo_10p = srv_log_file_size * UNIV_PAGE_SIZE / 10; - ulint total_blob_len = 0; - /* Calculate the total number of bytes for blob data */ - for (ulint i = 0; i < big_rec_vec->n_fields; i++) { - total_blob_len += big_rec_vec->fields[i].len; - } + err = btr_check_blob_limit(big_rec_vec); - if (total_blob_len > redo_10p) { - ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data" - " length (" ULINTPF ") is greater than" - " 10%% of the redo log file size (" UINT64PF - "). Please increase innodb_log_file_size.", - total_blob_len, srv_log_file_size); + if (err != DB_SUCCESS) { if (n_reserved > 0) { fil_space_release_free_extents( index->space, n_reserved); } - - err = DB_TOO_BIG_RECORD; goto err_exit; } } @@ -4423,7 +4443,6 @@ btr_store_big_rec_extern_fields( buf_block_t** freed_pages = NULL; ulint n_freed_pages = 0; dberr_t error = DB_SUCCESS; - ulint total_blob_len = 0; ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_any_extern(offsets)); @@ -4443,21 +4462,11 @@ btr_store_big_rec_extern_fields( rec_page_no = buf_block_get_page_no(rec_block); ut_a(fil_page_get_type(page_align(rec)) == FIL_PAGE_INDEX); - const ulint redo_10p = (srv_log_file_size * UNIV_PAGE_SIZE / 10); + error = btr_check_blob_limit(big_rec_vec); - /* Calculate the total number of bytes for blob data */ - for (ulint i = 0; i < big_rec_vec->n_fields; i++) { - total_blob_len += big_rec_vec->fields[i].len; - } - - if (total_blob_len > redo_10p) { + if (error != DB_SUCCESS) { ut_ad(op == BTR_STORE_INSERT); - ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data length" - " (" ULINTPF ") is greater than 10%% of the" - " redo log file size (" UINT64PF "). Please" - " increase innodb_log_file_size.", - total_blob_len, srv_log_file_size); - return(DB_TOO_BIG_RECORD); + return(error); } if (page_zip) { diff --git a/buf/buf0buf.cc b/buf/buf0buf.cc index 11d2f3b193a..a676d70a992 100644 --- a/buf/buf0buf.cc +++ b/buf/buf0buf.cc @@ -564,9 +564,14 @@ buf_page_is_corrupted( checksum_field2 = mach_read_from_4( read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM); +#if FIL_PAGE_LSN % 8 +#error "FIL_PAGE_LSN must be 64 bit aligned" +#endif + /* declare empty pages non-corrupted */ if (checksum_field1 == 0 && checksum_field2 == 0 - && mach_read_from_4(read_buf + FIL_PAGE_LSN) == 0) { + && *reinterpret_cast(read_buf + + FIL_PAGE_LSN) == 0) { /* make sure that the page is really empty */ for (ulint i = 0; i < UNIV_PAGE_SIZE; i++) { if (read_buf[i] != 0) { diff --git a/buf/buf0flu.cc b/buf/buf0flu.cc index fa2edb90b8e..f3437c202f6 100644 --- a/buf/buf0flu.cc +++ b/buf/buf0flu.cc @@ -828,39 +828,35 @@ buf_flush_init_for_writing( case SRV_CHECKSUM_ALGORITHM_CRC32: case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: checksum = buf_calc_page_crc32(page); + mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); break; case SRV_CHECKSUM_ALGORITHM_INNODB: case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: checksum = (ib_uint32_t) buf_calc_page_new_checksum(page); + mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); + checksum = (ib_uint32_t) buf_calc_page_old_checksum(page); break; case SRV_CHECKSUM_ALGORITHM_NONE: case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: checksum = BUF_NO_CHECKSUM_MAGIC; + mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); break; /* no default so the compiler will emit a warning if new enum is added and not handled here */ } - mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); + /* With the InnoDB checksum, we overwrite the first 4 bytes of + the end lsn field to store the old formula checksum. Since it + depends also on the field FIL_PAGE_SPACE_OR_CHKSUM, it has to + be calculated after storing the new formula checksum. - /* We overwrite the first 4 bytes of the end lsn field to store - the old formula checksum. Since it depends also on the field - FIL_PAGE_SPACE_OR_CHKSUM, it has to be calculated after storing the - new formula checksum. */ - - if (srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB - || srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) { - - checksum = (ib_uint32_t) buf_calc_page_old_checksum(page); - - /* In other cases we use the value assigned from above. - If CRC32 is used then it is faster to use that checksum - (calculated above) instead of calculating another one. - We can afford to store something other than - buf_calc_page_old_checksum() or BUF_NO_CHECKSUM_MAGIC in - this field because the file will not be readable by old - versions of MySQL/InnoDB anyway (older than MySQL 5.6.3) */ - } + In other cases we write the same value to both fields. + If CRC32 is used then it is faster to use that checksum + (calculated above) instead of calculating another one. + We can afford to store something other than + buf_calc_page_old_checksum() or BUF_NO_CHECKSUM_MAGIC in + this field because the file will not be readable by old + versions of MySQL/InnoDB anyway (older than MySQL 5.6.3) */ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, checksum); diff --git a/dict/dict0dict.cc b/dict/dict0dict.cc index 6acd6b6526b..8c5b9c4b230 100644 --- a/dict/dict0dict.cc +++ b/dict/dict0dict.cc @@ -39,6 +39,16 @@ UNIV_INTERN dict_index_t* dict_ind_redundant; /** dummy index for ROW_FORMAT=COMPACT supremum and infimum records */ UNIV_INTERN dict_index_t* dict_ind_compact; +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG +/** Flag to control insert buffer debugging. */ +extern UNIV_INTERN uint ibuf_debug; +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + +/********************************************************************** +Issue a warning that the row is too big. */ +void +ib_warn_row_too_big(const dict_table_t* table); + #ifndef UNIV_HOTBACKUP #include "buf0buf.h" #include "data0type.h" @@ -2406,11 +2416,18 @@ dict_index_add_to_cache( new_index->n_fields = new_index->n_def; new_index->trx_id = index->trx_id; - if (strict && dict_index_too_big_for_tree(table, new_index)) { + if (dict_index_too_big_for_tree(table, new_index)) { + + if (strict) { too_big: - dict_mem_index_free(new_index); - dict_mem_index_free(index); - return(DB_TOO_BIG_RECORD); + dict_mem_index_free(new_index); + dict_mem_index_free(index); + return(DB_TOO_BIG_RECORD); + } else { + + ib_warn_row_too_big(table); + + } } if (dict_index_is_univ(index)) { @@ -5679,11 +5696,11 @@ dict_set_corrupted( dict_index_copy_types(tuple, sys_index, 2); - btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE, + btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE, BTR_MODIFY_LEAF, &cursor, 0, __FILE__, __LINE__, &mtr); - if (cursor.up_match == dtuple_get_n_fields(tuple)) { + if (cursor.low_match == dtuple_get_n_fields(tuple)) { /* UPDATE SYS_INDEXES SET TYPE=index->type WHERE TABLE_ID=index->table->id AND INDEX_ID=index->id */ ulint len; diff --git a/fil/fil0fil.cc b/fil/fil0fil.cc index 55e54cb9568..9755ef2ee68 100644 --- a/fil/fil0fil.cc +++ b/fil/fil0fil.cc @@ -2112,7 +2112,8 @@ UNIV_INTERN ibool fil_inc_pending_ops( /*================*/ - ulint id) /*!< in: space id */ + ulint id, /*!< in: space id */ + ibool print_err) /*!< in: need to print error or not */ { fil_space_t* space; @@ -2121,10 +2122,12 @@ fil_inc_pending_ops( space = fil_space_get_by_id(id); if (space == NULL) { - fprintf(stderr, - "InnoDB: Error: trying to do an operation on a" - " dropped tablespace %lu\n", - (ulong) id); + if (print_err) { + fprintf(stderr, + "InnoDB: Error: trying to do an operation on a" + " dropped tablespace %lu\n", + (ulong) id); + } } if (space == NULL || space->stop_new_ops) { @@ -4280,7 +4283,18 @@ fil_load_single_table_tablespace( /* Build up the tablename in the standard form database/table. */ tablename = static_cast( mem_alloc(dbname_len + filename_len + 2)); - sprintf(tablename, "%s/%s", dbname, filename); + + /* When lower_case_table_names = 2 it is possible that the + dbname is in upper case ,but while storing it in fil_space_t + we must convert it into lower case */ + sprintf(tablename, "%s" , dbname); + tablename[dbname_len] = '\0'; + + if (lower_case_file_system) { + dict_casedn_str(tablename); + } + + sprintf(tablename+dbname_len,"/%s",filename); tablename_len = strlen(tablename) - strlen(".ibd"); tablename[tablename_len] = '\0'; diff --git a/fts/fts0fts.cc b/fts/fts0fts.cc index abb5515e7fd..ef940ca78aa 100644 --- a/fts/fts0fts.cc +++ b/fts/fts0fts.cc @@ -36,6 +36,7 @@ Full Text Search interface #include "dict0priv.h" #include "dict0stats.h" #include "btr0pcur.h" +#include #include "ha_prototypes.h" @@ -899,12 +900,14 @@ fts_drop_index( index_cache = fts_find_index_cache(cache, index); - if (index_cache->words) { - fts_words_free(index_cache->words); - rbt_free(index_cache->words); - } + if (index_cache != NULL) { + if (index_cache->words) { + fts_words_free(index_cache->words); + rbt_free(index_cache->words); + } - ib_vector_remove(cache->indexes, *(void**) index_cache); + ib_vector_remove(cache->indexes, *(void**) index_cache); + } if (cache->get_docs) { fts_reset_get_doc(cache); @@ -1255,7 +1258,8 @@ fts_tokenizer_word_get( #endif /* If it is a stopword, do not index it */ - if (rbt_search(cache->stopword_info.cached_stopword, + if (cache->stopword_info.cached_stopword != NULL + && rbt_search(cache->stopword_info.cached_stopword, &parent, text) == 0) { return(NULL); @@ -3557,6 +3561,12 @@ fts_add_doc_by_id( rw_lock_x_lock(&table->fts->cache->lock); + if (table->fts->cache->stopword_info.status + & STOPWORD_NOT_INIT) { + fts_load_stopword(table, NULL, NULL, + NULL, TRUE, TRUE); + } + fts_cache_add_doc( table->fts->cache, get_doc->index_cache, @@ -6071,8 +6081,6 @@ fts_update_hex_format_flag( return (err); } -#ifdef _WIN32 - /*********************************************************************//** Rename an aux table to HEX format. It's called when "%016llu" is used to format an object id in table name, which only happens in Windows. */ @@ -6169,8 +6177,8 @@ This function should make sure that either all the parent table and aux tables are set DICT_TF2_FTS_AUX_HEX_NAME with flags2 or none of them are set */ static __attribute__((nonnull, warn_unused_result)) dberr_t -fts_rename_aux_tables_to_hex_format( -/*================================*/ +fts_rename_aux_tables_to_hex_format_low( +/*====================================*/ trx_t* trx, /*!< in: transaction */ dict_table_t* parent_table, /*!< in: parent table */ ib_vector_t* tables) /*!< in: aux tables to rename. */ @@ -6294,12 +6302,14 @@ fts_rename_aux_tables_to_hex_format( "table %s. Please revert manually.", table->name); fts_sql_rollback(trx_bg); + trx_free_for_background(trx_bg); /* Continue to clear aux tables' flags2 */ not_rename = true; continue; } fts_sql_commit(trx_bg); + trx_free_for_background(trx_bg); } DICT_TF2_FLAG_UNSET(parent_table, DICT_TF2_FTS_AUX_HEX_NAME); @@ -6323,7 +6333,11 @@ fts_fake_hex_to_dec( ret = sprintf(tmp_id, UINT64PFx, id); ut_ad(ret == 16); +#ifdef _WIN32 ret = sscanf(tmp_id, "%016llu", &dec_id); +#else + ret = sscanf(tmp_id, "%016"PRIu64, &dec_id); +#endif /* _WIN32 */ ut_ad(ret == 1); return dec_id; @@ -6345,7 +6359,293 @@ fts_check_aux_table_parent_id_cmp( return static_cast(fa1->parent_id - fa2->parent_id); } -#endif /* _WIN32 */ +/** Mark all the fts index associated with the parent table as corrupted. +@param[in] trx transaction +@param[in, out] parent_table fts index associated with this parent table + will be marked as corrupted. */ +static +void +fts_parent_all_index_set_corrupt( + trx_t* trx, + dict_table_t* parent_table) +{ + fts_t* fts = parent_table->fts; + + if (trx_get_dict_operation(trx) == TRX_DICT_OP_NONE) { + trx_set_dict_operation(trx, TRX_DICT_OP_INDEX); + } + + for (ulint j = 0; j < ib_vector_size(fts->indexes); j++) { + dict_index_t* index = static_cast( + ib_vector_getp_const(fts->indexes, j)); + dict_set_corrupted(index, + trx, "DROP ORPHANED TABLE"); + } +} + +/** Mark the fts index which index id matches the id as corrupted. +@param[in] trx transaction +@param[in] id index id to search +@param[in, out] parent_table parent table to check with all + the index. */ +static +void +fts_set_index_corrupt( + trx_t* trx, + index_id_t id, + dict_table_t* table) +{ + fts_t* fts = table->fts; + + if (trx_get_dict_operation(trx) == TRX_DICT_OP_NONE) { + trx_set_dict_operation(trx, TRX_DICT_OP_INDEX); + } + + for (ulint j = 0; j < ib_vector_size(fts->indexes); j++) { + dict_index_t* index = static_cast( + ib_vector_getp_const(fts->indexes, j)); + if (index->id == id) { + dict_set_corrupted(index, trx, + "DROP ORPHANED TABLE"); + break; + } + } +} + +/** Check the index for the aux table is corrupted. +@param[in] aux_table auxiliary table +@retval nonzero if index is corrupted, zero for valid index */ +static +ulint +fts_check_corrupt_index( + fts_aux_table_t* aux_table) +{ + dict_table_t* table; + dict_index_t* index; + table = dict_table_open_on_id( + aux_table->parent_id, TRUE, DICT_TABLE_OP_NORMAL); + + if (table == NULL) { + return(0); + } + + for (index = UT_LIST_GET_FIRST(table->indexes); + index; + index = UT_LIST_GET_NEXT(indexes, index)) { + if (index->id == aux_table->index_id) { + ut_ad(index->type & DICT_FTS); + dict_table_close(table, true, false); + return(dict_index_is_corrupted(index)); + } + } + + dict_table_close(table, true, false); + return(0); +} + +/** Check the validity of the parent table. +@param[in] aux_table auxiliary table +@return true if it is a valid table or false if it is not */ +static +bool +fts_valid_parent_table( + const fts_aux_table_t* aux_table) +{ + dict_table_t* parent_table; + bool valid = false; + + parent_table = dict_table_open_on_id( + aux_table->parent_id, TRUE, DICT_TABLE_OP_NORMAL); + + if (parent_table != NULL && parent_table->fts != NULL) { + if (aux_table->index_id == 0) { + valid = true; + } else { + index_id_t id = aux_table->index_id; + dict_index_t* index; + + /* Search for the FT index in the table's list. */ + for (index = UT_LIST_GET_FIRST(parent_table->indexes); + index; + index = UT_LIST_GET_NEXT(indexes, index)) { + if (index->id == id) { + valid = true; + break; + } + + } + } + } + + if (parent_table) { + dict_table_close(parent_table, TRUE, FALSE); + } + + return(valid); +} + +/** Try to rename all aux tables of the specified parent table. +@param[in] aux_tables aux_tables to be renamed +@param[in] parent_table parent table of all aux + tables stored in tables. */ +static +void +fts_rename_aux_tables_to_hex_format( + ib_vector_t* aux_tables, + dict_table_t* parent_table) +{ + dberr_t err; + trx_t* trx_rename = trx_allocate_for_background(); + trx_rename->op_info = "Rename aux tables to hex format"; + trx_rename->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_rename, TRX_DICT_OP_TABLE); + + err = fts_rename_aux_tables_to_hex_format_low(trx_rename, + parent_table, aux_tables); + + trx_rename->dict_operation_lock_mode = 0; + + if (err != DB_SUCCESS) { + + ib_logf(IB_LOG_LEVEL_WARN, + "Rollback operations on all aux tables of table %s. " + "All the fts index associated with the table are " + "marked as corrupted. Please rebuild the " + "index again.", parent_table->name); + fts_sql_rollback(trx_rename); + + /* Corrupting the fts index related to parent table. */ + trx_t* trx_corrupt; + trx_corrupt = trx_allocate_for_background(); + trx_corrupt->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_corrupt, TRX_DICT_OP_TABLE); + fts_parent_all_index_set_corrupt(trx_corrupt, parent_table); + trx_corrupt->dict_operation_lock_mode = 0; + fts_sql_commit(trx_corrupt); + trx_free_for_background(trx_corrupt); + } else { + fts_sql_commit(trx_rename); + } + + trx_free_for_background(trx_rename); + ib_vector_reset(aux_tables); +} + +/** Set the hex format flag for the parent table. +@param[in, out] parent_table parent table +@param[in] trx transaction */ +static +void +fts_set_parent_hex_format_flag( + dict_table_t* parent_table, + trx_t* trx) +{ + if (!DICT_TF2_FLAG_IS_SET(parent_table, + DICT_TF2_FTS_AUX_HEX_NAME)) { + DBUG_EXECUTE_IF("parent_table_flag_fail", + ib_logf(IB_LOG_LEVEL_FATAL, + "Setting parent table %s to hex format " + "failed. Please try to restart the server " + "again, if it doesn't work, the system " + "tables might be corrupted.", + parent_table->name); + return;); + + dberr_t err = fts_update_hex_format_flag( + trx, parent_table->id, true); + + if (err != DB_SUCCESS) { + ib_logf(IB_LOG_LEVEL_FATAL, + "Setting parent table %s to hex format " + "failed. Please try to restart the server " + "again, if it doesn't work, the system " + "tables might be corrupted.", + parent_table->name); + } else { + DICT_TF2_FLAG_SET( + parent_table, DICT_TF2_FTS_AUX_HEX_NAME); + } + } +} + +/** Drop the obsolete auxilary table. +@param[in] tables tables to be dropped. */ +static +void +fts_drop_obsolete_aux_table_from_vector( + ib_vector_t* tables) +{ + dberr_t err; + + for (ulint count = 0; count < ib_vector_size(tables); + ++count) { + + fts_aux_table_t* aux_drop_table; + aux_drop_table = static_cast( + ib_vector_get(tables, count)); + trx_t* trx_drop = trx_allocate_for_background(); + trx_drop->op_info = "Drop obsolete aux tables"; + trx_drop->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_drop, TRX_DICT_OP_TABLE); + + err = row_drop_table_for_mysql( + aux_drop_table->name, trx_drop, false, true); + + trx_drop->dict_operation_lock_mode = 0; + + if (err != DB_SUCCESS) { + /* We don't need to worry about the + failure, since server would try to + drop it on next restart, even if + the table was broken. */ + ib_logf(IB_LOG_LEVEL_WARN, + "Fail to drop obsolete aux table '%s', which " + "is harmless. will try to drop it on next " + "restart.", aux_drop_table->name); + fts_sql_rollback(trx_drop); + } else { + ib_logf(IB_LOG_LEVEL_INFO, + "Dropped obsolete aux table '%s'.", + aux_drop_table->name); + + fts_sql_commit(trx_drop); + } + + trx_free_for_background(trx_drop); + } +} + +/** Drop all the auxiliary table present in the vector. +@param[in] trx transaction +@param[in] tables tables to be dropped */ +static +void +fts_drop_aux_table_from_vector( + trx_t* trx, + ib_vector_t* tables) +{ + for (ulint count = 0; count < ib_vector_size(tables); + ++count) { + fts_aux_table_t* aux_drop_table; + aux_drop_table = static_cast( + ib_vector_get(tables, count)); + + /* Check for the validity of the parent table */ + if (!fts_valid_parent_table(aux_drop_table)) { + ib_logf(IB_LOG_LEVEL_WARN, + "Parent table of FTS auxiliary table %s not " + "found.", aux_drop_table->name); + dberr_t err = fts_drop_table(trx, aux_drop_table->name); + if (err == DB_FAIL) { + char* path = fil_make_ibd_name( + aux_drop_table->name, false); + os_file_delete_if_exists(innodb_file_data_key, + path); + mem_free(path); + } + } + } +} /**********************************************************************//** Check and drop all orphaned FTS auxiliary tables, those that don't have @@ -6358,9 +6658,12 @@ fts_check_and_drop_orphaned_tables( trx_t* trx, /*!< in: transaction */ ib_vector_t* tables) /*!< in: tables to check */ { -#ifdef _WIN32 mem_heap_t* heap; ib_vector_t* aux_tables_to_rename; + ib_vector_t* invalid_aux_tables; + ib_vector_t* valid_aux_tables; + ib_vector_t* drop_aux_tables; + ib_vector_t* obsolete_aux_tables; ib_alloc_t* heap_alloc; heap = mem_heap_create(1024); @@ -6371,38 +6674,99 @@ fts_check_and_drop_orphaned_tables( aux_tables_to_rename = ib_vector_create(heap_alloc, sizeof(fts_aux_table_t), 128); + /* We store all fake auxiliary table and orphaned table here. */ + invalid_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + + /* We store all valid aux tables. We use this to filter the + fake auxiliary table from invalid auxiliary tables. */ + valid_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + + /* We store all auxiliary tables to be dropped. */ + drop_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + + /* We store all obsolete auxiliary tables to be dropped. */ + obsolete_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + /* Sort by parent_id first, in case rename will fail */ ib_vector_sort(tables, fts_check_aux_table_parent_id_cmp); -#endif /* _WIN32 */ for (ulint i = 0; i < ib_vector_size(tables); ++i) { dict_table_t* parent_table; fts_aux_table_t* aux_table; bool drop = false; -#ifdef _WIN32 dict_table_t* table; fts_aux_table_t* next_aux_table = NULL; ib_id_t orig_parent_id = 0; + ib_id_t orig_index_id = 0; bool rename = false; -#endif /* _WIN32 */ aux_table = static_cast( ib_vector_get(tables, i)); -#ifdef _WIN32 table = dict_table_open_on_id( aux_table->id, TRUE, DICT_TABLE_OP_NORMAL); orig_parent_id = aux_table->parent_id; + orig_index_id = aux_table->index_id; if (table == NULL || strcmp(table->name, aux_table->name)) { - /* Skip these aux tables, which are common tables - with wrong table ids */ - if (table) { + + bool fake_aux = false; + + if (table != NULL) { dict_table_close(table, TRUE, FALSE); } - continue; + if (i + 1 < ib_vector_size(tables)) { + next_aux_table = static_cast( + ib_vector_get(tables, i + 1)); + } + /* To know whether aux table is fake fts or + orphan fts table. */ + for (ulint count = 0; + count < ib_vector_size(valid_aux_tables); + count++) { + fts_aux_table_t* valid_aux; + valid_aux = static_cast( + ib_vector_get(valid_aux_tables, count)); + if (strcmp(valid_aux->name, + aux_table->name) == 0) { + fake_aux = true; + break; + } + } + + /* All aux tables of parent table, whose id is + last_parent_id, have been checked, try to rename + them if necessary. */ + if ((next_aux_table == NULL + || orig_parent_id != next_aux_table->parent_id) + && (!ib_vector_is_empty(aux_tables_to_rename))) { + + ulint parent_id = fts_fake_hex_to_dec( + aux_table->parent_id); + + parent_table = dict_table_open_on_id( + parent_id, TRUE, + DICT_TABLE_OP_NORMAL); + + fts_rename_aux_tables_to_hex_format( + aux_tables_to_rename, parent_table); + + dict_table_close(parent_table, TRUE, + FALSE); + } + + /* If the aux table is fake aux table. Skip it. */ + if (!fake_aux) { + ib_vector_push(invalid_aux_tables, aux_table); + } + + continue; } else if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_AUX_HEX_NAME)) { @@ -6415,65 +6779,99 @@ fts_check_and_drop_orphaned_tables( } ut_ad(aux_table->id > aux_table->parent_id); - rename = true; + + /* Check whether parent table id and index id + are stored as decimal format. */ + if (fts_valid_parent_table(aux_table)) { + + parent_table = dict_table_open_on_id( + aux_table->parent_id, true, + DICT_TABLE_OP_NORMAL); + + ut_ad(parent_table != NULL); + ut_ad(parent_table->fts != NULL); + + if (!DICT_TF2_FLAG_IS_SET( + parent_table, + DICT_TF2_FTS_AUX_HEX_NAME)) { + rename = true; + } + + dict_table_close(parent_table, TRUE, FALSE); + } + + if (!rename) { + /* Reassign the original value of + aux table if it is not in decimal format */ + aux_table->parent_id = orig_parent_id; + aux_table->index_id = orig_index_id; + } } - if (table) { - dict_table_close(table, TRUE, FALSE); + if (table != NULL) { + dict_table_close(table, true, false); + } + + if (!rename) { + /* Check the validity of the parent table. */ + if (!fts_valid_parent_table(aux_table)) { + drop = true; + } + } + + /* Filter out the fake aux table by comparing with the + current valid auxiliary table name . */ + for (ulint count = 0; + count < ib_vector_size(invalid_aux_tables); count++) { + fts_aux_table_t* invalid_aux; + invalid_aux = static_cast( + ib_vector_get(invalid_aux_tables, count)); + if (strcmp(invalid_aux->name, aux_table->name) == 0) { + ib_vector_remove( + invalid_aux_tables, + *reinterpret_cast(invalid_aux)); + break; + } + } + + ib_vector_push(valid_aux_tables, aux_table); + + /* If the index associated with aux table is corrupted, + skip it. */ + if (fts_check_corrupt_index(aux_table) > 0) { + + if (i + 1 < ib_vector_size(tables)) { + next_aux_table = static_cast( + ib_vector_get(tables, i + 1)); + } + + if (next_aux_table == NULL + || orig_parent_id != next_aux_table->parent_id) { + + parent_table = dict_table_open_on_id( + aux_table->parent_id, TRUE, + DICT_TABLE_OP_NORMAL); + + if (!ib_vector_is_empty(aux_tables_to_rename)) { + fts_rename_aux_tables_to_hex_format( + aux_tables_to_rename, parent_table); + + } else { + fts_set_parent_hex_format_flag( + parent_table, trx); + } + + dict_table_close(parent_table, TRUE, FALSE); + } + + continue; } -#endif /* _WIN32 */ parent_table = dict_table_open_on_id( aux_table->parent_id, TRUE, DICT_TABLE_OP_NORMAL); - if (parent_table == NULL || parent_table->fts == NULL) { - - drop = true; - - } else if (aux_table->index_id != 0) { - index_id_t id; - fts_t* fts; - - drop = true; - fts = parent_table->fts; - id = aux_table->index_id; - - /* Search for the FT index in the table's list. */ - for (ulint j = 0; - j < ib_vector_size(fts->indexes); - ++j) { - - const dict_index_t* index; - - index = static_cast( - ib_vector_getp_const(fts->indexes, j)); - - if (index->id == id) { - drop = false; - break; - } - } - } - if (drop) { - - ib_logf(IB_LOG_LEVEL_WARN, - "Parent table of FTS auxiliary table %s not " - "found.", aux_table->name); - - dberr_t err = fts_drop_table(trx, aux_table->name); - - if (err == DB_FAIL) { - char* path; - - path = fil_make_ibd_name( - aux_table->name, false); - - os_file_delete_if_exists(innodb_file_data_key, - path); - - mem_free(path); - } + ib_vector_push(drop_aux_tables, aux_table); } else { if (FTS_IS_OBSOLETE_AUX_TABLE(aux_table->name)) { @@ -6483,49 +6881,13 @@ fts_check_and_drop_orphaned_tables( This could happen when we try to upgrade from older server to later one, which doesn't contain these obsolete tables. */ - drop = true; - - dberr_t err; - trx_t* trx_drop = - trx_allocate_for_background(); - - trx_drop->op_info = "Drop obsolete aux tables"; - trx_drop->dict_operation_lock_mode = RW_X_LATCH; - - trx_start_for_ddl(trx_drop, TRX_DICT_OP_TABLE); - - err = row_drop_table_for_mysql( - aux_table->name, trx_drop, false, true); - - trx_drop->dict_operation_lock_mode = 0; - - if (err != DB_SUCCESS) { - /* We don't need to worry about the - failure, since server would try to - drop it on next restart, even if - the table was broken. */ - - ib_logf(IB_LOG_LEVEL_WARN, - "Fail to drop obsolete aux" - " table '%s', which is" - " harmless. will try to drop" - " it on next restart.", - aux_table->name); - - fts_sql_rollback(trx_drop); - } else { - ib_logf(IB_LOG_LEVEL_INFO, - "Dropped obsolete aux" - " table '%s'.", - aux_table->name); - - fts_sql_commit(trx_drop); - } - - trx_free_for_background(trx_drop); + ib_vector_push(obsolete_aux_tables, aux_table); + continue; } } -#ifdef _WIN32 + + /* If the aux table is in decimal format, we should + rename it, so push it to aux_tables_to_rename */ if (!drop && rename) { ib_vector_push(aux_tables_to_rename, aux_table); } @@ -6543,38 +6905,16 @@ fts_check_and_drop_orphaned_tables( them if necessary. We had better use a new background trx to rename rather than the original trx, in case any failure would cause a complete rollback. */ - dberr_t err; - trx_t* trx_rename = trx_allocate_for_background(); - trx_rename->op_info = "Rename aux tables to " - "hex format"; - trx_rename->dict_operation_lock_mode = RW_X_LATCH; - trx_start_for_ddl(trx_rename, TRX_DICT_OP_TABLE); + ut_ad(rename); + ut_ad(!DICT_TF2_FLAG_IS_SET( + parent_table, DICT_TF2_FTS_AUX_HEX_NAME)); - err = fts_rename_aux_tables_to_hex_format(trx_rename, - parent_table, aux_tables_to_rename); - - trx_rename->dict_operation_lock_mode = 0; - - if (err != DB_SUCCESS) { - ib_logf(IB_LOG_LEVEL_WARN, - "Rollback operations on all " - "aux tables of table %s. " - "Please check why renaming aux tables " - "failed, and restart the server to " - "upgrade again to " - "get the table work.", - parent_table->name); - - fts_sql_rollback(trx_rename); - } else { - fts_sql_commit(trx_rename); - } - - trx_free_for_background(trx_rename); - ib_vector_reset(aux_tables_to_rename); + fts_rename_aux_tables_to_hex_format( + aux_tables_to_rename,parent_table); } -#else /* _WIN32 */ - if (!drop) { + + /* The IDs are already in correct hex format. */ + if (!drop && !rename) { dict_table_t* table; table = dict_table_open_on_id( @@ -6589,6 +6929,16 @@ fts_check_and_drop_orphaned_tables( && !DICT_TF2_FLAG_IS_SET( table, DICT_TF2_FTS_AUX_HEX_NAME)) { + + DBUG_EXECUTE_IF("aux_table_flag_fail", + ib_logf(IB_LOG_LEVEL_WARN, + "Setting aux table %s to hex " + "format failed.", table->name); + fts_set_index_corrupt( + trx, aux_table->index_id, + parent_table); + goto table_exit;); + dberr_t err = fts_update_hex_format_flag( trx, table->id, true); @@ -6596,49 +6946,44 @@ fts_check_and_drop_orphaned_tables( ib_logf(IB_LOG_LEVEL_WARN, "Setting aux table %s to hex " "format failed.", table->name); + + fts_set_index_corrupt( + trx, aux_table->index_id, + parent_table); } else { DICT_TF2_FLAG_SET(table, DICT_TF2_FTS_AUX_HEX_NAME); } } +#ifndef DBUG_OFF +table_exit: +#endif /* !DBUG_OFF */ if (table != NULL) { dict_table_close(table, TRUE, FALSE); } ut_ad(parent_table != NULL); - if (!DICT_TF2_FLAG_IS_SET(parent_table, - DICT_TF2_FTS_AUX_HEX_NAME)) { - dberr_t err = fts_update_hex_format_flag( - trx, parent_table->id, true); - if (err != DB_SUCCESS) { - ib_logf(IB_LOG_LEVEL_WARN, - "Setting parent table %s of " - "FTS auxiliary %s to hex " - "format failed.", - parent_table->name, - aux_table->name); - } else { - DICT_TF2_FLAG_SET(parent_table, - DICT_TF2_FTS_AUX_HEX_NAME); - } - } + fts_set_parent_hex_format_flag( + parent_table, trx); } -#endif /* _WIN32 */ - - if (parent_table) { + if (parent_table != NULL) { dict_table_close(parent_table, TRUE, FALSE); } } -#ifdef _WIN32 + fts_drop_aux_table_from_vector(trx, invalid_aux_tables); + fts_drop_aux_table_from_vector(trx, drop_aux_tables); + fts_sql_commit(trx); + + fts_drop_obsolete_aux_table_from_vector(obsolete_aux_tables); + /* Free the memory allocated at the beginning */ if (heap != NULL) { mem_heap_free(heap); } -#endif /* _WIN32 */ } /**********************************************************************//** @@ -6737,7 +7082,6 @@ fts_drop_orphaned_tables(void) if (error == DB_SUCCESS) { fts_check_and_drop_orphaned_tables(trx, tables); - fts_sql_commit(trx); break; /* Exit the loop. */ } else { ib_vector_reset(tables); diff --git a/fts/fts0opt.cc b/fts/fts0opt.cc index 910a00cd521..2e2bd061d07 100644 --- a/fts/fts0opt.cc +++ b/fts/fts0opt.cc @@ -190,6 +190,8 @@ cycle for a table. */ struct fts_slot_t { dict_table_t* table; /*!< Table to optimize */ + table_id_t table_id; /*!< Table id */ + fts_state_t state; /*!< State of this slot */ ulint added; /*!< Number of doc ids added since the @@ -2575,6 +2577,8 @@ fts_optimize_add_table( return; } + ut_ad(table->cached && table->fts != NULL); + /* Make sure table with FTS index cannot be evicted */ if (table->can_be_evicted) { dict_table_move_from_lru_to_non_lru(table); @@ -2741,6 +2745,7 @@ fts_optimize_new_table( memset(slot, 0x0, sizeof(*slot)); slot->table = table; + slot->table_id = table->id; slot->state = FTS_STATE_LOADED; slot->interval_time = FTS_OPTIMIZE_INTERVAL_IN_SECS; @@ -2865,7 +2870,8 @@ fts_is_sync_needed( slot = static_cast( ib_vector_get_const(tables, i)); - if (slot->table && slot->table->fts) { + if (slot->state != FTS_STATE_EMPTY && slot->table + && slot->table->fts) { total_memory += slot->table->fts->cache->total_size; } @@ -2948,6 +2954,7 @@ fts_optimize_thread( ib_wqueue_t* wq = (ib_wqueue_t*) arg; ut_ad(!srv_read_only_mode); + my_thread_init(); heap = mem_heap_create(sizeof(dict_table_t*) * 64); heap_alloc = ib_heap_allocator_create(heap); @@ -3076,9 +3083,11 @@ fts_optimize_thread( if (slot->state != FTS_STATE_EMPTY) { dict_table_t* table = NULL; - table = dict_table_open_on_name( - slot->table->name, FALSE, FALSE, - DICT_ERR_IGNORE_INDEX_ROOT); + /*slot->table may be freed, so we try to open + table by slot->table_id.*/ + table = dict_table_open_on_id( + slot->table_id, FALSE, + DICT_TABLE_OP_NORMAL); if (table) { @@ -3101,6 +3110,7 @@ fts_optimize_thread( ib_logf(IB_LOG_LEVEL_INFO, "FTS optimize thread exiting."); os_event_set(exit_event); + 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/handler/ha_innodb.cc b/handler/ha_innodb.cc index d4e1d1595ae..32432a9956b 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -2828,7 +2828,8 @@ innobase_init( innobase_hton->flush_logs = innobase_flush_logs; innobase_hton->show_status = innobase_show_status; - innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS; + innobase_hton->flags = + HTON_SUPPORTS_EXTENDED_KEYS | HTON_SUPPORTS_FOREIGN_KEYS; innobase_hton->release_temporary_latches = innobase_release_temporary_latches; @@ -11971,6 +11972,7 @@ ha_innobase::start_stmt( thr_lock_type lock_type) { trx_t* trx; + DBUG_ENTER("ha_innobase::start_stmt"); update_thd(thd); @@ -11994,6 +11996,29 @@ ha_innobase::start_stmt( prebuilt->hint_need_to_fetch_extra_cols = 0; reset_template(); + if (dict_table_is_temporary(prebuilt->table) + && prebuilt->mysql_has_locked + && prebuilt->select_lock_type == LOCK_NONE) { + dberr_t error; + + switch (thd_sql_command(thd)) { + case SQLCOM_INSERT: + case SQLCOM_UPDATE: + case SQLCOM_DELETE: + init_table_handle_for_HANDLER(); + prebuilt->select_lock_type = LOCK_X; + prebuilt->stored_select_lock_type = LOCK_X; + error = row_lock_table_for_mysql(prebuilt, NULL, 1); + + if (error != DB_SUCCESS) { + int st = convert_error_code_to_mysql( + error, 0, thd); + DBUG_RETURN(st); + } + break; + } + } + if (!prebuilt->mysql_has_locked) { /* This handle is for a temporary table created inside this same LOCK TABLES; since MySQL does NOT call external_lock @@ -12031,7 +12056,7 @@ ha_innobase::start_stmt( ++trx->will_lock; } - return(0); + DBUG_RETURN(0); } /******************************************************************//** @@ -17117,3 +17142,28 @@ innobase_convert_to_system_charset( return(strconvert( cs1, from, cs2, to, static_cast(len), errors)); } + +/********************************************************************** +Issue a warning that the row is too big. */ +void +ib_warn_row_too_big(const dict_table_t* table) +{ + /* If prefix is true then a 768-byte prefix is stored + locally for BLOB fields. Refer to dict_table_get_format() */ + const bool prefix = (dict_tf_get_format(table->flags) + == UNIV_FORMAT_A); + + const ulint free_space = page_get_free_space_of_empty( + table->flags & DICT_TF_COMPACT) / 2; + + THD* thd = current_thd; + + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW, + "Row size too large (> %lu). Changing some columns to TEXT" + " or BLOB %smay help. In current row format, BLOB prefix of" + " %d bytes is stored inline.", free_space + , prefix ? "or using ROW_FORMAT=DYNAMIC or" + " ROW_FORMAT=COMPRESSED ": "" + , prefix ? DICT_MAX_FIXED_COL_LEN : 0); +} diff --git a/handler/handler0alter.cc b/handler/handler0alter.cc index bcc5961a240..19a7a37cef8 100644 --- a/handler/handler0alter.cc +++ b/handler/handler0alter.cc @@ -3295,9 +3295,7 @@ ha_innobase::prepare_inplace_alter_table( ulint fts_doc_col_no = ULINT_UNDEFINED; bool add_fts_doc_id = false; bool add_fts_doc_id_idx = false; -#ifdef _WIN32 bool add_fts_idx = false; -#endif /* _WIN32 */ DBUG_ENTER("prepare_inplace_alter_table"); DBUG_ASSERT(!ha_alter_info->handler_ctx); @@ -3442,9 +3440,7 @@ check_if_ok_to_rename: & ~(HA_FULLTEXT | HA_PACK_KEY | HA_BINARY_PACK_KEY))); -#ifdef _WIN32 add_fts_idx = true; -#endif /* _WIN32 */ continue; } @@ -3455,19 +3451,16 @@ check_if_ok_to_rename: } } -#ifdef _WIN32 /* We won't be allowed to add fts index to a table with fts indexes already but without AUX_HEX_NAME set. This means the aux tables of the table failed to rename to hex format but new created aux tables - shall be in hex format, which is contradictory. - It's only for Windows. */ + shall be in hex format, which is contradictory. */ if (!DICT_TF2_FLAG_IS_SET(indexed_table, DICT_TF2_FTS_AUX_HEX_NAME) && indexed_table->fts != NULL && add_fts_idx) { my_error(ER_INNODB_FT_AUX_NOT_HEX_ID, MYF(0)); goto err_exit_no_heap; } -#endif /* _WIN32 */ /* Check existing index definitions for too-long column prefixes as well, in case max_col_len shrunk. */ diff --git a/ibuf/ibuf0ibuf.cc b/ibuf/ibuf0ibuf.cc index 0bb898dbce5..2082c0d194b 100644 --- a/ibuf/ibuf0ibuf.cc +++ b/ibuf/ibuf0ibuf.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2014, 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 @@ -4614,7 +4614,7 @@ ibuf_merge_or_delete_for_page( function. When the counter is > 0, that prevents tablespace from being dropped. */ - tablespace_being_deleted = fil_inc_pending_ops(space); + tablespace_being_deleted = fil_inc_pending_ops(space, true); if (UNIV_UNLIKELY(tablespace_being_deleted)) { /* Do not try to read the bitmap page from space; diff --git a/include/btr0cur.ic b/include/btr0cur.ic index 080866c7465..43ee3304c0e 100644 --- a/include/btr0cur.ic +++ b/include/btr0cur.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2014, 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 @@ -28,7 +28,7 @@ Created 10/16/1994 Heikki Tuuri #ifdef UNIV_DEBUG # define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE)\ -if (btr_cur_limit_optimistic_insert_debug\ +if (btr_cur_limit_optimistic_insert_debug > 1\ && (NREC) >= (ulint)btr_cur_limit_optimistic_insert_debug) {\ CODE;\ } diff --git a/include/dict0dict.h b/include/dict0dict.h index 08c827a7248..dd61e5becc1 100644 --- a/include/dict0dict.h +++ b/include/dict0dict.h @@ -82,7 +82,7 @@ dict_get_referenced_table( mem_heap_t* heap); /*!< in: heap memory */ /*********************************************************************//** Frees a foreign key struct. */ -UNIV_INTERN + void dict_foreign_free( /*==============*/ diff --git a/include/fil0fil.h b/include/fil0fil.h index b607ca36d70..168f2f5b594 100644 --- a/include/fil0fil.h +++ b/include/fil0fil.h @@ -41,6 +41,7 @@ Created 10/25/1995 Heikki Tuuri #include +extern my_bool lower_case_file_system; // Forward declaration struct trx_t; struct fil_space_t; @@ -407,7 +408,8 @@ UNIV_INTERN ibool fil_inc_pending_ops( /*================*/ - ulint id); /*!< in: space id */ + ulint id, /*!< in: space id */ + ibool print_err); /*!< in: need to print error or not */ /*******************************************************************//** Decrements the count of pending operations. */ UNIV_INTERN diff --git a/include/fts0priv.ic b/include/fts0priv.ic index 8ef877f267e..2d07c60f980 100644 --- a/include/fts0priv.ic +++ b/include/fts0priv.ic @@ -37,18 +37,38 @@ fts_write_object_id( /* in: true for fixed hex format, false for old ambiguous format */ { + #ifdef _WIN32 - /* Use this to construct old(5.6.14 and 5.7.3) ambiguous - aux table names */ + + DBUG_EXECUTE_IF("innodb_test_wrong_non_windows_fts_aux_table_name", + return(sprintf(str, UINT64PFx, id));); + + /* Use this to construct old(5.6.14 and 5.7.3) windows + ambiguous aux table names */ DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name", return(sprintf(str, "%016llu", id));); +#else /* _WIN32 */ + + /* Use this to construct old(5.6.14 and 5.7.3) windows + ambiguous aux table names */ + DBUG_EXECUTE_IF("innodb_test_wrong_windows_fts_aux_table_name", + return(sprintf(str, "%016"PRIu64, id));); + + DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name", + return(sprintf(str, UINT64PFx, id));); + +#endif /* _WIN32 */ + /* As above, but this is only for those tables failing to rename. */ if (!hex_format) { +#ifdef _WIN32 // FIXME: Use ut_snprintf(), so does following one. return(sprintf(str, "%016llu", id)); - } +#else /* _WIN32 */ + return(sprintf(str, "%016"PRIu64, id)); #endif /* _WIN32 */ + } return(sprintf(str, UINT64PFx, id)); } diff --git a/lock/lock0lock.cc b/lock/lock0lock.cc index d3d2b76c710..d975b267662 100644 --- a/lock/lock0lock.cc +++ b/lock/lock0lock.cc @@ -5366,6 +5366,7 @@ loop: ulint space = lock->un_member.rec_lock.space; ulint zip_size= fil_space_get_zip_size(space); ulint page_no = lock->un_member.rec_lock.page_no; + ibool tablespace_being_deleted = FALSE; if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) { @@ -5384,12 +5385,28 @@ loop: lock_mutex_exit(); mutex_exit(&trx_sys->mutex); - mtr_start(&mtr); + DEBUG_SYNC_C("innodb_monitor_before_lock_page_read"); - buf_page_get_with_no_latch( - space, zip_size, page_no, &mtr); + /* Check if the space is exists or not. only when the space + is valid, try to get the page. */ + tablespace_being_deleted = fil_inc_pending_ops(space, false); - mtr_commit(&mtr); + if (!tablespace_being_deleted) { + mtr_start(&mtr); + + buf_page_get_gen(space, zip_size, page_no, + RW_NO_LATCH, NULL, + BUF_GET_POSSIBLY_FREED, + __FILE__, __LINE__, &mtr); + + mtr_commit(&mtr); + + fil_decr_pending_ops(space); + } else { + fprintf(file, "RECORD LOCKS on" + " non-existing space %lu\n", + (ulong) space); + } load_page_first = FALSE; @@ -5812,7 +5829,7 @@ lock_rec_block_validate( /* Make sure that the tablespace is not deleted while we are trying to access the page. */ - if (!fil_inc_pending_ops(space)) { + if (!fil_inc_pending_ops(space, true)) { mtr_start(&mtr); block = buf_page_get_gen( space, fil_space_get_zip_size(space), diff --git a/log/log0log.cc b/log/log0log.cc index 8b4149539d7..ff0c880bdd5 100644 --- a/log/log0log.cc +++ b/log/log0log.cc @@ -3399,7 +3399,11 @@ loop: lsn = log_sys->lsn; - if (lsn != log_sys->last_checkpoint_lsn + ut_ad(srv_force_recovery != SRV_FORCE_NO_LOG_REDO + || lsn == log_sys->last_checkpoint_lsn + LOG_BLOCK_HDR_SIZE); + + if ((srv_force_recovery != SRV_FORCE_NO_LOG_REDO + && lsn != log_sys->last_checkpoint_lsn) #ifdef UNIV_LOG_ARCHIVE || (srv_log_archive_on && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE) diff --git a/os/os0thread.cc b/os/os0thread.cc index ddde981a55a..772336215c9 100644 --- a/os/os0thread.cc +++ b/os/os0thread.cc @@ -114,6 +114,9 @@ os_thread_create_func( os_thread_id_t* thread_id) /*!< out: id of the created thread, or NULL */ { + /* the new thread should look recent changes up here so far. */ + os_wmb; + #ifdef __WIN__ os_thread_t thread; DWORD win_thread_id; diff --git a/page/page0zip.cc b/page/page0zip.cc index 194dc3a1d0e..4fcf38e9a8c 100644 --- a/page/page0zip.cc +++ b/page/page0zip.cc @@ -4889,8 +4889,15 @@ page_zip_verify_checksum( stored = static_cast(mach_read_from_4( static_cast(data) + FIL_PAGE_SPACE_OR_CHKSUM)); - /* declare empty pages non-corrupted */ - if (stored == 0) { +#if FIL_PAGE_LSN % 8 +#error "FIL_PAGE_LSN must be 64 bit aligned" +#endif + + /* Check if page is empty */ + if (stored == 0 + && *reinterpret_cast(static_cast( + data) + + FIL_PAGE_LSN) == 0) { /* make sure that the page is really empty */ ulint i; for (i = 0; i < size; i++) { @@ -4898,7 +4905,7 @@ page_zip_verify_checksum( return(FALSE); } } - + /* Empty page */ return(TRUE); } diff --git a/row/row0mysql.cc b/row/row0mysql.cc index 3e342f3a88b..4b13d1dd10e 100644 --- a/row/row0mysql.cc +++ b/row/row0mysql.cc @@ -3764,6 +3764,10 @@ row_drop_table_for_mysql( pars_info_t* info = NULL; mem_heap_t* heap = NULL; + DBUG_ENTER("row_drop_table_for_mysql"); + + DBUG_PRINT("row_drop_table_for_mysql", ("table: %s", name)); + ut_a(name != NULL); if (srv_created_new_raw) { @@ -3773,7 +3777,7 @@ row_drop_table_for_mysql( "InnoDB: Shut down mysqld and edit my.cnf so that newraw" " is replaced with raw.\n", stderr); - return(DB_ERROR); + DBUG_RETURN(DB_ERROR); } /* The table name is prefixed with the database name and a '/'. @@ -4401,7 +4405,7 @@ funct_exit: srv_wake_master_thread(); - return(err); + DBUG_RETURN(err); } /*********************************************************************//** diff --git a/sync/sync0rw.cc b/sync/sync0rw.cc index 9da6e3e7746..2d3d16e9065 100644 --- a/sync/sync0rw.cc +++ b/sync/sync0rw.cc @@ -291,6 +291,7 @@ rw_lock_free_func( ib_mutex_t* mutex; #endif /* !INNODB_RW_LOCKS_USE_ATOMICS */ + os_rmb; ut_ad(rw_lock_validate(lock)); ut_a(lock->lock_word == X_LOCK_DECR); From 05c002d0ffc003dfe6646f785dabef0c440da3d1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 00:12:51 +0100 Subject: [PATCH 173/201] 5.6.22 --- .../suite/perfschema/r/unary_digest.result | 47 +++++++++ .../suite/perfschema/t/unary_digest.test | 98 +++++++++++++++++++ storage/perfschema/gen_pfs_lex_token.cc | 96 +++++++++++++++++- storage/perfschema/pfs_digest.cc | 59 ++++++++++- 4 files changed, 291 insertions(+), 9 deletions(-) create mode 100644 mysql-test/suite/perfschema/r/unary_digest.result create mode 100644 mysql-test/suite/perfschema/t/unary_digest.test diff --git a/mysql-test/suite/perfschema/r/unary_digest.result b/mysql-test/suite/perfschema/r/unary_digest.result new file mode 100644 index 00000000000..40fcc026fad --- /dev/null +++ b/mysql-test/suite/perfschema/r/unary_digest.result @@ -0,0 +1,47 @@ +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_unary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_binary' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_full_reduce' doesn't exist +ERROR 42S02: Table 'test.expect_unchanged' doesn't exist +SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR +FROM performance_schema.events_statements_summary_by_digest; +SCHEMA_NAME DIGEST_TEXT COUNT_STAR +test TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 +test SELECT ? FROM expect_unary 5 +test SELECT ? + ? FROM expect_binary 2 +test SELECT ? - ? FROM expect_binary 2 +test INSERT INTO expect_full_reduce VALUES (...) 27 +test SELECT a - b , a + b , - a , - b , + a , + b FROM expect_unchanged 1 diff --git a/mysql-test/suite/perfschema/t/unary_digest.test b/mysql-test/suite/perfschema/t/unary_digest.test new file mode 100644 index 00000000000..c4583484f36 --- /dev/null +++ b/mysql-test/suite/perfschema/t/unary_digest.test @@ -0,0 +1,98 @@ +# ---------------------------------------------------- +# Tests for the performance schema statement Digests. +# ---------------------------------------------------- + +# Test case to show behavior of statements digest when +# statement-digest-size is 0 + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source ../include/no_protocol.inc + +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; + +--disable_query_log + +--error ER_NO_SUCH_TABLE +select 1 from expect_unary; +--error ER_NO_SUCH_TABLE +select +1 from expect_unary; +--error ER_NO_SUCH_TABLE +select -1 from expect_unary; +--error ER_NO_SUCH_TABLE +select ++++++++++++++++++++++++++++++++++++++++++++++++1 from expect_unary; +--error ER_NO_SUCH_TABLE +select ------------------------------------------------1 from expect_unary; + +--error ER_NO_SUCH_TABLE +select 0+1 from expect_binary; +--error ER_NO_SUCH_TABLE +select 0-1 from expect_binary; +--error ER_NO_SUCH_TABLE +select 0 ++++++++++++++++++++++++++++++++++++++++++++++++1 from expect_binary; +--error ER_NO_SUCH_TABLE +select 0 ------------------------------------------------1 from expect_binary; + +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, 0, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, 0, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, 0, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, -1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, -1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, -1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, +1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, +1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (0, +1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, 0, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, 0, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, 0, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, -1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, -1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, -1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, +1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, +1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (-1, +1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, 0, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, 0, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, 0, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, -1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, -1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, -1, +1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, +1, 0); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, +1, -1); +--error ER_NO_SUCH_TABLE +insert into expect_full_reduce values (+1, +1, +1); + +--error ER_NO_SUCH_TABLE +select a-b, a+b, -a, -b, +a, +b from expect_unchanged; + +--enable_query_log + +SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest; + diff --git a/storage/perfschema/gen_pfs_lex_token.cc b/storage/perfschema/gen_pfs_lex_token.cc index 7581255b284..c67f2920b75 100644 --- a/storage/perfschema/gen_pfs_lex_token.cc +++ b/storage/perfschema/gen_pfs_lex_token.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2011, 2014, 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 @@ -36,10 +36,13 @@ See also YYMAXUTOK. */ #define MY_MAX_TOKEN 1000 +/** Generated token. */ struct gen_lex_token_string { const char *m_token_string; int m_token_length; + bool m_append_space; + bool m_start_expr; }; gen_lex_token_string compiled_token_array[MY_MAX_TOKEN]; @@ -76,6 +79,13 @@ void set_token(int tok, const char *str) compiled_token_array[tok].m_token_string= str; compiled_token_array[tok].m_token_length= strlen(str); + compiled_token_array[tok].m_append_space= true; + compiled_token_array[tok].m_start_expr= false; +} + +void set_start_expr_token(int tok) +{ + compiled_token_array[tok].m_start_expr= true; } void compute_tokens() @@ -91,6 +101,8 @@ void compute_tokens() { compiled_token_array[tok].m_token_string= "(unknown)"; compiled_token_array[tok].m_token_length= 9; + compiled_token_array[tok].m_append_space= true; + compiled_token_array[tok].m_start_expr= false; } /* @@ -102,6 +114,7 @@ void compute_tokens() str[0]= (char) tok; compiled_token_array[tok].m_token_string= str; compiled_token_array[tok].m_token_length= 1; + compiled_token_array[tok].m_append_space= true; } max_token_seen= 255; @@ -202,6 +215,71 @@ void compute_tokens() max_token_seen++; tok_pfs_unused= max_token_seen; set_token(tok_pfs_unused, "UNUSED"); + + /* + Fix whitespace for some special tokens. + */ + + /* + The lexer parses "@@variable" as '@', '@', 'variable', + returning a token for '@' alone. + + This is incorrect, '@' is not really a token, + because the syntax "@ @ variable" (with spaces) is not accepted: + The lexer keeps some internal state after the '@' fake token. + + To work around this, digest text are printed as "@@variable". + */ + compiled_token_array[(int) '@'].m_append_space= false; + + /* + Define additional properties for tokens. + + List all the token that are followed by an expression. + This is needed to differentiate unary from binary + '+' and '-' operators, because we want to: + - reduce to , + - preserve <...> as is. + */ + set_start_expr_token('('); + set_start_expr_token(','); + set_start_expr_token(EVERY_SYM); + set_start_expr_token(AT_SYM); + set_start_expr_token(STARTS_SYM); + set_start_expr_token(ENDS_SYM); + set_start_expr_token(DEFAULT); + set_start_expr_token(RETURN_SYM); + set_start_expr_token(IF); + set_start_expr_token(ELSEIF_SYM); + set_start_expr_token(CASE_SYM); + set_start_expr_token(WHEN_SYM); + set_start_expr_token(WHILE_SYM); + set_start_expr_token(UNTIL_SYM); + set_start_expr_token(SELECT_SYM); + + set_start_expr_token(OR_SYM); + set_start_expr_token(OR2_SYM); + set_start_expr_token(XOR); + set_start_expr_token(AND_SYM); + set_start_expr_token(AND_AND_SYM); + set_start_expr_token(NOT_SYM); + set_start_expr_token(BETWEEN_SYM); + set_start_expr_token(LIKE); + set_start_expr_token(REGEXP); + + set_start_expr_token('|'); + set_start_expr_token('&'); + set_start_expr_token(SHIFT_LEFT); + set_start_expr_token(SHIFT_RIGHT); + set_start_expr_token('+'); + set_start_expr_token('-'); + set_start_expr_token(INTERVAL_SYM); + set_start_expr_token('*'); + set_start_expr_token('/'); + set_start_expr_token('%'); + set_start_expr_token(DIV_SYM); + set_start_expr_token(MOD_SYM); + set_start_expr_token('^'); } void print_tokens() @@ -214,20 +292,26 @@ void print_tokens() for (tok= 0; tok<256; tok++) { - printf("/* %03d */ { \"\\x%02x\", 1},\n", tok, tok); + printf("/* %03d */ { \"\\x%02x\", 1, %s, %s},\n", + tok, + tok, + compiled_token_array[tok].m_append_space ? "true" : "false", + compiled_token_array[tok].m_start_expr ? "true" : "false"); } printf("/* PART 2: named tokens. */\n"); for (tok= 256; tok<= max_token_seen; tok++) { - printf("/* %03d */ { \"%s\", %d},\n", + printf("/* %03d */ { \"%s\", %d, %s, %s},\n", tok, compiled_token_array[tok].m_token_string, - compiled_token_array[tok].m_token_length); + compiled_token_array[tok].m_token_length, + compiled_token_array[tok].m_append_space ? "true" : "false", + compiled_token_array[tok].m_start_expr ? "true" : "false"); } - printf("/* DUMMY */ { \"\", 0}\n"); + printf("/* DUMMY */ { \"\", 0, false, false}\n"); printf("};\n"); printf("/* PFS specific tokens. */\n"); @@ -254,6 +338,8 @@ int main(int argc,char **argv) printf("{\n"); printf(" const char *m_token_string;\n"); printf(" int m_token_length;\n"); + printf(" bool m_append_space;\n"); + printf(" bool m_start_expr;\n"); printf("};\n"); printf("typedef struct lex_token_string lex_token_string;\n"); diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc index addfac1f034..8fbd5741565 100644 --- a/storage/perfschema/pfs_digest.cc +++ b/storage/perfschema/pfs_digest.cc @@ -602,16 +602,67 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker, switch (token) { - case BIN_NUM: + case NUM: + case LONG_NUM: + case ULONGLONG_NUM: case DECIMAL_NUM: case FLOAT_NUM: + case BIN_NUM: case HEX_NUM: + { + bool found_unary; + do + { + found_unary= false; + peek_last_two_tokens(digest_storage, state->m_last_id_index, + &last_token, &last_token2); + + if ((last_token == '-') || (last_token == '+')) + { + /* + We need to differentiate: + - a operator + - a operator + from + - a operator + - a operator + to only reduce "a = -1" to "a = ?", and not change "b - 1" to "b ?" + + Binary operators are found inside an expression, + while unary operators are found at the beginning of an expression, or after operators. + + To achieve this, every token that is followed by an expression + in the SQL grammar is flagged. + See sql/sql_yacc.yy + See sql/gen_lex_token.cc + + For example, + "(-1)" is parsed as "(", "-", NUM, ")", and lex_token_array["("].m_start_expr is true, + so reduction of the "-" NUM is done, the result is "(?)". + "(a-1)" is parsed as "(", ID, "-", NUM, ")", and lex_token_array[ID].m_start_expr is false, + so the operator is binary, no reduction is done, and the result is "(a-?)". + */ + if (lex_token_array[last_token2].m_start_expr) + { + /* + REDUCE: + TOK_PFS_GENERIC_VALUE := (UNARY_PLUS | UNARY_MINUS) (NUM | LOG_NUM | ... | FLOAT_NUM) + + REDUCE: + TOK_PFS_GENERIC_VALUE := (UNARY_PLUS | UNARY_MINUS) TOK_PFS_GENERIC_VALUE + */ + token= TOK_PFS_GENERIC_VALUE; + digest_storage->m_byte_count-= PFS_SIZE_OF_A_TOKEN; + found_unary= true; + } + } + } while (found_unary); + } + /* fall through, for case NULL_SYM below */ case LEX_HOSTNAME: - case LONG_NUM: - case NUM: case TEXT_STRING: case NCHAR_STRING: - case ULONGLONG_NUM: + case PARAM_MARKER: { /* REDUCE: From 67da9e81c7d4ed0f9ca01862c5653e4ff412e2ff Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 00:15:29 +0100 Subject: [PATCH 174/201] 5.6.22-71.0 --- btr/btr0cur.cc | 65 ++-- buf/buf0buf.cc | 23 +- buf/buf0flu.cc | 34 +- dict/dict0dict.cc | 29 +- fil/fil0fil.cc | 26 +- fts/fts0fts.cc | 672 +++++++++++++++++++++++++++++---------- fts/fts0opt.cc | 18 +- handler/ha_innodb.cc | 53 ++- handler/handler0alter.cc | 9 +- ibuf/ibuf0ibuf.cc | 4 +- include/btr0cur.ic | 4 +- include/buf0buf.h | 5 +- include/dict0dict.h | 2 +- include/fil0fil.h | 4 +- include/fts0priv.ic | 26 +- include/lock0lock.h | 2 +- include/trx0rec.h | 2 +- include/univ.i | 6 +- lock/lock0lock.cc | 33 +- log/log0log.cc | 18 +- log/log0recv.cc | 3 +- os/os0thread.cc | 3 + page/page0zip.cc | 13 +- row/row0mysql.cc | 8 +- srv/srv0srv.cc | 9 - srv/srv0start.cc | 4 +- sync/sync0rw.cc | 1 + 27 files changed, 792 insertions(+), 284 deletions(-) diff --git a/btr/btr0cur.cc b/btr/btr0cur.cc index 51254f39a7c..8675acadb19 100644 --- a/btr/btr0cur.cc +++ b/btr/btr0cur.cc @@ -2518,6 +2518,38 @@ btr_cur_pess_upd_restore_supremum( page_rec_get_heap_no(rec)); } +/*************************************************************//** +Check if the total length of the modified blob for the row is within 10% +of the total redo log size. This constraint on the blob length is to +avoid overwriting the redo logs beyond the last checkpoint lsn. +@return DB_SUCCESS or DB_TOO_BIG_RECORD. */ +static +dberr_t +btr_check_blob_limit(const big_rec_t* big_rec_vec) +{ + const ib_uint64_t redo_size = srv_n_log_files * srv_log_file_size + * UNIV_PAGE_SIZE; + const ulint redo_10p = redo_size / 10; + ulint total_blob_len = 0; + dberr_t err = DB_SUCCESS; + + /* Calculate the total number of bytes for blob data */ + for (ulint i = 0; i < big_rec_vec->n_fields; i++) { + total_blob_len += big_rec_vec->fields[i].len; + } + + if (total_blob_len > redo_10p) { + ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data" + " length (" ULINTPF ") is greater than" + " 10%% of the total redo log size (" UINT64PF + "). Please increase total redo log size.", + total_blob_len, redo_size); + err = DB_TOO_BIG_RECORD; + } + + return(err); +} + /*************************************************************//** Performs an update of a record on a page of a tree. It is assumed that mtr holds an x-latch on the tree and on the cursor page. If the @@ -2756,26 +2788,14 @@ make_external: } if (big_rec_vec) { - const ulint redo_10p = srv_log_file_size * UNIV_PAGE_SIZE / 10; - ulint total_blob_len = 0; - /* Calculate the total number of bytes for blob data */ - for (ulint i = 0; i < big_rec_vec->n_fields; i++) { - total_blob_len += big_rec_vec->fields[i].len; - } + err = btr_check_blob_limit(big_rec_vec); - if (total_blob_len > redo_10p) { - ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data" - " length (" ULINTPF ") is greater than" - " 10%% of the redo log file size (" UINT64PF - "). Please increase innodb_log_file_size.", - total_blob_len, srv_log_file_size); + if (err != DB_SUCCESS) { if (n_reserved > 0) { fil_space_release_free_extents( index->space, n_reserved); } - - err = DB_TOO_BIG_RECORD; goto err_exit; } } @@ -4630,7 +4650,6 @@ btr_store_big_rec_extern_fields( buf_block_t** freed_pages = NULL; ulint n_freed_pages = 0; dberr_t error = DB_SUCCESS; - ulint total_blob_len = 0; ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(rec_offs_any_extern(offsets)); @@ -4650,21 +4669,11 @@ btr_store_big_rec_extern_fields( rec_page_no = buf_block_get_page_no(rec_block); ut_a(fil_page_get_type(page_align(rec)) == FIL_PAGE_INDEX); - const ulint redo_10p = (srv_log_file_size * UNIV_PAGE_SIZE / 10); + error = btr_check_blob_limit(big_rec_vec); - /* Calculate the total number of bytes for blob data */ - for (ulint i = 0; i < big_rec_vec->n_fields; i++) { - total_blob_len += big_rec_vec->fields[i].len; - } - - if (total_blob_len > redo_10p) { + if (error != DB_SUCCESS) { ut_ad(op == BTR_STORE_INSERT); - ib_logf(IB_LOG_LEVEL_ERROR, "The total blob data length" - " (" ULINTPF ") is greater than 10%% of the" - " redo log file size (" UINT64PF "). Please" - " increase innodb_log_file_size.", - total_blob_len, srv_log_file_size); - return(DB_TOO_BIG_RECORD); + return(error); } if (page_zip) { diff --git a/buf/buf0buf.cc b/buf/buf0buf.cc index 5cf75164ea3..c7d22f08f59 100644 --- a/buf/buf0buf.cc +++ b/buf/buf0buf.cc @@ -592,9 +592,14 @@ buf_page_is_corrupted( checksum_field2 = mach_read_from_4( read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM); +#if FIL_PAGE_LSN % 8 +#error "FIL_PAGE_LSN must be 64 bit aligned" +#endif + /* declare empty pages non-corrupted */ if (checksum_field1 == 0 && checksum_field2 == 0 - && mach_read_from_4(read_buf + FIL_PAGE_LSN) == 0) { + && *reinterpret_cast(read_buf + + FIL_PAGE_LSN) == 0) { /* make sure that the page is really empty */ for (ulint i = 0; i < UNIV_PAGE_SIZE; i++) { if (read_buf[i] != 0) { @@ -1649,8 +1654,9 @@ buf_pool_watch_is_sentinel( /****************************************************************//** Add watch for the given page to be read in. Caller must have -appropriate hash_lock for the bpage. This function may release the -hash_lock and reacquire it. +appropriate hash_lock for the bpage and hold the LRU list mutex to avoid a race +condition with buf_LRU_free_page inserting the same page into the page hash. +This function may release the hash_lock and reacquire it. @return NULL if watch set, block if the page is in the buffer pool */ UNIV_INTERN buf_page_t* @@ -1665,6 +1671,8 @@ buf_pool_watch_set( buf_pool_t* buf_pool = buf_pool_get(space, offset); prio_rw_lock_t* hash_lock; + ut_ad(mutex_own(&buf_pool->LRU_list_mutex)); + hash_lock = buf_page_hash_lock_get(buf_pool, fold); #ifdef UNIV_SYNC_DEBUG @@ -1733,6 +1741,7 @@ page_found: bpage->space = static_cast(space); bpage->offset = static_cast(offset); bpage->buf_fix_count = 1; + bpage->buf_pool_index = buf_pool_index(buf_pool); mutex_exit(&buf_pool->zip_mutex); @@ -2678,9 +2687,11 @@ loop: /* Page not in buf_pool: needs to be read from file */ if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) { + mutex_enter(&buf_pool->LRU_list_mutex); rw_lock_x_lock(hash_lock); block = (buf_block_t*) buf_pool_watch_set( space, offset, fold); + mutex_exit(&buf_pool->LRU_list_mutex); if (UNIV_LIKELY_NULL(block)) { /* We can release hash_lock after we @@ -3012,15 +3023,19 @@ got_block: if (buf_LRU_free_page(&fix_block->page, true)) { mutex_exit(fix_mutex); - rw_lock_x_lock(hash_lock); if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) { + mutex_enter(&buf_pool->LRU_list_mutex); + rw_lock_x_lock(hash_lock); + /* Set the watch, as it would have been set if the page were not in the buffer pool in the first place. */ block = (buf_block_t*) buf_pool_watch_set( space, offset, fold); + mutex_exit(&buf_pool->LRU_list_mutex); } else { + rw_lock_x_lock(hash_lock); block = (buf_block_t*) buf_page_hash_get_low( buf_pool, space, offset, fold); } diff --git a/buf/buf0flu.cc b/buf/buf0flu.cc index 3d06bfeb78e..f5fc41a2ac7 100644 --- a/buf/buf0flu.cc +++ b/buf/buf0flu.cc @@ -836,39 +836,35 @@ buf_flush_init_for_writing( case SRV_CHECKSUM_ALGORITHM_CRC32: case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32: checksum = buf_calc_page_crc32(page); + mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); break; case SRV_CHECKSUM_ALGORITHM_INNODB: case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB: checksum = (ib_uint32_t) buf_calc_page_new_checksum(page); + mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); + checksum = (ib_uint32_t) buf_calc_page_old_checksum(page); break; case SRV_CHECKSUM_ALGORITHM_NONE: case SRV_CHECKSUM_ALGORITHM_STRICT_NONE: checksum = BUF_NO_CHECKSUM_MAGIC; + mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); break; /* no default so the compiler will emit a warning if new enum is added and not handled here */ } - mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum); + /* With the InnoDB checksum, we overwrite the first 4 bytes of + the end lsn field to store the old formula checksum. Since it + depends also on the field FIL_PAGE_SPACE_OR_CHKSUM, it has to + be calculated after storing the new formula checksum. - /* We overwrite the first 4 bytes of the end lsn field to store - the old formula checksum. Since it depends also on the field - FIL_PAGE_SPACE_OR_CHKSUM, it has to be calculated after storing the - new formula checksum. */ - - if (srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB - || srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) { - - checksum = (ib_uint32_t) buf_calc_page_old_checksum(page); - - /* In other cases we use the value assigned from above. - If CRC32 is used then it is faster to use that checksum - (calculated above) instead of calculating another one. - We can afford to store something other than - buf_calc_page_old_checksum() or BUF_NO_CHECKSUM_MAGIC in - this field because the file will not be readable by old - versions of MySQL/InnoDB anyway (older than MySQL 5.6.3) */ - } + In other cases we write the same value to both fields. + If CRC32 is used then it is faster to use that checksum + (calculated above) instead of calculating another one. + We can afford to store something other than + buf_calc_page_old_checksum() or BUF_NO_CHECKSUM_MAGIC in + this field because the file will not be readable by old + versions of MySQL/InnoDB anyway (older than MySQL 5.6.3) */ mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, checksum); diff --git a/dict/dict0dict.cc b/dict/dict0dict.cc index eb537ddd2c3..87a1caa31bb 100644 --- a/dict/dict0dict.cc +++ b/dict/dict0dict.cc @@ -39,6 +39,16 @@ UNIV_INTERN dict_index_t* dict_ind_redundant; /** dummy index for ROW_FORMAT=COMPACT supremum and infimum records */ UNIV_INTERN dict_index_t* dict_ind_compact; +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG +/** Flag to control insert buffer debugging. */ +extern UNIV_INTERN uint ibuf_debug; +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + +/********************************************************************** +Issue a warning that the row is too big. */ +void +ib_warn_row_too_big(const dict_table_t* table); + #ifndef UNIV_HOTBACKUP #include "buf0buf.h" #include "data0type.h" @@ -2406,11 +2416,18 @@ dict_index_add_to_cache( new_index->n_fields = new_index->n_def; new_index->trx_id = index->trx_id; - if (strict && dict_index_too_big_for_tree(table, new_index)) { + if (dict_index_too_big_for_tree(table, new_index)) { + + if (strict) { too_big: - dict_mem_index_free(new_index); - dict_mem_index_free(index); - return(DB_TOO_BIG_RECORD); + dict_mem_index_free(new_index); + dict_mem_index_free(index); + return(DB_TOO_BIG_RECORD); + } else { + + ib_warn_row_too_big(table); + + } } if (dict_index_is_univ(index)) { @@ -5683,11 +5700,11 @@ dict_set_corrupted( dict_index_copy_types(tuple, sys_index, 2); - btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_GE, + btr_cur_search_to_nth_level(sys_index, 0, tuple, PAGE_CUR_LE, BTR_MODIFY_LEAF, &cursor, 0, __FILE__, __LINE__, &mtr); - if (cursor.up_match == dtuple_get_n_fields(tuple)) { + if (cursor.low_match == dtuple_get_n_fields(tuple)) { /* UPDATE SYS_INDEXES SET TYPE=index->type WHERE TABLE_ID=index->table->id AND INDEX_ID=index->id */ ulint len; diff --git a/fil/fil0fil.cc b/fil/fil0fil.cc index 34f7dba07f8..1a23d844522 100644 --- a/fil/fil0fil.cc +++ b/fil/fil0fil.cc @@ -2139,7 +2139,8 @@ UNIV_INTERN ibool fil_inc_pending_ops( /*================*/ - ulint id) /*!< in: space id */ + ulint id, /*!< in: space id */ + ibool print_err) /*!< in: need to print error or not */ { fil_space_t* space; @@ -2148,10 +2149,12 @@ fil_inc_pending_ops( space = fil_space_get_by_id(id); if (space == NULL) { - fprintf(stderr, - "InnoDB: Error: trying to do an operation on a" - " dropped tablespace %lu\n", - (ulong) id); + if (print_err) { + fprintf(stderr, + "InnoDB: Error: trying to do an operation on a" + " dropped tablespace %lu\n", + (ulong) id); + } } if (space == NULL || space->stop_new_ops) { @@ -4300,7 +4303,18 @@ fil_load_single_table_tablespace( /* Build up the tablename in the standard form database/table. */ tablename = static_cast( mem_alloc(dbname_len + filename_len + 2)); - sprintf(tablename, "%s/%s", dbname, filename); + + /* When lower_case_table_names = 2 it is possible that the + dbname is in upper case ,but while storing it in fil_space_t + we must convert it into lower case */ + sprintf(tablename, "%s" , dbname); + tablename[dbname_len] = '\0'; + + if (lower_case_file_system) { + dict_casedn_str(tablename); + } + + sprintf(tablename+dbname_len,"/%s",filename); tablename_len = strlen(tablename) - strlen(".ibd"); tablename[tablename_len] = '\0'; diff --git a/fts/fts0fts.cc b/fts/fts0fts.cc index 0ef9f228f55..c2d3f154075 100644 --- a/fts/fts0fts.cc +++ b/fts/fts0fts.cc @@ -36,6 +36,7 @@ Full Text Search interface #include "dict0priv.h" #include "dict0stats.h" #include "btr0pcur.h" +#include #include "ha_prototypes.h" @@ -899,12 +900,14 @@ fts_drop_index( index_cache = fts_find_index_cache(cache, index); - if (index_cache->words) { - fts_words_free(index_cache->words); - rbt_free(index_cache->words); - } + if (index_cache != NULL) { + if (index_cache->words) { + fts_words_free(index_cache->words); + rbt_free(index_cache->words); + } - ib_vector_remove(cache->indexes, *(void**) index_cache); + ib_vector_remove(cache->indexes, *(void**) index_cache); + } if (cache->get_docs) { fts_reset_get_doc(cache); @@ -1255,7 +1258,8 @@ fts_tokenizer_word_get( #endif /* If it is a stopword, do not index it */ - if (rbt_search(cache->stopword_info.cached_stopword, + if (cache->stopword_info.cached_stopword != NULL + && rbt_search(cache->stopword_info.cached_stopword, &parent, text) == 0) { return(NULL); @@ -3557,6 +3561,12 @@ fts_add_doc_by_id( rw_lock_x_lock(&table->fts->cache->lock); + if (table->fts->cache->stopword_info.status + & STOPWORD_NOT_INIT) { + fts_load_stopword(table, NULL, NULL, + NULL, TRUE, TRUE); + } + fts_cache_add_doc( table->fts->cache, get_doc->index_cache, @@ -6071,8 +6081,6 @@ fts_update_hex_format_flag( return (err); } -#ifdef _WIN32 - /*********************************************************************//** Rename an aux table to HEX format. It's called when "%016llu" is used to format an object id in table name, which only happens in Windows. */ @@ -6169,8 +6177,8 @@ This function should make sure that either all the parent table and aux tables are set DICT_TF2_FTS_AUX_HEX_NAME with flags2 or none of them are set */ static __attribute__((nonnull, warn_unused_result)) dberr_t -fts_rename_aux_tables_to_hex_format( -/*================================*/ +fts_rename_aux_tables_to_hex_format_low( +/*====================================*/ trx_t* trx, /*!< in: transaction */ dict_table_t* parent_table, /*!< in: parent table */ ib_vector_t* tables) /*!< in: aux tables to rename. */ @@ -6294,12 +6302,14 @@ fts_rename_aux_tables_to_hex_format( "table %s. Please revert manually.", table->name); fts_sql_rollback(trx_bg); + trx_free_for_background(trx_bg); /* Continue to clear aux tables' flags2 */ not_rename = true; continue; } fts_sql_commit(trx_bg); + trx_free_for_background(trx_bg); } DICT_TF2_FLAG_UNSET(parent_table, DICT_TF2_FTS_AUX_HEX_NAME); @@ -6323,7 +6333,11 @@ fts_fake_hex_to_dec( ret = sprintf(tmp_id, UINT64PFx, id); ut_ad(ret == 16); +#ifdef _WIN32 ret = sscanf(tmp_id, "%016llu", &dec_id); +#else + ret = sscanf(tmp_id, "%016"PRIu64, &dec_id); +#endif /* _WIN32 */ ut_ad(ret == 1); return dec_id; @@ -6345,7 +6359,293 @@ fts_check_aux_table_parent_id_cmp( return static_cast(fa1->parent_id - fa2->parent_id); } -#endif /* _WIN32 */ +/** Mark all the fts index associated with the parent table as corrupted. +@param[in] trx transaction +@param[in, out] parent_table fts index associated with this parent table + will be marked as corrupted. */ +static +void +fts_parent_all_index_set_corrupt( + trx_t* trx, + dict_table_t* parent_table) +{ + fts_t* fts = parent_table->fts; + + if (trx_get_dict_operation(trx) == TRX_DICT_OP_NONE) { + trx_set_dict_operation(trx, TRX_DICT_OP_INDEX); + } + + for (ulint j = 0; j < ib_vector_size(fts->indexes); j++) { + dict_index_t* index = static_cast( + ib_vector_getp_const(fts->indexes, j)); + dict_set_corrupted(index, + trx, "DROP ORPHANED TABLE"); + } +} + +/** Mark the fts index which index id matches the id as corrupted. +@param[in] trx transaction +@param[in] id index id to search +@param[in, out] parent_table parent table to check with all + the index. */ +static +void +fts_set_index_corrupt( + trx_t* trx, + index_id_t id, + dict_table_t* table) +{ + fts_t* fts = table->fts; + + if (trx_get_dict_operation(trx) == TRX_DICT_OP_NONE) { + trx_set_dict_operation(trx, TRX_DICT_OP_INDEX); + } + + for (ulint j = 0; j < ib_vector_size(fts->indexes); j++) { + dict_index_t* index = static_cast( + ib_vector_getp_const(fts->indexes, j)); + if (index->id == id) { + dict_set_corrupted(index, trx, + "DROP ORPHANED TABLE"); + break; + } + } +} + +/** Check the index for the aux table is corrupted. +@param[in] aux_table auxiliary table +@retval nonzero if index is corrupted, zero for valid index */ +static +ulint +fts_check_corrupt_index( + fts_aux_table_t* aux_table) +{ + dict_table_t* table; + dict_index_t* index; + table = dict_table_open_on_id( + aux_table->parent_id, TRUE, DICT_TABLE_OP_NORMAL); + + if (table == NULL) { + return(0); + } + + for (index = UT_LIST_GET_FIRST(table->indexes); + index; + index = UT_LIST_GET_NEXT(indexes, index)) { + if (index->id == aux_table->index_id) { + ut_ad(index->type & DICT_FTS); + dict_table_close(table, true, false); + return(dict_index_is_corrupted(index)); + } + } + + dict_table_close(table, true, false); + return(0); +} + +/** Check the validity of the parent table. +@param[in] aux_table auxiliary table +@return true if it is a valid table or false if it is not */ +static +bool +fts_valid_parent_table( + const fts_aux_table_t* aux_table) +{ + dict_table_t* parent_table; + bool valid = false; + + parent_table = dict_table_open_on_id( + aux_table->parent_id, TRUE, DICT_TABLE_OP_NORMAL); + + if (parent_table != NULL && parent_table->fts != NULL) { + if (aux_table->index_id == 0) { + valid = true; + } else { + index_id_t id = aux_table->index_id; + dict_index_t* index; + + /* Search for the FT index in the table's list. */ + for (index = UT_LIST_GET_FIRST(parent_table->indexes); + index; + index = UT_LIST_GET_NEXT(indexes, index)) { + if (index->id == id) { + valid = true; + break; + } + + } + } + } + + if (parent_table) { + dict_table_close(parent_table, TRUE, FALSE); + } + + return(valid); +} + +/** Try to rename all aux tables of the specified parent table. +@param[in] aux_tables aux_tables to be renamed +@param[in] parent_table parent table of all aux + tables stored in tables. */ +static +void +fts_rename_aux_tables_to_hex_format( + ib_vector_t* aux_tables, + dict_table_t* parent_table) +{ + dberr_t err; + trx_t* trx_rename = trx_allocate_for_background(); + trx_rename->op_info = "Rename aux tables to hex format"; + trx_rename->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_rename, TRX_DICT_OP_TABLE); + + err = fts_rename_aux_tables_to_hex_format_low(trx_rename, + parent_table, aux_tables); + + trx_rename->dict_operation_lock_mode = 0; + + if (err != DB_SUCCESS) { + + ib_logf(IB_LOG_LEVEL_WARN, + "Rollback operations on all aux tables of table %s. " + "All the fts index associated with the table are " + "marked as corrupted. Please rebuild the " + "index again.", parent_table->name); + fts_sql_rollback(trx_rename); + + /* Corrupting the fts index related to parent table. */ + trx_t* trx_corrupt; + trx_corrupt = trx_allocate_for_background(); + trx_corrupt->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_corrupt, TRX_DICT_OP_TABLE); + fts_parent_all_index_set_corrupt(trx_corrupt, parent_table); + trx_corrupt->dict_operation_lock_mode = 0; + fts_sql_commit(trx_corrupt); + trx_free_for_background(trx_corrupt); + } else { + fts_sql_commit(trx_rename); + } + + trx_free_for_background(trx_rename); + ib_vector_reset(aux_tables); +} + +/** Set the hex format flag for the parent table. +@param[in, out] parent_table parent table +@param[in] trx transaction */ +static +void +fts_set_parent_hex_format_flag( + dict_table_t* parent_table, + trx_t* trx) +{ + if (!DICT_TF2_FLAG_IS_SET(parent_table, + DICT_TF2_FTS_AUX_HEX_NAME)) { + DBUG_EXECUTE_IF("parent_table_flag_fail", + ib_logf(IB_LOG_LEVEL_FATAL, + "Setting parent table %s to hex format " + "failed. Please try to restart the server " + "again, if it doesn't work, the system " + "tables might be corrupted.", + parent_table->name); + return;); + + dberr_t err = fts_update_hex_format_flag( + trx, parent_table->id, true); + + if (err != DB_SUCCESS) { + ib_logf(IB_LOG_LEVEL_FATAL, + "Setting parent table %s to hex format " + "failed. Please try to restart the server " + "again, if it doesn't work, the system " + "tables might be corrupted.", + parent_table->name); + } else { + DICT_TF2_FLAG_SET( + parent_table, DICT_TF2_FTS_AUX_HEX_NAME); + } + } +} + +/** Drop the obsolete auxilary table. +@param[in] tables tables to be dropped. */ +static +void +fts_drop_obsolete_aux_table_from_vector( + ib_vector_t* tables) +{ + dberr_t err; + + for (ulint count = 0; count < ib_vector_size(tables); + ++count) { + + fts_aux_table_t* aux_drop_table; + aux_drop_table = static_cast( + ib_vector_get(tables, count)); + trx_t* trx_drop = trx_allocate_for_background(); + trx_drop->op_info = "Drop obsolete aux tables"; + trx_drop->dict_operation_lock_mode = RW_X_LATCH; + trx_start_for_ddl(trx_drop, TRX_DICT_OP_TABLE); + + err = row_drop_table_for_mysql( + aux_drop_table->name, trx_drop, false, true); + + trx_drop->dict_operation_lock_mode = 0; + + if (err != DB_SUCCESS) { + /* We don't need to worry about the + failure, since server would try to + drop it on next restart, even if + the table was broken. */ + ib_logf(IB_LOG_LEVEL_WARN, + "Fail to drop obsolete aux table '%s', which " + "is harmless. will try to drop it on next " + "restart.", aux_drop_table->name); + fts_sql_rollback(trx_drop); + } else { + ib_logf(IB_LOG_LEVEL_INFO, + "Dropped obsolete aux table '%s'.", + aux_drop_table->name); + + fts_sql_commit(trx_drop); + } + + trx_free_for_background(trx_drop); + } +} + +/** Drop all the auxiliary table present in the vector. +@param[in] trx transaction +@param[in] tables tables to be dropped */ +static +void +fts_drop_aux_table_from_vector( + trx_t* trx, + ib_vector_t* tables) +{ + for (ulint count = 0; count < ib_vector_size(tables); + ++count) { + fts_aux_table_t* aux_drop_table; + aux_drop_table = static_cast( + ib_vector_get(tables, count)); + + /* Check for the validity of the parent table */ + if (!fts_valid_parent_table(aux_drop_table)) { + ib_logf(IB_LOG_LEVEL_WARN, + "Parent table of FTS auxiliary table %s not " + "found.", aux_drop_table->name); + dberr_t err = fts_drop_table(trx, aux_drop_table->name); + if (err == DB_FAIL) { + char* path = fil_make_ibd_name( + aux_drop_table->name, false); + os_file_delete_if_exists(innodb_file_data_key, + path); + mem_free(path); + } + } + } +} /**********************************************************************//** Check and drop all orphaned FTS auxiliary tables, those that don't have @@ -6358,9 +6658,12 @@ fts_check_and_drop_orphaned_tables( trx_t* trx, /*!< in: transaction */ ib_vector_t* tables) /*!< in: tables to check */ { -#ifdef _WIN32 mem_heap_t* heap; ib_vector_t* aux_tables_to_rename; + ib_vector_t* invalid_aux_tables; + ib_vector_t* valid_aux_tables; + ib_vector_t* drop_aux_tables; + ib_vector_t* obsolete_aux_tables; ib_alloc_t* heap_alloc; heap = mem_heap_create(1024); @@ -6371,38 +6674,99 @@ fts_check_and_drop_orphaned_tables( aux_tables_to_rename = ib_vector_create(heap_alloc, sizeof(fts_aux_table_t), 128); + /* We store all fake auxiliary table and orphaned table here. */ + invalid_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + + /* We store all valid aux tables. We use this to filter the + fake auxiliary table from invalid auxiliary tables. */ + valid_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + + /* We store all auxiliary tables to be dropped. */ + drop_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + + /* We store all obsolete auxiliary tables to be dropped. */ + obsolete_aux_tables = ib_vector_create(heap_alloc, + sizeof(fts_aux_table_t), 128); + /* Sort by parent_id first, in case rename will fail */ ib_vector_sort(tables, fts_check_aux_table_parent_id_cmp); -#endif /* _WIN32 */ for (ulint i = 0; i < ib_vector_size(tables); ++i) { dict_table_t* parent_table; fts_aux_table_t* aux_table; bool drop = false; -#ifdef _WIN32 dict_table_t* table; fts_aux_table_t* next_aux_table = NULL; ib_id_t orig_parent_id = 0; + ib_id_t orig_index_id = 0; bool rename = false; -#endif /* _WIN32 */ aux_table = static_cast( ib_vector_get(tables, i)); -#ifdef _WIN32 table = dict_table_open_on_id( aux_table->id, TRUE, DICT_TABLE_OP_NORMAL); orig_parent_id = aux_table->parent_id; + orig_index_id = aux_table->index_id; if (table == NULL || strcmp(table->name, aux_table->name)) { - /* Skip these aux tables, which are common tables - with wrong table ids */ - if (table) { + + bool fake_aux = false; + + if (table != NULL) { dict_table_close(table, TRUE, FALSE); } - continue; + if (i + 1 < ib_vector_size(tables)) { + next_aux_table = static_cast( + ib_vector_get(tables, i + 1)); + } + /* To know whether aux table is fake fts or + orphan fts table. */ + for (ulint count = 0; + count < ib_vector_size(valid_aux_tables); + count++) { + fts_aux_table_t* valid_aux; + valid_aux = static_cast( + ib_vector_get(valid_aux_tables, count)); + if (strcmp(valid_aux->name, + aux_table->name) == 0) { + fake_aux = true; + break; + } + } + + /* All aux tables of parent table, whose id is + last_parent_id, have been checked, try to rename + them if necessary. */ + if ((next_aux_table == NULL + || orig_parent_id != next_aux_table->parent_id) + && (!ib_vector_is_empty(aux_tables_to_rename))) { + + ulint parent_id = fts_fake_hex_to_dec( + aux_table->parent_id); + + parent_table = dict_table_open_on_id( + parent_id, TRUE, + DICT_TABLE_OP_NORMAL); + + fts_rename_aux_tables_to_hex_format( + aux_tables_to_rename, parent_table); + + dict_table_close(parent_table, TRUE, + FALSE); + } + + /* If the aux table is fake aux table. Skip it. */ + if (!fake_aux) { + ib_vector_push(invalid_aux_tables, aux_table); + } + + continue; } else if (!DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_AUX_HEX_NAME)) { @@ -6415,65 +6779,99 @@ fts_check_and_drop_orphaned_tables( } ut_ad(aux_table->id > aux_table->parent_id); - rename = true; + + /* Check whether parent table id and index id + are stored as decimal format. */ + if (fts_valid_parent_table(aux_table)) { + + parent_table = dict_table_open_on_id( + aux_table->parent_id, true, + DICT_TABLE_OP_NORMAL); + + ut_ad(parent_table != NULL); + ut_ad(parent_table->fts != NULL); + + if (!DICT_TF2_FLAG_IS_SET( + parent_table, + DICT_TF2_FTS_AUX_HEX_NAME)) { + rename = true; + } + + dict_table_close(parent_table, TRUE, FALSE); + } + + if (!rename) { + /* Reassign the original value of + aux table if it is not in decimal format */ + aux_table->parent_id = orig_parent_id; + aux_table->index_id = orig_index_id; + } } - if (table) { - dict_table_close(table, TRUE, FALSE); + if (table != NULL) { + dict_table_close(table, true, false); + } + + if (!rename) { + /* Check the validity of the parent table. */ + if (!fts_valid_parent_table(aux_table)) { + drop = true; + } + } + + /* Filter out the fake aux table by comparing with the + current valid auxiliary table name . */ + for (ulint count = 0; + count < ib_vector_size(invalid_aux_tables); count++) { + fts_aux_table_t* invalid_aux; + invalid_aux = static_cast( + ib_vector_get(invalid_aux_tables, count)); + if (strcmp(invalid_aux->name, aux_table->name) == 0) { + ib_vector_remove( + invalid_aux_tables, + *reinterpret_cast(invalid_aux)); + break; + } + } + + ib_vector_push(valid_aux_tables, aux_table); + + /* If the index associated with aux table is corrupted, + skip it. */ + if (fts_check_corrupt_index(aux_table) > 0) { + + if (i + 1 < ib_vector_size(tables)) { + next_aux_table = static_cast( + ib_vector_get(tables, i + 1)); + } + + if (next_aux_table == NULL + || orig_parent_id != next_aux_table->parent_id) { + + parent_table = dict_table_open_on_id( + aux_table->parent_id, TRUE, + DICT_TABLE_OP_NORMAL); + + if (!ib_vector_is_empty(aux_tables_to_rename)) { + fts_rename_aux_tables_to_hex_format( + aux_tables_to_rename, parent_table); + + } else { + fts_set_parent_hex_format_flag( + parent_table, trx); + } + + dict_table_close(parent_table, TRUE, FALSE); + } + + continue; } -#endif /* _WIN32 */ parent_table = dict_table_open_on_id( aux_table->parent_id, TRUE, DICT_TABLE_OP_NORMAL); - if (parent_table == NULL || parent_table->fts == NULL) { - - drop = true; - - } else if (aux_table->index_id != 0) { - index_id_t id; - fts_t* fts; - - drop = true; - fts = parent_table->fts; - id = aux_table->index_id; - - /* Search for the FT index in the table's list. */ - for (ulint j = 0; - j < ib_vector_size(fts->indexes); - ++j) { - - const dict_index_t* index; - - index = static_cast( - ib_vector_getp_const(fts->indexes, j)); - - if (index->id == id) { - drop = false; - break; - } - } - } - if (drop) { - - ib_logf(IB_LOG_LEVEL_WARN, - "Parent table of FTS auxiliary table %s not " - "found.", aux_table->name); - - dberr_t err = fts_drop_table(trx, aux_table->name); - - if (err == DB_FAIL) { - char* path; - - path = fil_make_ibd_name( - aux_table->name, false); - - os_file_delete_if_exists(innodb_file_data_key, - path); - - mem_free(path); - } + ib_vector_push(drop_aux_tables, aux_table); } else { if (FTS_IS_OBSOLETE_AUX_TABLE(aux_table->name)) { @@ -6483,49 +6881,13 @@ fts_check_and_drop_orphaned_tables( This could happen when we try to upgrade from older server to later one, which doesn't contain these obsolete tables. */ - drop = true; - - dberr_t err; - trx_t* trx_drop = - trx_allocate_for_background(); - - trx_drop->op_info = "Drop obsolete aux tables"; - trx_drop->dict_operation_lock_mode = RW_X_LATCH; - - trx_start_for_ddl(trx_drop, TRX_DICT_OP_TABLE); - - err = row_drop_table_for_mysql( - aux_table->name, trx_drop, false, true); - - trx_drop->dict_operation_lock_mode = 0; - - if (err != DB_SUCCESS) { - /* We don't need to worry about the - failure, since server would try to - drop it on next restart, even if - the table was broken. */ - - ib_logf(IB_LOG_LEVEL_WARN, - "Fail to drop obsolete aux" - " table '%s', which is" - " harmless. will try to drop" - " it on next restart.", - aux_table->name); - - fts_sql_rollback(trx_drop); - } else { - ib_logf(IB_LOG_LEVEL_INFO, - "Dropped obsolete aux" - " table '%s'.", - aux_table->name); - - fts_sql_commit(trx_drop); - } - - trx_free_for_background(trx_drop); + ib_vector_push(obsolete_aux_tables, aux_table); + continue; } } -#ifdef _WIN32 + + /* If the aux table is in decimal format, we should + rename it, so push it to aux_tables_to_rename */ if (!drop && rename) { ib_vector_push(aux_tables_to_rename, aux_table); } @@ -6543,38 +6905,16 @@ fts_check_and_drop_orphaned_tables( them if necessary. We had better use a new background trx to rename rather than the original trx, in case any failure would cause a complete rollback. */ - dberr_t err; - trx_t* trx_rename = trx_allocate_for_background(); - trx_rename->op_info = "Rename aux tables to " - "hex format"; - trx_rename->dict_operation_lock_mode = RW_X_LATCH; - trx_start_for_ddl(trx_rename, TRX_DICT_OP_TABLE); + ut_ad(rename); + ut_ad(!DICT_TF2_FLAG_IS_SET( + parent_table, DICT_TF2_FTS_AUX_HEX_NAME)); - err = fts_rename_aux_tables_to_hex_format(trx_rename, - parent_table, aux_tables_to_rename); - - trx_rename->dict_operation_lock_mode = 0; - - if (err != DB_SUCCESS) { - ib_logf(IB_LOG_LEVEL_WARN, - "Rollback operations on all " - "aux tables of table %s. " - "Please check why renaming aux tables " - "failed, and restart the server to " - "upgrade again to " - "get the table work.", - parent_table->name); - - fts_sql_rollback(trx_rename); - } else { - fts_sql_commit(trx_rename); - } - - trx_free_for_background(trx_rename); - ib_vector_reset(aux_tables_to_rename); + fts_rename_aux_tables_to_hex_format( + aux_tables_to_rename,parent_table); } -#else /* _WIN32 */ - if (!drop) { + + /* The IDs are already in correct hex format. */ + if (!drop && !rename) { dict_table_t* table; table = dict_table_open_on_id( @@ -6589,6 +6929,16 @@ fts_check_and_drop_orphaned_tables( && !DICT_TF2_FLAG_IS_SET( table, DICT_TF2_FTS_AUX_HEX_NAME)) { + + DBUG_EXECUTE_IF("aux_table_flag_fail", + ib_logf(IB_LOG_LEVEL_WARN, + "Setting aux table %s to hex " + "format failed.", table->name); + fts_set_index_corrupt( + trx, aux_table->index_id, + parent_table); + goto table_exit;); + dberr_t err = fts_update_hex_format_flag( trx, table->id, true); @@ -6596,49 +6946,44 @@ fts_check_and_drop_orphaned_tables( ib_logf(IB_LOG_LEVEL_WARN, "Setting aux table %s to hex " "format failed.", table->name); + + fts_set_index_corrupt( + trx, aux_table->index_id, + parent_table); } else { DICT_TF2_FLAG_SET(table, DICT_TF2_FTS_AUX_HEX_NAME); } } +#ifndef DBUG_OFF +table_exit: +#endif /* !DBUG_OFF */ if (table != NULL) { dict_table_close(table, TRUE, FALSE); } ut_ad(parent_table != NULL); - if (!DICT_TF2_FLAG_IS_SET(parent_table, - DICT_TF2_FTS_AUX_HEX_NAME)) { - dberr_t err = fts_update_hex_format_flag( - trx, parent_table->id, true); - if (err != DB_SUCCESS) { - ib_logf(IB_LOG_LEVEL_WARN, - "Setting parent table %s of " - "FTS auxiliary %s to hex " - "format failed.", - parent_table->name, - aux_table->name); - } else { - DICT_TF2_FLAG_SET(parent_table, - DICT_TF2_FTS_AUX_HEX_NAME); - } - } + fts_set_parent_hex_format_flag( + parent_table, trx); } -#endif /* _WIN32 */ - - if (parent_table) { + if (parent_table != NULL) { dict_table_close(parent_table, TRUE, FALSE); } } -#ifdef _WIN32 + fts_drop_aux_table_from_vector(trx, invalid_aux_tables); + fts_drop_aux_table_from_vector(trx, drop_aux_tables); + fts_sql_commit(trx); + + fts_drop_obsolete_aux_table_from_vector(obsolete_aux_tables); + /* Free the memory allocated at the beginning */ if (heap != NULL) { mem_heap_free(heap); } -#endif /* _WIN32 */ } /**********************************************************************//** @@ -6737,7 +7082,6 @@ fts_drop_orphaned_tables(void) if (error == DB_SUCCESS) { fts_check_and_drop_orphaned_tables(trx, tables); - fts_sql_commit(trx); break; /* Exit the loop. */ } else { ib_vector_reset(tables); diff --git a/fts/fts0opt.cc b/fts/fts0opt.cc index 910a00cd521..2e2bd061d07 100644 --- a/fts/fts0opt.cc +++ b/fts/fts0opt.cc @@ -190,6 +190,8 @@ cycle for a table. */ struct fts_slot_t { dict_table_t* table; /*!< Table to optimize */ + table_id_t table_id; /*!< Table id */ + fts_state_t state; /*!< State of this slot */ ulint added; /*!< Number of doc ids added since the @@ -2575,6 +2577,8 @@ fts_optimize_add_table( return; } + ut_ad(table->cached && table->fts != NULL); + /* Make sure table with FTS index cannot be evicted */ if (table->can_be_evicted) { dict_table_move_from_lru_to_non_lru(table); @@ -2741,6 +2745,7 @@ fts_optimize_new_table( memset(slot, 0x0, sizeof(*slot)); slot->table = table; + slot->table_id = table->id; slot->state = FTS_STATE_LOADED; slot->interval_time = FTS_OPTIMIZE_INTERVAL_IN_SECS; @@ -2865,7 +2870,8 @@ fts_is_sync_needed( slot = static_cast( ib_vector_get_const(tables, i)); - if (slot->table && slot->table->fts) { + if (slot->state != FTS_STATE_EMPTY && slot->table + && slot->table->fts) { total_memory += slot->table->fts->cache->total_size; } @@ -2948,6 +2954,7 @@ fts_optimize_thread( ib_wqueue_t* wq = (ib_wqueue_t*) arg; ut_ad(!srv_read_only_mode); + my_thread_init(); heap = mem_heap_create(sizeof(dict_table_t*) * 64); heap_alloc = ib_heap_allocator_create(heap); @@ -3076,9 +3083,11 @@ fts_optimize_thread( if (slot->state != FTS_STATE_EMPTY) { dict_table_t* table = NULL; - table = dict_table_open_on_name( - slot->table->name, FALSE, FALSE, - DICT_ERR_IGNORE_INDEX_ROOT); + /*slot->table may be freed, so we try to open + table by slot->table_id.*/ + table = dict_table_open_on_id( + slot->table_id, FALSE, + DICT_TABLE_OP_NORMAL); if (table) { @@ -3101,6 +3110,7 @@ fts_optimize_thread( ib_logf(IB_LOG_LEVEL_INFO, "FTS optimize thread exiting."); os_event_set(exit_event); + 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/handler/ha_innodb.cc b/handler/ha_innodb.cc index dd7bb3c687f..a73f9921513 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -3204,7 +3204,7 @@ innobase_init( innobase_hton->flush_logs = innobase_flush_logs; innobase_hton->show_status = innobase_show_status; innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS | - HTON_SUPPORTS_ONLINE_BACKUPS; + HTON_SUPPORTS_ONLINE_BACKUPS | HTON_SUPPORTS_FOREIGN_KEYS; innobase_hton->release_temporary_latches = innobase_release_temporary_latches; @@ -12758,6 +12758,7 @@ ha_innobase::start_stmt( thr_lock_type lock_type) { trx_t* trx; + DBUG_ENTER("ha_innobase::start_stmt"); update_thd(thd); @@ -12781,6 +12782,29 @@ ha_innobase::start_stmt( prebuilt->hint_need_to_fetch_extra_cols = 0; reset_template(); + if (dict_table_is_temporary(prebuilt->table) + && prebuilt->mysql_has_locked + && prebuilt->select_lock_type == LOCK_NONE) { + dberr_t error; + + switch (thd_sql_command(thd)) { + case SQLCOM_INSERT: + case SQLCOM_UPDATE: + case SQLCOM_DELETE: + init_table_handle_for_HANDLER(); + prebuilt->select_lock_type = LOCK_X; + prebuilt->stored_select_lock_type = LOCK_X; + error = row_lock_table_for_mysql(prebuilt, NULL, 1); + + if (error != DB_SUCCESS) { + int st = convert_error_code_to_mysql( + error, 0, thd); + DBUG_RETURN(st); + } + break; + } + } + if (!prebuilt->mysql_has_locked) { /* This handle is for a temporary table created inside this same LOCK TABLES; since MySQL does NOT call external_lock @@ -12818,7 +12842,7 @@ ha_innobase::start_stmt( ++trx->will_lock; } - return(0); + DBUG_RETURN(0); } /******************************************************************//** @@ -18536,3 +18560,28 @@ innobase_convert_to_system_charset( return(strconvert( cs1, from, cs2, to, static_cast(len), errors)); } + +/********************************************************************** +Issue a warning that the row is too big. */ +void +ib_warn_row_too_big(const dict_table_t* table) +{ + /* If prefix is true then a 768-byte prefix is stored + locally for BLOB fields. Refer to dict_table_get_format() */ + const bool prefix = (dict_tf_get_format(table->flags) + == UNIV_FORMAT_A); + + const ulint free_space = page_get_free_space_of_empty( + table->flags & DICT_TF_COMPACT) / 2; + + THD* thd = current_thd; + + push_warning_printf( + thd, Sql_condition::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW, + "Row size too large (> %lu). Changing some columns to TEXT" + " or BLOB %smay help. In current row format, BLOB prefix of" + " %d bytes is stored inline.", free_space + , prefix ? "or using ROW_FORMAT=DYNAMIC or" + " ROW_FORMAT=COMPRESSED ": "" + , prefix ? DICT_MAX_FIXED_COL_LEN : 0); +} diff --git a/handler/handler0alter.cc b/handler/handler0alter.cc index 09b0a397c3d..d3308ebedc2 100644 --- a/handler/handler0alter.cc +++ b/handler/handler0alter.cc @@ -3303,9 +3303,7 @@ ha_innobase::prepare_inplace_alter_table( ulint fts_doc_col_no = ULINT_UNDEFINED; bool add_fts_doc_id = false; bool add_fts_doc_id_idx = false; -#ifdef _WIN32 bool add_fts_idx = false; -#endif /* _WIN32 */ DBUG_ENTER("prepare_inplace_alter_table"); DBUG_ASSERT(!ha_alter_info->handler_ctx); @@ -3454,9 +3452,7 @@ check_if_ok_to_rename: & ~(HA_FULLTEXT | HA_PACK_KEY | HA_BINARY_PACK_KEY))); -#ifdef _WIN32 add_fts_idx = true; -#endif /* _WIN32 */ continue; } @@ -3467,19 +3463,16 @@ check_if_ok_to_rename: } } -#ifdef _WIN32 /* We won't be allowed to add fts index to a table with fts indexes already but without AUX_HEX_NAME set. This means the aux tables of the table failed to rename to hex format but new created aux tables - shall be in hex format, which is contradictory. - It's only for Windows. */ + shall be in hex format, which is contradictory. */ if (!DICT_TF2_FLAG_IS_SET(indexed_table, DICT_TF2_FTS_AUX_HEX_NAME) && indexed_table->fts != NULL && add_fts_idx) { my_error(ER_INNODB_FT_AUX_NOT_HEX_ID, MYF(0)); goto err_exit_no_heap; } -#endif /* _WIN32 */ /* Check existing index definitions for too-long column prefixes as well, in case max_col_len shrunk. */ diff --git a/ibuf/ibuf0ibuf.cc b/ibuf/ibuf0ibuf.cc index 3969d284a97..ef6c9c74558 100644 --- a/ibuf/ibuf0ibuf.cc +++ b/ibuf/ibuf0ibuf.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2014, 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 @@ -4660,7 +4660,7 @@ ibuf_merge_or_delete_for_page( function. When the counter is > 0, that prevents tablespace from being dropped. */ - tablespace_being_deleted = fil_inc_pending_ops(space); + tablespace_being_deleted = fil_inc_pending_ops(space, true); if (UNIV_UNLIKELY(tablespace_being_deleted)) { /* Do not try to read the bitmap page from space; diff --git a/include/btr0cur.ic b/include/btr0cur.ic index 080866c7465..43ee3304c0e 100644 --- a/include/btr0cur.ic +++ b/include/btr0cur.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2014, 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 @@ -28,7 +28,7 @@ Created 10/16/1994 Heikki Tuuri #ifdef UNIV_DEBUG # define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE)\ -if (btr_cur_limit_optimistic_insert_debug\ +if (btr_cur_limit_optimistic_insert_debug > 1\ && (NREC) >= (ulint)btr_cur_limit_optimistic_insert_debug) {\ CODE;\ } diff --git a/include/buf0buf.h b/include/buf0buf.h index 9f10f5824d2..50012933448 100644 --- a/include/buf0buf.h +++ b/include/buf0buf.h @@ -1356,7 +1356,10 @@ buf_pool_watch_is_sentinel( const buf_page_t* bpage) /*!< in: block */ __attribute__((nonnull, warn_unused_result)); /****************************************************************//** -Add watch for the given page to be read in. Caller must have the buffer pool +Add watch for the given page to be read in. Caller must have +appropriate hash_lock for the bpage and hold the LRU list mutex to avoid a race +condition with buf_LRU_free_page inserting the same page into the page hash. +This function may release the hash_lock and reacquire it. @return NULL if watch set, block if the page is in the buffer pool */ UNIV_INTERN buf_page_t* diff --git a/include/dict0dict.h b/include/dict0dict.h index fae10755f48..a52de9de11a 100644 --- a/include/dict0dict.h +++ b/include/dict0dict.h @@ -82,7 +82,7 @@ dict_get_referenced_table( mem_heap_t* heap); /*!< in: heap memory */ /*********************************************************************//** Frees a foreign key struct. */ -UNIV_INTERN + void dict_foreign_free( /*==============*/ diff --git a/include/fil0fil.h b/include/fil0fil.h index f7ff367484e..c5ac9d7de83 100644 --- a/include/fil0fil.h +++ b/include/fil0fil.h @@ -42,6 +42,7 @@ Created 10/25/1995 Heikki Tuuri #include +extern my_bool lower_case_file_system; // Forward declaration struct trx_t; struct fil_space_t; @@ -407,7 +408,8 @@ UNIV_INTERN ibool fil_inc_pending_ops( /*================*/ - ulint id); /*!< in: space id */ + ulint id, /*!< in: space id */ + ibool print_err); /*!< in: need to print error or not */ /*******************************************************************//** Decrements the count of pending operations. */ UNIV_INTERN diff --git a/include/fts0priv.ic b/include/fts0priv.ic index 8ef877f267e..2d07c60f980 100644 --- a/include/fts0priv.ic +++ b/include/fts0priv.ic @@ -37,18 +37,38 @@ fts_write_object_id( /* in: true for fixed hex format, false for old ambiguous format */ { + #ifdef _WIN32 - /* Use this to construct old(5.6.14 and 5.7.3) ambiguous - aux table names */ + + DBUG_EXECUTE_IF("innodb_test_wrong_non_windows_fts_aux_table_name", + return(sprintf(str, UINT64PFx, id));); + + /* Use this to construct old(5.6.14 and 5.7.3) windows + ambiguous aux table names */ DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name", return(sprintf(str, "%016llu", id));); +#else /* _WIN32 */ + + /* Use this to construct old(5.6.14 and 5.7.3) windows + ambiguous aux table names */ + DBUG_EXECUTE_IF("innodb_test_wrong_windows_fts_aux_table_name", + return(sprintf(str, "%016"PRIu64, id));); + + DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name", + return(sprintf(str, UINT64PFx, id));); + +#endif /* _WIN32 */ + /* As above, but this is only for those tables failing to rename. */ if (!hex_format) { +#ifdef _WIN32 // FIXME: Use ut_snprintf(), so does following one. return(sprintf(str, "%016llu", id)); - } +#else /* _WIN32 */ + return(sprintf(str, "%016"PRIu64, id)); #endif /* _WIN32 */ + } return(sprintf(str, UINT64PFx, id)); } diff --git a/include/lock0lock.h b/include/lock0lock.h index 633e4f6626b..cb95c58fe3c 100644 --- a/include/lock0lock.h +++ b/include/lock0lock.h @@ -291,7 +291,7 @@ lock_rec_insert_check_and_lock( inserted record maybe should inherit LOCK_GAP type locks from the successor record */ - __attribute__((nonnull, warn_unused_result)); + __attribute__((nonnull(2,3,4,6,7), warn_unused_result)); /*********************************************************************//** Checks if locks of other transactions prevent an immediate modify (update, delete mark, or delete unmark) of a clustered index record. If they do, diff --git a/include/trx0rec.h b/include/trx0rec.h index 50da55d2ea3..96e7d595035 100644 --- a/include/trx0rec.h +++ b/include/trx0rec.h @@ -233,7 +233,7 @@ trx_undo_report_row_operation( inserted undo log record, 0 if BTR_NO_UNDO_LOG flag was specified */ - __attribute__((nonnull(3,4,10), warn_unused_result)); + __attribute__((nonnull(4,10), warn_unused_result)); /******************************************************************//** Copies an undo record to heap. This function can be called if we know that the undo log record exists. diff --git a/include/univ.i b/include/univ.i index 914d7317229..a1eedb416ad 100644 --- a/include/univ.i +++ b/include/univ.i @@ -47,7 +47,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 70.0 +#define PERCONA_INNODB_VERSION 71.0 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ @@ -121,6 +121,10 @@ if we are compiling on Windows. */ # include # endif +# ifdef HAVE_MALLOC_H +# include +# endif + /* We only try to do explicit inlining of functions with gcc and Sun Studio */ diff --git a/lock/lock0lock.cc b/lock/lock0lock.cc index 94092ea13b3..6cfb8aa0f72 100644 --- a/lock/lock0lock.cc +++ b/lock/lock0lock.cc @@ -5404,6 +5404,7 @@ loop: ulint space = lock->un_member.rec_lock.space; ulint zip_size= fil_space_get_zip_size(space); ulint page_no = lock->un_member.rec_lock.page_no; + ibool tablespace_being_deleted = FALSE; if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) { @@ -5424,14 +5425,31 @@ loop: if (srv_show_verbose_locks) { - mtr_start(&mtr); + DEBUG_SYNC_C("innodb_monitor_before_lock_page_read"); - buf_page_get_gen(space, zip_size, page_no, - RW_NO_LATCH, NULL, - BUF_GET_POSSIBLY_FREED, - __FILE__, __LINE__, &mtr); + /* Check if the space is exists or not. only + when the space is valid, try to get the page. */ + tablespace_being_deleted + = fil_inc_pending_ops(space, false); - mtr_commit(&mtr); + if (!tablespace_being_deleted) { + mtr_start(&mtr); + + buf_page_get_gen(space, zip_size, + page_no, RW_NO_LATCH, + NULL, + BUF_GET_POSSIBLY_FREED, + __FILE__, __LINE__, + &mtr); + + mtr_commit(&mtr); + + fil_decr_pending_ops(space); + } else { + fprintf(file, "RECORD LOCKS on" + " non-existing space %lu\n", + (ulong) space); + } } load_page_first = FALSE; @@ -5859,7 +5877,7 @@ lock_rec_block_validate( /* Make sure that the tablespace is not deleted while we are trying to access the page. */ - if (!fil_inc_pending_ops(space)) { + if (!fil_inc_pending_ops(space, true)) { mtr_start(&mtr); block = buf_page_get_gen( space, fil_space_get_zip_size(space), @@ -5959,6 +5977,7 @@ lock_rec_insert_check_and_lock( ut_ad(!dict_index_is_online_ddl(index) || dict_index_is_clust(index) || (flags & BTR_CREATE_FLAG)); + ut_ad((flags & BTR_NO_LOCKING_FLAG) || thr); if (flags & BTR_NO_LOCKING_FLAG) { diff --git a/log/log0log.cc b/log/log0log.cc index aab0b3913ab..18736636c98 100644 --- a/log/log0log.cc +++ b/log/log0log.cc @@ -225,7 +225,7 @@ log_buffer_extend( { ulint move_start; ulint move_end; - byte tmp_buf[OS_FILE_LOG_BLOCK_SIZE]; + byte* tmp_buf = static_cast(alloca(OS_FILE_LOG_BLOCK_SIZE)); mutex_enter(&(log_sys->mutex)); @@ -2932,9 +2932,9 @@ log_archive_do( ulint* n_bytes)/*!< out: archive log buffer size, 0 if nothing to archive */ { - ibool calc_new_limit; - ib_uint64_t start_lsn; - ib_uint64_t limit_lsn; + ibool calc_new_limit; + lsn_t start_lsn; + lsn_t limit_lsn = LSN_MAX; calc_new_limit = TRUE; loop: @@ -3596,8 +3596,14 @@ loop: lsn = log_sys->lsn; - if (lsn != log_sys->last_checkpoint_lsn - || (srv_track_changed_pages && (tracked_lsn != log_sys->last_checkpoint_lsn)) + ut_ad(srv_force_recovery != SRV_FORCE_NO_LOG_REDO + || lsn == log_sys->last_checkpoint_lsn + LOG_BLOCK_HDR_SIZE); + + + if ((srv_force_recovery != SRV_FORCE_NO_LOG_REDO + && lsn != log_sys->last_checkpoint_lsn) + || (srv_track_changed_pages + && (tracked_lsn != log_sys->last_checkpoint_lsn)) #ifdef UNIV_LOG_ARCHIVE || (srv_log_archive_on && lsn != log_sys->archived_lsn + LOG_BLOCK_HDR_SIZE) diff --git a/log/log0recv.cc b/log/log0recv.cc index 649cd7665ec..fd35fda83c7 100644 --- a/log/log0recv.cc +++ b/log/log0recv.cc @@ -3090,7 +3090,8 @@ recv_recovery_from_checkpoint_start_func( #endif /* UNIV_LOG_ARCHIVE */ byte* buf; byte* log_hdr_buf; - byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE]; + byte* log_hdr_buf_base = static_cast + (alloca(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE)); dberr_t err; ut_when_dtor tmp(recv_sys->dblwr); diff --git a/os/os0thread.cc b/os/os0thread.cc index f3cfdc1b7b0..a862022693c 100644 --- a/os/os0thread.cc +++ b/os/os0thread.cc @@ -138,6 +138,9 @@ os_thread_create_func( os_thread_id_t* thread_id) /*!< out: id of the created thread, or NULL */ { + /* the new thread should look recent changes up here so far. */ + os_wmb; + #ifdef __WIN__ os_thread_t thread; DWORD win_thread_id; diff --git a/page/page0zip.cc b/page/page0zip.cc index f5f655deea7..67dca183c6d 100644 --- a/page/page0zip.cc +++ b/page/page0zip.cc @@ -4893,8 +4893,15 @@ page_zip_verify_checksum( stored = static_cast(mach_read_from_4( static_cast(data) + FIL_PAGE_SPACE_OR_CHKSUM)); - /* declare empty pages non-corrupted */ - if (stored == 0) { +#if FIL_PAGE_LSN % 8 +#error "FIL_PAGE_LSN must be 64 bit aligned" +#endif + + /* Check if page is empty */ + if (stored == 0 + && *reinterpret_cast(static_cast( + data) + + FIL_PAGE_LSN) == 0) { /* make sure that the page is really empty */ ulint i; for (i = 0; i < size; i++) { @@ -4902,7 +4909,7 @@ page_zip_verify_checksum( return(FALSE); } } - + /* Empty page */ return(TRUE); } diff --git a/row/row0mysql.cc b/row/row0mysql.cc index 5c96e476ff1..7d486eaf53b 100644 --- a/row/row0mysql.cc +++ b/row/row0mysql.cc @@ -3780,6 +3780,10 @@ row_drop_table_for_mysql( pars_info_t* info = NULL; mem_heap_t* heap = NULL; + DBUG_ENTER("row_drop_table_for_mysql"); + + DBUG_PRINT("row_drop_table_for_mysql", ("table: %s", name)); + ut_a(name != NULL); if (srv_created_new_raw) { @@ -3789,7 +3793,7 @@ row_drop_table_for_mysql( "InnoDB: Shut down mysqld and edit my.cnf so that newraw" " is replaced with raw.\n", stderr); - return(DB_ERROR); + DBUG_RETURN(DB_ERROR); } /* The table name is prefixed with the database name and a '/'. @@ -4417,7 +4421,7 @@ funct_exit: srv_wake_master_thread(); - return(err); + DBUG_RETURN(err); } /*********************************************************************//** diff --git a/srv/srv0srv.cc b/srv/srv0srv.cc index 6bdd8da708c..806c3aea70a 100644 --- a/srv/srv0srv.cc +++ b/srv/srv0srv.cc @@ -1559,15 +1559,6 @@ srv_printf_innodb_monitor( srv_n_rows_deleted_old = srv_stats.n_rows_deleted; srv_n_rows_read_old = srv_stats.n_rows_read; - /* Only if lock_print_info_summary proceeds correctly, - before we call the lock_print_info_all_transactions - to print all the lock information. */ - ret = lock_print_info_summary(file, nowait); - - if (ret) { - lock_print_info_all_transactions(file); - } - fputs("----------------------------\n" "END OF INNODB MONITOR OUTPUT\n" "============================\n", file); diff --git a/srv/srv0start.cc b/srv/srv0start.cc index 94b489eb118..1ace7f8c930 100644 --- a/srv/srv0start.cc +++ b/srv/srv0start.cc @@ -1549,8 +1549,8 @@ innobase_start_or_create_for_mysql(void) lsn_t min_flushed_lsn; lsn_t max_flushed_lsn; #ifdef UNIV_LOG_ARCHIVE - lsn_t min_arch_log_no; - lsn_t max_arch_log_no; + lsn_t min_arch_log_no = LSN_MAX; + lsn_t max_arch_log_no = LSN_MAX; #endif /* UNIV_LOG_ARCHIVE */ ulint sum_of_new_sizes; ulint sum_of_data_file_sizes; diff --git a/sync/sync0rw.cc b/sync/sync0rw.cc index 017bdbed6b5..a72730e1877 100644 --- a/sync/sync0rw.cc +++ b/sync/sync0rw.cc @@ -326,6 +326,7 @@ rw_lock_free_func( ib_mutex_t* mutex; #endif /* !INNODB_RW_LOCKS_USE_ATOMICS */ + os_rmb; ut_ad(rw_lock_validate(lock)); ut_a(lock->lock_word == X_LOCK_DECR); From 2877c5ecc22ab0323ab86ce548a81909d7c865c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 19 Jan 2015 12:39:17 +0200 Subject: [PATCH 175/201] MDEV-7477: Make innochecksum work on compressed tables This patch ports the work that facebook has performed to make innochecksum handle compressed tables. the basic idea is to use actual innodb-code to perform checksum verification rather than duplicating in innochecksum.cc. to make this work, innodb code has been annotated with lots of #ifndef UNIV_INNOCHECKSUM so that it can be compiled outside of storage/innobase. A new testcase is also added that verifies that innochecksum works on compressed/non-compressed tables. Merged from commit fabc79d2ea976c4ff5b79bfe913e6bc03ef69d42 from https://code.google.com/p/google-mysql/ The actual steps to produce this patch are: take innochecksum from 5.6.14 apply changes in innodb from facebook patches needed to make innochecksum compile apply changes in innochecksum from facebook patches add handcrafted testcase The referenced facebook patches used are: https://github.com/facebook/mysql-5.6/commit/91e25120e75272db4cdbc07d0e45877d9dea5715 https://github.com/facebook/mysql-5.6/commit/847fe76ea5239b09fa361b023c56e6be76d32046 https://github.com/facebook/mysql-5.6/commit/1135628a5a9b3412621b93233478f3804bcef51a https://github.com/facebook/mysql-5.6/commit/4dbf7c240ce2f08b7d6572d9452c9779ce90641c --- extra/CMakeLists.txt | 22 +- extra/innochecksum.c | 325 ------------ extra/innochecksum.cc | 470 ++++++++++++++++++ mysql-test/mysql-test-run.pl | 11 + mysql-test/suite/innodb/r/innochecksum.result | 31 ++ mysql-test/suite/innodb/t/innochecksum.opt | 2 + mysql-test/suite/innodb/t/innochecksum.test | 70 +++ storage/innobase/buf/buf0checksum.cc | 5 +- storage/innobase/include/buf0buf.h | 3 - storage/innobase/include/buf0checksum.h | 9 +- storage/innobase/include/fil0fil.h | 9 +- storage/innobase/include/mach0data.ic | 8 + storage/innobase/include/page0page.h | 14 + storage/innobase/include/page0page.ic | 19 +- storage/innobase/include/page0types.h | 2 + storage/innobase/include/page0zip.h | 18 +- storage/innobase/include/rem0rec.h | 4 + storage/innobase/include/srv0srv.h | 1 - storage/innobase/include/trx0undo.h | 8 + storage/innobase/include/univ.i | 2 +- storage/innobase/include/ut0ut.h | 5 + storage/innobase/page/page0zip.cc | 22 +- 22 files changed, 713 insertions(+), 347 deletions(-) delete mode 100644 extra/innochecksum.c create mode 100644 extra/innochecksum.cc create mode 100644 mysql-test/suite/innodb/r/innochecksum.result create mode 100644 mysql-test/suite/innodb/t/innochecksum.opt create mode 100644 mysql-test/suite/innodb/t/innochecksum.test diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index f8f71b00743..585b5aef6f6 100644 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -75,11 +75,29 @@ ENDIF() MYSQL_ADD_EXECUTABLE(replace replace.c COMPONENT Server) TARGET_LINK_LIBRARIES(replace mysys) IF(UNIX) - MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.c) - MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c) TARGET_LINK_LIBRARIES(resolve_stack_dump mysys) MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client) TARGET_LINK_LIBRARIES(mysql_waitpid mysys) ENDIF() + + + # Add path to the InnoDB headers + INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/storage/innobase/include + ${CMAKE_SOURCE_DIR}/sql) + + # We use the InnoDB code directly in case the code changes. + ADD_DEFINITIONS("-DUNIV_INNOCHECKSUM") + SET(INNOBASE_SOURCES + ../storage/innobase/buf/buf0checksum.cc + ../storage/innobase/ut/ut0crc32.cc + ../storage/innobase/ut/ut0ut.cc + ../storage/innobase/page/page0zip.cc + ) + + MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES}) + TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl) + ADD_DEPENDENCIES(innochecksum GenError) + diff --git a/extra/innochecksum.c b/extra/innochecksum.c deleted file mode 100644 index ed4dfc48789..00000000000 --- a/extra/innochecksum.c +++ /dev/null @@ -1,325 +0,0 @@ -/* - Copyright (c) 2005, 2011, Oracle and/or its affiliates - - 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 -*/ - -/* - InnoDB offline file checksum utility. 85% of the code in this file - was taken wholesale fron the InnoDB codebase. - - The final 15% was originally written by Mark Smith of Danga - Interactive, Inc. - - Published with a permission. -*/ - -#include -#include -#include -#include -#include -#include -#include - -/* all of these ripped from InnoDB code from MySQL 4.0.22 */ -#define UT_HASH_RANDOM_MASK 1463735687 -#define UT_HASH_RANDOM_MASK2 1653893711 -#define FIL_PAGE_LSN 16 -#define FIL_PAGE_FILE_FLUSH_LSN 26 -#define FIL_PAGE_OFFSET 4 -#define FIL_PAGE_DATA 38 -#define FIL_PAGE_END_LSN_OLD_CHKSUM 8 -#define FIL_PAGE_SPACE_OR_CHKSUM 0 -#define UNIV_PAGE_SIZE (2 * 8192) - -/* command line argument to do page checks (that's it) */ -/* another argument to specify page ranges... seek to right spot and go from there */ - -typedef unsigned long int ulint; - -/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */ -ulint mach_read_from_4(uchar *b) -{ - return( ((ulint)(b[0]) << 24) - + ((ulint)(b[1]) << 16) - + ((ulint)(b[2]) << 8) - + (ulint)(b[3]) - ); -} - -ulint -ut_fold_ulint_pair( -/*===============*/ - /* out: folded value */ - ulint n1, /* in: ulint */ - ulint n2) /* in: ulint */ -{ - return(((((n1 ^ n2 ^ UT_HASH_RANDOM_MASK2) << 8) + n1) - ^ UT_HASH_RANDOM_MASK) + n2); -} - -ulint -ut_fold_binary( -/*===========*/ - /* out: folded value */ - uchar* str, /* in: string of bytes */ - ulint len) /* in: length */ -{ - ulint i; - ulint fold= 0; - - for (i= 0; i < len; i++) - { - fold= ut_fold_ulint_pair(fold, (ulint)(*str)); - - str++; - } - - return(fold); -} - -ulint -buf_calc_page_new_checksum( -/*=======================*/ - /* out: checksum */ - uchar* page) /* in: buffer page */ -{ - ulint checksum; - - /* Since the fields FIL_PAGE_FILE_FLUSH_LSN and ..._ARCH_LOG_NO - are written outside the buffer pool to the first pages of data - files, we have to skip them in the page checksum calculation. - We must also skip the field FIL_PAGE_SPACE_OR_CHKSUM where the - checksum is stored, and also the last 8 bytes of page because - there we store the old formula checksum. */ - - checksum= ut_fold_binary(page + FIL_PAGE_OFFSET, - FIL_PAGE_FILE_FLUSH_LSN - FIL_PAGE_OFFSET) - + ut_fold_binary(page + FIL_PAGE_DATA, - UNIV_PAGE_SIZE - FIL_PAGE_DATA - - FIL_PAGE_END_LSN_OLD_CHKSUM); - checksum= checksum & 0xFFFFFFFF; - - return(checksum); -} - -ulint -buf_calc_page_old_checksum( -/*=======================*/ - /* out: checksum */ - uchar* page) /* in: buffer page */ -{ - ulint checksum; - - checksum= ut_fold_binary(page, FIL_PAGE_FILE_FLUSH_LSN); - - checksum= checksum & 0xFFFFFFFF; - - return(checksum); -} - - -int main(int argc, char **argv) -{ - FILE *f; /* our input file */ - uchar *p; /* storage of pages read */ - int bytes; /* bytes read count */ - ulint ct; /* current page number (0 based) */ - int now; /* current time */ - int lastt; /* last time */ - ulint oldcsum, oldcsumfield, csum, csumfield, logseq, logseqfield; /* ulints for checksum storage */ - struct stat st; /* for stat, if you couldn't guess */ - unsigned long long int size; /* size of file (has to be 64 bits) */ - ulint pages; /* number of pages in file */ - ulint start_page= 0, end_page= 0, use_end_page= 0; /* for starting and ending at certain pages */ - off_t offset= 0; - int just_count= 0; /* if true, just print page count */ - int verbose= 0; - int debug= 0; - int c; - int fd; - - /* remove arguments */ - while ((c= getopt(argc, argv, "cvds:e:p:")) != -1) - { - switch (c) - { - case 'v': - verbose= 1; - break; - case 'c': - just_count= 1; - break; - case 's': - start_page= atoi(optarg); - break; - case 'e': - end_page= atoi(optarg); - use_end_page= 1; - break; - case 'p': - start_page= atoi(optarg); - end_page= atoi(optarg); - use_end_page= 1; - break; - case 'd': - debug= 1; - break; - case ':': - fprintf(stderr, "option -%c requires an argument\n", optopt); - return 1; - break; - case '?': - fprintf(stderr, "unrecognized option: -%c\n", optopt); - return 1; - break; - } - } - - /* debug implies verbose... */ - if (debug) verbose= 1; - - /* make sure we have the right arguments */ - if (optind >= argc) - { - printf("InnoDB offline file checksum utility.\n"); - printf("usage: %s [-c] [-s ] [-e ] [-p ] [-v] [-d] \n", argv[0]); - printf("\t-c\tprint the count of pages in the file\n"); - printf("\t-s n\tstart on this page number (0 based)\n"); - printf("\t-e n\tend at this page number (0 based)\n"); - printf("\t-p n\tcheck only this page (0 based)\n"); - printf("\t-v\tverbose (prints progress every 5 seconds)\n"); - printf("\t-d\tdebug mode (prints checksums for each page)\n"); - return 1; - } - - /* stat the file to get size and page count */ - if (stat(argv[optind], &st)) - { - perror("error statting file"); - return 1; - } - size= st.st_size; - pages= size / UNIV_PAGE_SIZE; - if (just_count) - { - printf("%lu\n", pages); - return 0; - } - else if (verbose) - { - printf("file %s = %llu bytes (%lu pages)...\n", argv[optind], size, pages); - printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1)); - } - - /* open the file for reading */ - f= fopen(argv[optind], "r"); - if (!f) - { - perror("error opening file"); - return 1; - } - - /* seek to the necessary position */ - if (start_page) - { - fd= fileno(f); - if (!fd) - { - perror("unable to obtain file descriptor number"); - return 1; - } - - offset= (off_t)start_page * (off_t)UNIV_PAGE_SIZE; - - if (lseek(fd, offset, SEEK_SET) != offset) - { - perror("unable to seek to necessary offset"); - return 1; - } - } - - /* allocate buffer for reading (so we don't realloc every time) */ - p= (uchar *)malloc(UNIV_PAGE_SIZE); - - /* main checksumming loop */ - ct= start_page; - lastt= 0; - while (!feof(f)) - { - bytes= fread(p, 1, UNIV_PAGE_SIZE, f); - if (!bytes && feof(f)) return 0; - if (bytes != UNIV_PAGE_SIZE) - { - fprintf(stderr, "bytes read (%d) doesn't match universal page size (%d)\n", bytes, UNIV_PAGE_SIZE); - return 1; - } - - /* check the "stored log sequence numbers" */ - logseq= mach_read_from_4(p + FIL_PAGE_LSN + 4); - logseqfield= mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4); - if (debug) - printf("page %lu: log sequence number: first = %lu; second = %lu\n", ct, logseq, logseqfield); - if (logseq != logseqfield) - { - fprintf(stderr, "page %lu invalid (fails log sequence number check)\n", ct); - return 1; - } - - /* check old method of checksumming */ - oldcsum= buf_calc_page_old_checksum(p); - oldcsumfield= mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM); - if (debug) - printf("page %lu: old style: calculated = %lu; recorded = %lu\n", ct, oldcsum, oldcsumfield); - if (oldcsumfield != mach_read_from_4(p + FIL_PAGE_LSN) && oldcsumfield != oldcsum) - { - fprintf(stderr, "page %lu invalid (fails old style checksum)\n", ct); - return 1; - } - - /* now check the new method */ - csum= buf_calc_page_new_checksum(p); - csumfield= mach_read_from_4(p + FIL_PAGE_SPACE_OR_CHKSUM); - if (debug) - printf("page %lu: new style: calculated = %lu; recorded = %lu\n", ct, csum, csumfield); - if (csumfield != 0 && csum != csumfield) - { - fprintf(stderr, "page %lu invalid (fails new style checksum)\n", ct); - return 1; - } - - /* end if this was the last page we were supposed to check */ - if (use_end_page && (ct >= end_page)) - return 0; - - /* do counter increase and progress printing */ - ct++; - if (verbose) - { - if (ct % 64 == 0) - { - now= time(0); - if (!lastt) lastt= now; - if (now - lastt >= 1) - { - printf("page %lu okay: %.3f%% done\n", (ct - 1), (float) ct / pages * 100); - lastt= now; - } - } - } - } - return 0; -} - diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc new file mode 100644 index 00000000000..5a0f7c630d3 --- /dev/null +++ b/extra/innochecksum.cc @@ -0,0 +1,470 @@ +/* + Copyright (c) 2005, 2012, 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 +*/ + +/* + InnoDB offline file checksum utility. 85% of the code in this utility + is included from the InnoDB codebase. + + The final 15% was originally written by Mark Smith of Danga + Interactive, Inc. + + Published with a permission. +*/ + +#include +#include +#include +#include +#include +#include +#ifndef __WIN__ +# include +#endif +#include +#include +#include /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ +#include + +/* Only parts of these files are included from the InnoDB codebase. +The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */ + +#include "univ.i" /* include all of this */ + +#define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE) +#define FSEG_PAGE_DATA FIL_PAGE_DATA + +#include "ut0ut.h" +#include "ut0byte.h" +#include "mach0data.h" +#include "fsp0types.h" +#include "rem0rec.h" +#include "buf0checksum.h" /* buf_calc_page_*() */ +#include "fil0fil.h" /* FIL_* */ +#include "page0page.h" /* PAGE_* */ +#include "page0zip.h" /* page_zip_*() */ +#include "trx0undo.h" /* TRX_* */ +#include "fsp0fsp.h" /* fsp_flags_get_page_size() & + fsp_flags_get_zip_size() */ +#include "mach0data.h" /* mach_read_from_4() */ +#include "ut0crc32.h" /* ut_crc32_init() */ + +#ifdef UNIV_NONINL +# include "fsp0fsp.ic" +# include "mach0data.ic" +# include "ut0rnd.ic" +#endif + +/* Global variables */ +static my_bool verbose; +static my_bool debug; +static my_bool skip_corrupt; +static my_bool just_count; +static ulong start_page; +static ulong end_page; +static ulong do_page; +static my_bool use_end_page; +static my_bool do_one_page; +ulong srv_page_size; /* replaces declaration in srv0srv.c */ +static ulong physical_page_size; /* Page size in bytes on disk. */ +static ulong logical_page_size; /* Page size when uncompressed. */ +static bool compressed= false; /* Is tablespace compressed */ + +/* Get the page size of the filespace from the filespace header. */ +static +my_bool +get_page_size( +/*==========*/ + FILE* f, /*!< in: file pointer, must be open + and set to start of file */ + byte* buf, /*!< in: buffer used to read the page */ + ulong* logical_page_size, /*!< out: Logical/Uncompressed page size */ + ulong* physical_page_size) /*!< out: Physical/Commpressed page size */ +{ + ulong flags; + + int bytes= fread(buf, 1, UNIV_PAGE_SIZE_MIN, f); + + if (ferror(f)) + { + perror("Error reading file header"); + return FALSE; + } + + if (bytes != UNIV_PAGE_SIZE_MIN) + { + fprintf(stderr, "Error; Was not able to read the minimum page size "); + fprintf(stderr, "of %d bytes. Bytes read was %d\n", UNIV_PAGE_SIZE_MIN, bytes); + return FALSE; + } + + rewind(f); + + flags = mach_read_from_4(buf + FIL_PAGE_DATA + FSP_SPACE_FLAGS); + + /* srv_page_size is used by InnoDB code as UNIV_PAGE_SIZE */ + srv_page_size = *logical_page_size = fsp_flags_get_page_size(flags); + + /* fsp_flags_get_zip_size() will return zero if not compressed. */ + *physical_page_size = fsp_flags_get_zip_size(flags); + if (*physical_page_size == 0) + { + *physical_page_size= *logical_page_size; + } + else + { + compressed= true; + } + return TRUE; +} + + +/* command line argument to do page checks (that's it) */ +/* another argument to specify page ranges... seek to right spot and go from there */ + +static struct my_option innochecksum_options[] = +{ + {"help", '?', "Displays this help and exits.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"info", 'I', "Synonym for --help.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"version", 'V', "Displays version information and exits.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Verbose (prints progress every 5 seconds).", + &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", 'd', "Debug mode (prints checksums for each page, implies verbose).", + &debug, &debug, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"skip_corrupt", 'u', "Skip corrupt pages.", + &skip_corrupt, &skip_corrupt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"count", 'c', "Print the count of pages in the file.", + &just_count, &just_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"start_page", 's', "Start on this page number (0 based).", + &start_page, &start_page, 0, GET_ULONG, REQUIRED_ARG, + 0, 0, (longlong) 2L*1024L*1024L*1024L, 0, 1, 0}, + {"end_page", 'e', "End at this page number (0 based).", + &end_page, &end_page, 0, GET_ULONG, REQUIRED_ARG, + 0, 0, (longlong) 2L*1024L*1024L*1024L, 0, 1, 0}, + {"page", 'p', "Check only this page (0 based).", + &do_page, &do_page, 0, GET_ULONG, REQUIRED_ARG, + 0, 0, (longlong) 2L*1024L*1024L*1024L, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + +static void print_version(void) +{ + printf("%s Ver %s, for %s (%s)\n", + my_progname, INNODB_VERSION_STR, + SYSTEM_TYPE, MACHINE_TYPE); +} + +static void usage(void) +{ + print_version(); + puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000")); + printf("InnoDB offline file checksum utility.\n"); + printf("Usage: %s [-c] [-s ] [-e ] [-p ] [-v] [-d] \n", my_progname); + my_print_help(innochecksum_options); + my_print_variables(innochecksum_options); +} + +extern "C" my_bool +innochecksum_get_one_option( +/*========================*/ + int optid, + const struct my_option *opt __attribute__((unused)), + char *argument __attribute__((unused))) +{ + switch (optid) { + case 'd': + verbose=1; /* debug implies verbose... */ + break; + case 'e': + use_end_page= 1; + break; + case 'p': + end_page= start_page= do_page; + use_end_page= 1; + do_one_page= 1; + break; + case 'V': + print_version(); + exit(0); + break; + case 'I': + case '?': + usage(); + exit(0); + break; + } + return 0; +} + +static int get_options( +/*===================*/ + int *argc, + char ***argv) +{ + int ho_error; + + if ((ho_error=handle_options(argc, argv, innochecksum_options, innochecksum_get_one_option))) + exit(ho_error); + + /* The next arg must be the filename */ + if (!*argc) + { + usage(); + return 1; + } + return 0; +} /* get_options */ + +int main(int argc, char **argv) +{ + FILE* f; /* our input file */ + char* filename; /* our input filename. */ + unsigned char *big_buf, *buf; + + ulong bytes; /* bytes read count */ + ulint ct; /* current page number (0 based) */ + time_t now; /* current time */ + time_t lastt; /* last time */ + ulint oldcsum, oldcsumfield, csum, csumfield, crc32, logseq, logseqfield; + /* ulints for checksum storage */ + struct stat st; /* for stat, if you couldn't guess */ + unsigned long long int size; /* size of file (has to be 64 bits) */ + ulint pages; /* number of pages in file */ + off_t offset= 0; + int fd; + + printf("InnoDB offline file checksum utility.\n"); + + ut_crc32_init(); + + MY_INIT(argv[0]); + + if (get_options(&argc,&argv)) + exit(1); + + if (verbose) + my_print_variables(innochecksum_options); + + /* The file name is not optional */ + filename = *argv; + if (*filename == '\0') + { + fprintf(stderr, "Error; File name missing\n"); + return 1; + } + + /* stat the file to get size and page count */ + if (stat(filename, &st)) + { + fprintf(stderr, "Error; %s cannot be found\n", filename); + return 1; + } + size= st.st_size; + + /* Open the file for reading */ + f= fopen(filename, "rb"); + if (f == NULL) + { + fprintf(stderr, "Error; %s cannot be opened", filename); + perror(" "); + return 1; + } + + big_buf = (unsigned char *)malloc(2 * UNIV_PAGE_SIZE_MAX); + if (big_buf == NULL) + { + fprintf(stderr, "Error; failed to allocate memory\n"); + perror(""); + return 1; + } + + /* Make sure the page is aligned */ + buf = (unsigned char*)ut_align_down(big_buf + + UNIV_PAGE_SIZE_MAX, UNIV_PAGE_SIZE_MAX); + + if (!get_page_size(f, buf, &logical_page_size, &physical_page_size)) + { + free(big_buf); + return 1; + } + + if (compressed) + { + printf("Table is compressed\n"); + printf("Key block size is %lu\n", physical_page_size); + } + else + { + printf("Table is uncompressed\n"); + printf("Page size is %lu\n", physical_page_size); + } + + pages= (ulint) (size / physical_page_size); + + if (just_count) + { + if (verbose) + printf("Number of pages: "); + printf("%lu\n", pages); + free(big_buf); + return 0; + } + else if (verbose) + { + printf("file %s = %llu bytes (%lu pages)...\n", filename, size, pages); + if (do_one_page) + printf("InnoChecksum; checking page %lu\n", do_page); + else + printf("InnoChecksum; checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1)); + } + +#ifdef UNIV_LINUX + if (posix_fadvise(fileno(f), 0, 0, POSIX_FADV_SEQUENTIAL) || + posix_fadvise(fileno(f), 0, 0, POSIX_FADV_NOREUSE)) + { + perror("posix_fadvise failed"); + } +#endif + + /* seek to the necessary position */ + if (start_page) + { + fd= fileno(f); + if (!fd) + { + perror("Error; Unable to obtain file descriptor number"); + free(big_buf); + return 1; + } + + offset= (off_t)start_page * (off_t)physical_page_size; + + if (lseek(fd, offset, SEEK_SET) != offset) + { + perror("Error; Unable to seek to necessary offset"); + free(big_buf); + return 1; + } + } + + /* main checksumming loop */ + ct= start_page; + lastt= 0; + while (!feof(f)) + { + bytes= fread(buf, 1, physical_page_size, f); + if (!bytes && feof(f)) + { + free(big_buf); + return 0; + } + + if (ferror(f)) + { + fprintf(stderr, "Error reading %lu bytes", physical_page_size); + perror(" "); + free(big_buf); + return 1; + } + + if (compressed) { + /* compressed pages */ + if (!page_zip_verify_checksum(buf, physical_page_size)) { + fprintf(stderr, "Fail; page %lu invalid (fails compressed page checksum).\n", ct); + if (!skip_corrupt) + { + free(big_buf); + return 1; + } + } + } else { + + /* check the "stored log sequence numbers" */ + logseq= mach_read_from_4(buf + FIL_PAGE_LSN + 4); + logseqfield= mach_read_from_4(buf + logical_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM + 4); + if (debug) + printf("page %lu: log sequence number: first = %lu; second = %lu\n", ct, logseq, logseqfield); + if (logseq != logseqfield) + { + fprintf(stderr, "Fail; page %lu invalid (fails log sequence number check)\n", ct); + if (!skip_corrupt) + { + free(big_buf); + return 1; + } + } + + /* check old method of checksumming */ + oldcsum= buf_calc_page_old_checksum(buf); + oldcsumfield= mach_read_from_4(buf + logical_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM); + if (debug) + printf("page %lu: old style: calculated = %lu; recorded = %lu\n", ct, oldcsum, oldcsumfield); + if (oldcsumfield != mach_read_from_4(buf + FIL_PAGE_LSN) && oldcsumfield != oldcsum) + { + fprintf(stderr, "Fail; page %lu invalid (fails old style checksum)\n", ct); + if (!skip_corrupt) + { + free(big_buf); + return 1; + } + } + + /* now check the new method */ + csum= buf_calc_page_new_checksum(buf); + crc32= buf_calc_page_crc32(buf); + csumfield= mach_read_from_4(buf + FIL_PAGE_SPACE_OR_CHKSUM); + if (debug) + printf("page %lu: new style: calculated = %lu; crc32 = %lu; recorded = %lu\n", + ct, csum, crc32, csumfield); + if (csumfield != 0 && crc32 != csumfield && csum != csumfield) + { + fprintf(stderr, "Fail; page %lu invalid (fails innodb and crc32 checksum)\n", ct); + if (!skip_corrupt) + { + free(big_buf); + return 1; + } + } + } + /* end if this was the last page we were supposed to check */ + if (use_end_page && (ct >= end_page)) + { + free(big_buf); + return 0; + } + + /* do counter increase and progress printing */ + ct++; + if (verbose) + { + if (ct % 64 == 0) + { + now= time(0); + if (!lastt) lastt= now; + if (now - lastt >= 1) + { + printf("page %lu okay: %.3f%% done\n", (ct - 1), (float) ct / pages * 100); + lastt= now; + } + } + } + } + free(big_buf); + return 0; +} diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d60ff9000a4..a1cacb2099b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2491,6 +2491,17 @@ sub environment_setup { "$bindir/sql$opt_vs_config/mysql_tzinfo_to_sql"); $ENV{'MYSQL_TZINFO_TO_SQL'}= native_path($exe_mysql_tzinfo_to_sql); + # ---------------------------------------------------- + # innochecksum + # ---------------------------------------------------- + my $exe_innochecksum= + mtr_exe_maybe_exists("$bindir/extra$opt_vs_config/innochecksum", + "$path_client_bindir/innochecksum"); + if ($exe_innochecksum) + { + $ENV{'INNOCHECKSUM'}= native_path($exe_innochecksum); + } + # Create an environment variable to make it possible # to detect that valgrind is being used from test cases $ENV{'VALGRIND_TEST'}= $opt_valgrind; diff --git a/mysql-test/suite/innodb/r/innochecksum.result b/mysql-test/suite/innodb/r/innochecksum.result new file mode 100644 index 00000000000..c75e83e5ed7 --- /dev/null +++ b/mysql-test/suite/innodb/r/innochecksum.result @@ -0,0 +1,31 @@ +# Create and populate a table +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; +INSERT INTO t1 (b) VALUES ('corrupt me'); +INSERT INTO t1 (b) VALUES ('corrupt me'); +CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) +ROW_FORMAT=COMPRESSED ENGINE=InnoDB ; +INSERT INTO t2(b) SELECT b from t1; +CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) +ROW_FORMAT=COMPRESSED ENGINE=InnoDB KEY_BLOCK_SIZE=16; +INSERT INTO t3(b) SELECT b from t1; +# Write file to make mysql-test-run.pl expect the "crash", but don't +# start it until it's told to +# We give 30 seconds to do a clean shutdown because we do not want +# to redo apply the pages of t1.ibd at the time of recovery. +# We want SQL to initiate the first access to t1.ibd. +# Wait until disconnected. +# Run innochecksum on t1 +InnoDB offline file checksum utility. +Table is uncompressed +Page size is 16384 +# Run innochecksum on t2 +InnoDB offline file checksum utility. +Table is compressed +Key block size is 8192 +# Run innochecksum on t3 +InnoDB offline file checksum utility. +Table is compressed +Key block size is 16384 +# Write file to make mysql-test-run.pl start up the server again +# Cleanup +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/innodb/t/innochecksum.opt b/mysql-test/suite/innodb/t/innochecksum.opt new file mode 100644 index 00000000000..cc738d97434 --- /dev/null +++ b/mysql-test/suite/innodb/t/innochecksum.opt @@ -0,0 +1,2 @@ +--innodb_file_per_table=1 +--innodb_file_format=Barracuda diff --git a/mysql-test/suite/innodb/t/innochecksum.test b/mysql-test/suite/innodb/t/innochecksum.test new file mode 100644 index 00000000000..34df2801880 --- /dev/null +++ b/mysql-test/suite/innodb/t/innochecksum.test @@ -0,0 +1,70 @@ +# +# Test innochecksum +# + +# Don't test under embedded +source include/not_embedded.inc; +# Require InnoDB +source include/have_innodb.inc; + +if (!$INNOCHECKSUM) { + --echo Need innochecksum binary + --die Need innochecksum binary +} + +--echo # Create and populate a table +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; +INSERT INTO t1 (b) VALUES ('corrupt me'); +--disable_query_log +--let $i = 1000 +while ($i) +{ + INSERT INTO t1 (b) VALUES (REPEAT('abcdefghijklmnopqrstuvwxyz', 100)); + dec $i; +} +--enable_query_log +INSERT INTO t1 (b) VALUES ('corrupt me'); + +CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) +ROW_FORMAT=COMPRESSED ENGINE=InnoDB ; + +INSERT INTO t2(b) SELECT b from t1; + +CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) +ROW_FORMAT=COMPRESSED ENGINE=InnoDB KEY_BLOCK_SIZE=16; + +INSERT INTO t3(b) SELECT b from t1; + +let $MYSQLD_DATADIR=`select @@datadir`; +let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd; +let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd; +let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd; + +--echo # Write file to make mysql-test-run.pl expect the "crash", but don't +--echo # start it until it's told to +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # We give 30 seconds to do a clean shutdown because we do not want +--echo # to redo apply the pages of t1.ibd at the time of recovery. +--echo # We want SQL to initiate the first access to t1.ibd. +shutdown_server 30; + +--echo # Wait until disconnected. +--source include/wait_until_disconnected.inc + +--echo # Run innochecksum on t1 +--exec $INNOCHECKSUM $t1_IBD + +--echo # Run innochecksum on t2 +--exec $INNOCHECKSUM $t2_IBD + +--echo # Run innochecksum on t3 +--exec $INNOCHECKSUM $t3_IBD + +--echo # Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Cleanup +DROP TABLE t1, t2, t3; diff --git a/storage/innobase/buf/buf0checksum.cc b/storage/innobase/buf/buf0checksum.cc index ec79bbe6be9..4ba65d6f2d0 100644 --- a/storage/innobase/buf/buf0checksum.cc +++ b/storage/innobase/buf/buf0checksum.cc @@ -27,20 +27,21 @@ Created Aug 11, 2011 Vasil Dimov #include "fil0fil.h" /* FIL_* */ #include "ut0crc32.h" /* ut_crc32() */ #include "ut0rnd.h" /* ut_fold_binary() */ +#include "buf0checksum.h" #ifndef UNIV_INNOCHECKSUM #include "srv0srv.h" /* SRV_CHECKSUM_* */ #include "buf0types.h" +#endif /* !UNIV_INNOCHECKSUM */ + /** the macro MYSQL_SYSVAR_ENUM() requires "long unsigned int" and if we use srv_checksum_algorithm_t here then we get a compiler error: ha_innodb.cc:12251: error: cannot convert 'srv_checksum_algorithm_t*' to 'long unsigned int*' in initialization */ UNIV_INTERN ulong srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_INNODB; -#endif /* !UNIV_INNOCHECKSUM */ - /********************************************************************//** Calculates a page CRC32 which is stored to the page when it is written to a file. Note that we must be careful to calculate the same value on diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 31ec6b9ef8b..3097015999c 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -96,9 +96,6 @@ extern buf_block_t* back_block1; /*!< first block, for --apply-log */ extern buf_block_t* back_block2; /*!< second block, for page reorganize */ #endif /* !UNIV_HOTBACKUP */ -/** Magic value to use instead of checksums when they are disabled */ -#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL - /** @brief States of a control block @see buf_page_t diff --git a/storage/innobase/include/buf0checksum.h b/storage/innobase/include/buf0checksum.h index cd21781dc6e..6818345f965 100644 --- a/storage/innobase/include/buf0checksum.h +++ b/storage/innobase/include/buf0checksum.h @@ -28,11 +28,10 @@ Created Aug 11, 2011 Vasil Dimov #include "univ.i" -#ifndef UNIV_INNOCHECKSUM - #include "buf0types.h" -#endif /* !UNIV_INNOCHECKSUM */ +/** Magic value to use instead of checksums when they are disabled */ +#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL /********************************************************************//** Calculates a page CRC32 which is stored to the page when it is written @@ -70,8 +69,6 @@ buf_calc_page_old_checksum( /*=======================*/ const byte* page); /*!< in: buffer page */ -#ifndef UNIV_INNOCHECKSUM - /********************************************************************//** Return a printable string describing the checksum algorithm. @return algorithm name */ @@ -83,6 +80,4 @@ buf_checksum_algorithm_name( extern ulong srv_checksum_algorithm; -#endif /* !UNIV_INNOCHECKSUM */ - #endif /* buf0checksum_h */ diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 798423eeddd..55559bdd999 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -65,11 +65,16 @@ of the address is FIL_NULL, the address is considered undefined. */ typedef byte fil_faddr_t; /*!< 'type' definition in C: an address stored in a file page is a string of bytes */ + +#endif /* !UNIV_INNOCHECKSUM */ + #define FIL_ADDR_PAGE 0 /* first in address is the page offset */ #define FIL_ADDR_BYTE 4 /* then comes 2-byte byte offset within page*/ #define FIL_ADDR_SIZE 6 /* address size is 6 bytes */ +#ifndef UNIV_INNOCHECKSUM + /** File space address */ struct fil_addr_t{ ulint page; /*!< page number within a space */ @@ -140,8 +145,6 @@ extern fil_addr_t fil_addr_null; #define FIL_PAGE_DATA_END 8 /*!< size of the page trailer */ /* @} */ -#ifndef UNIV_INNOCHECKSUM - /** File page types (values of FIL_PAGE_TYPE) @{ */ #define FIL_PAGE_INDEX 17855 /*!< B-tree node */ #define FIL_PAGE_UNDO_LOG 2 /*!< Undo log page */ @@ -166,6 +169,8 @@ extern fil_addr_t fil_addr_null; #define FIL_LOG 502 /*!< redo log */ /* @} */ +#ifndef UNIV_INNOCHECKSUM + /** The number of fsyncs done to the log */ extern ulint fil_n_log_flushes; diff --git a/storage/innobase/include/mach0data.ic b/storage/innobase/include/mach0data.ic index 7449d2da2b8..c46fcec107e 100644 --- a/storage/innobase/include/mach0data.ic +++ b/storage/innobase/include/mach0data.ic @@ -73,6 +73,8 @@ mach_write_to_2( b[1] = (byte)(n); } +#endif /* !UNIV_INNOCHECKSUM */ + /********************************************************//** The following function is used to fetch data from 2 consecutive bytes. The most significant byte is at the lowest address. @@ -86,6 +88,8 @@ mach_read_from_2( return(((ulint)(b[0]) << 8) | (ulint)(b[1])); } +#ifndef UNIV_INNOCHECKSUM + /********************************************************//** The following function is used to convert a 16-bit data item to the canonical format, for fast bytewise equality test @@ -295,6 +299,8 @@ mach_write_to_8( mach_write_to_4(static_cast(b) + 4, (ulint) n); } +#endif /* !UNIV_INNOCHECKSUM */ + /********************************************************//** The following function is used to fetch data from 8 consecutive bytes. The most significant byte is at the lowest address. @@ -313,6 +319,8 @@ mach_read_from_8( return(ull); } +#ifndef UNIV_INNOCHECKSUM + /*******************************************************//** The following function is used to store data in 7 consecutive bytes. We store the most significant byte to the lowest address. */ diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index b572f7abb49..cb6633bb941 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -29,6 +29,7 @@ Created 2/2/1994 Heikki Tuuri #include "univ.i" #include "page0types.h" +#ifndef UNIV_INNOCHECKSUM #include "fil0fil.h" #include "buf0buf.h" #include "data0data.h" @@ -42,6 +43,8 @@ Created 2/2/1994 Heikki Tuuri #define UNIV_INLINE #endif +#endif /* !UNIV_INNOCHECKSUM */ + /* PAGE HEADER =========== @@ -117,6 +120,8 @@ typedef byte page_header_t; a new-style compact page */ /*-----------------------------*/ +#ifndef UNIV_INNOCHECKSUM + /* Heap numbers */ #define PAGE_HEAP_NO_INFIMUM 0 /* page infimum */ #define PAGE_HEAP_NO_SUPREMUM 1 /* page supremum */ @@ -343,6 +348,7 @@ page_cmp_dtuple_rec_with_match( matched; when function returns contains the value for current comparison */ #endif /* !UNIV_HOTBACKUP */ +#endif /* !UNIV_INNOCHECKSUM */ /*************************************************************//** Gets the page number. @return page number */ @@ -351,6 +357,7 @@ ulint page_get_page_no( /*=============*/ const page_t* page); /*!< in: page */ +#ifndef UNIV_INNOCHECKSUM /*************************************************************//** Gets the tablespace identifier. @return space id */ @@ -359,6 +366,7 @@ ulint page_get_space_id( /*==============*/ const page_t* page); /*!< in: page */ +#endif /* !UNIV_INNOCHECKSUM */ /*************************************************************//** Gets the number of user records on page (the infimum and supremum records are not user records). @@ -368,6 +376,7 @@ ulint page_get_n_recs( /*============*/ const page_t* page); /*!< in: index page */ +#ifndef UNIV_INNOCHECKSUM /***************************************************************//** Returns the number of records before the given record in chain. The number includes infimum and supremum records. @@ -516,6 +525,7 @@ ulint page_rec_get_heap_no( /*=================*/ const rec_t* rec); /*!< in: the physical record */ +#endif /* !UNIV_INNOCHECKSUM */ /************************************************************//** Determine whether the page is a B-tree leaf. @return true if the page is a B-tree leaf (PAGE_LEVEL = 0) */ @@ -525,6 +535,7 @@ page_is_leaf( /*=========*/ const page_t* page) /*!< in: page */ __attribute__((nonnull, pure)); +#ifndef UNIV_INNOCHECKSUM /************************************************************//** Determine whether the page is empty. @return true if the page is empty (PAGE_N_RECS = 0) */ @@ -1115,8 +1126,11 @@ page_find_rec_max_not_deleted( #define UNIV_INLINE UNIV_INLINE_ORIGINAL #endif +#endif /* !UNIV_INNOCHECKSUM */ + #ifndef UNIV_NONINL #include "page0page.ic" #endif + #endif diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 9b81156708f..99e17001c0a 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -23,6 +23,8 @@ Index page routines Created 2/2/1994 Heikki Tuuri *******************************************************/ +#ifndef UNIV_INNOCHECKSUM + #include "mach0data.h" #ifdef UNIV_DEBUG # include "log0recv.h" @@ -38,6 +40,7 @@ Created 2/2/1994 Heikki Tuuri #define UNIV_INLINE #endif +#endif /* !UNIV_INNOCHECKSUM */ /************************************************************//** Gets the start of a page. @return start of the page */ @@ -49,6 +52,7 @@ page_align( { return((page_t*) ut_align_down(ptr, UNIV_PAGE_SIZE)); } +#ifndef UNIV_INNOCHECKSUM /************************************************************//** Gets the offset within a page. @return offset from the start of the page */ @@ -103,6 +107,7 @@ page_update_max_trx_id( } } +#endif /* !UNIV_INNOCHECKSUM */ /*************************************************************//** Reads the given header field. */ UNIV_INLINE @@ -118,6 +123,7 @@ page_header_get_field( return(mach_read_from_2(page + PAGE_HEADER + field)); } +#ifndef UNIV_INNOCHECKSUM /*************************************************************//** Sets the given header field. */ UNIV_INLINE @@ -223,6 +229,7 @@ page_header_reset_last_insert( } #endif /* !UNIV_HOTBACKUP */ +#endif /* !UNIV_INNOCHECKSUM */ /************************************************************//** Determine whether the page is in new-style compact format. @return nonzero if the page is in compact format, zero if it is in @@ -236,6 +243,7 @@ page_is_comp( return(page_header_get_field(page, PAGE_N_HEAP) & 0x8000); } +#ifndef UNIV_INNOCHECKSUM /************************************************************//** TRUE if the record is on a page in compact format. @return nonzero if in compact format */ @@ -264,6 +272,7 @@ page_rec_get_heap_no( } } +#endif /* !UNIV_INNOCHECKSUM */ /************************************************************//** Determine whether the page is a B-tree leaf. @return true if the page is a B-tree leaf (PAGE_LEVEL = 0) */ @@ -276,6 +285,7 @@ page_is_leaf( return(!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL))); } +#ifndef UNIV_INNOCHECKSUM /************************************************************//** Determine whether the page is empty. @return true if the page is empty (PAGE_N_RECS = 0) */ @@ -529,6 +539,7 @@ page_cmp_dtuple_rec_with_match( } #endif /* !UNIV_HOTBACKUP */ +#endif /* !UNIV_INNOCHECKSUM */ /*************************************************************//** Gets the page number. @return page number */ @@ -542,6 +553,7 @@ page_get_page_no( return(mach_read_from_4(page + FIL_PAGE_OFFSET)); } +#ifndef UNIV_INNOCHECKSUM /*************************************************************//** Gets the tablespace identifier. @return space id */ @@ -555,6 +567,7 @@ page_get_space_id( return(mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID)); } +#endif /* !UNIV_INNOCHECKSUM */ /*************************************************************//** Gets the number of user records on page (infimum and supremum records are not user records). @@ -568,6 +581,7 @@ page_get_n_recs( return(page_header_get_field(page, PAGE_N_RECS)); } +#ifndef UNIV_INNOCHECKSUM /*************************************************************//** Gets the number of dir slots in directory. @return number of slots */ @@ -958,6 +972,7 @@ page_rec_get_base_extra_size( return(REC_N_NEW_EXTRA_BYTES + (ulint) !page_rec_is_comp(rec)); } +#endif /* !UNIV_INNOCHECKSUM */ /************************************************************//** Returns the sum of the sizes of the records in the record list, excluding the infimum and supremum records. @@ -981,7 +996,7 @@ page_get_data_size( return(ret); } - +#ifndef UNIV_INNOCHECKSUM /************************************************************//** Allocates a block of memory from the free list of an index page. */ UNIV_INLINE @@ -1170,6 +1185,8 @@ page_mem_free( } } +#endif /* !UNIV_INNOCHECKSUM */ + #ifdef UNIV_MATERIALIZE #undef UNIV_INLINE #define UNIV_INLINE UNIV_INLINE_ORIGINAL diff --git a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h index 95143a4bb44..fb9250a5a3b 100644 --- a/storage/innobase/include/page0types.h +++ b/storage/innobase/include/page0types.h @@ -33,6 +33,8 @@ using namespace std; #include "univ.i" #include "dict0types.h" #include "mtr0types.h" +#include "sync0types.h" +#include "os0thread.h" /** Eliminates a name collision on HP-UX */ #define page_t ib_page_t diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index 9d3b78ed2fc..6fe6934e35c 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -1,3 +1,4 @@ + /***************************************************************************** Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved. @@ -32,13 +33,15 @@ Created June 2005 by Marko Makela # define UNIV_INLINE #endif -#include "mtr0types.h" #include "page0types.h" #include "buf0types.h" +#ifndef UNIV_INNOCHECKSUM +#include "mtr0types.h" #include "dict0types.h" #include "srv0srv.h" #include "trx0types.h" #include "mem0mem.h" +#endif /* !UNIV_INNOCHECKSUM */ /* Compression level to be used by zlib. Settable by user. */ extern uint page_zip_level; @@ -50,6 +53,7 @@ extern uint page_zip_level; compression algorithm changes in zlib. */ extern my_bool page_zip_log_pages; +#ifndef UNIV_INNOCHECKSUM /**********************************************************************//** Determine the size of a compressed page in bytes. @return size in bytes */ @@ -112,6 +116,7 @@ page_zip_set_alloc( /*===============*/ void* stream, /*!< in/out: zlib stream */ mem_heap_t* heap); /*!< in: memory heap to use */ +#endif /* !UNIV_INNOCHECKSUM */ /**********************************************************************//** Compress a page. @@ -147,6 +152,7 @@ page_zip_decompress( after page creation */ __attribute__((nonnull(1,2))); +#ifndef UNIV_INNOCHECKSUM #ifdef UNIV_DEBUG /**********************************************************************//** Validate a compressed page descriptor. @@ -158,6 +164,7 @@ page_zip_simple_validate( const page_zip_des_t* page_zip); /*!< in: compressed page descriptor */ #endif /* UNIV_DEBUG */ +#endif /* !UNIV_INNOCHECKSUM */ #ifdef UNIV_ZIP_DEBUG /**********************************************************************//** @@ -185,6 +192,7 @@ page_zip_validate( __attribute__((nonnull(1,2))); #endif /* UNIV_ZIP_DEBUG */ +#ifndef UNIV_INNOCHECKSUM /**********************************************************************//** Determine how big record can be inserted without recompressing the page. @return a positive number indicating the maximum size of a record @@ -418,6 +426,8 @@ page_zip_reorganize( dict_index_t* index, /*!< in: index of the B-tree node */ mtr_t* mtr) /*!< in: mini-transaction */ __attribute__((nonnull)); +#endif /* !UNIV_INNOCHECKSUM */ + #ifndef UNIV_HOTBACKUP /**********************************************************************//** Copy the records of a page byte for byte. Do not copy the page header @@ -474,6 +484,8 @@ page_zip_verify_checksum( /*=====================*/ const void* data, /*!< in: compressed page */ ulint size); /*!< in: size of compressed page */ + +#ifndef UNIV_INNOCHECKSUM /**********************************************************************//** Write a log record of compressing an index page without the data on the page. */ UNIV_INLINE @@ -506,6 +518,8 @@ void page_zip_reset_stat_per_index(); /*===========================*/ +#endif /* !UNIV_INNOCHECKSUM */ + #ifndef UNIV_HOTBACKUP /** Check if a pointer to an uncompressed page matches a compressed page. When we IMPORT a tablespace the blocks and accompanying frames are allocted @@ -531,8 +545,10 @@ from outside the buffer pool. # define UNIV_INLINE UNIV_INLINE_ORIGINAL #endif +#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_NONINL # include "page0zip.ic" #endif +#endif /* !UNIV_INNOCHECKSUM */ #endif /* page0zip_h */ diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 8e7d5ff2d48..cfd0f10642a 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -26,11 +26,13 @@ Created 5/30/1994 Heikki Tuuri #ifndef rem0rec_h #define rem0rec_h +#ifndef UNIV_INNOCHECKSUM #include "univ.i" #include "data0data.h" #include "rem0types.h" #include "mtr0types.h" #include "page0types.h" +#endif /* !UNIV_INNOCHECKSUM */ /* Info bit denoting the predefined minimum record: this bit is set if and only if the record is the first user record on a non-leaf @@ -88,6 +90,7 @@ offsets[] array, first passed to rec_get_offsets() */ #define REC_OFFS_NORMAL_SIZE 100 #define REC_OFFS_SMALL_SIZE 10 +#ifndef UNIV_INNOCHECKSUM /******************************************************//** The following function is used to get the pointer of the next chained record on the same page. @@ -985,4 +988,5 @@ two upmost bits in a two byte offset for special purposes */ #include "rem0rec.ic" #endif +#endif /* !UNIV_INNOCHECKSUM */ #endif diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index a3e6a17a6e2..d06a14a9153 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -361,7 +361,6 @@ extern my_bool srv_stats_sample_traditional; extern ibool srv_use_doublewrite_buf; extern ulong srv_doublewrite_batch_size; -extern ulong srv_checksum_algorithm; extern ibool srv_use_atomic_writes; #ifdef HAVE_POSIX_FALLOCATE diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 660551961a6..45733921212 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -26,6 +26,8 @@ Created 3/26/1996 Heikki Tuuri #ifndef trx0undo_h #define trx0undo_h +#ifndef UNIV_INNOCHECKSUM + #include "univ.i" #include "trx0types.h" #include "mtr0mtr.h" @@ -385,6 +387,8 @@ trx_undo_mem_free( /*==============*/ trx_undo_t* undo); /* in: the undo object to be freed */ +#endif /* !UNIV_INNOCHECKSUM */ + /* Types of an undo log segment */ #define TRX_UNDO_INSERT 1 /* contains undo entries for inserts */ #define TRX_UNDO_UPDATE 2 /* contains undo entries for updates @@ -403,6 +407,7 @@ trx_undo_mem_free( prepared transaction */ #ifndef UNIV_HOTBACKUP +#ifndef UNIV_INNOCHECKSUM /** Transaction undo log memory object; this is protected by the undo_mutex in the corresponding transaction object */ @@ -461,6 +466,7 @@ struct trx_undo_t{ /*!< undo log objects in the rollback segment are chained into lists */ }; +#endif /* !UNIV_INNOCHECKSUM */ #endif /* !UNIV_HOTBACKUP */ /** The offset of the undo log page header on pages of the undo log */ @@ -588,8 +594,10 @@ quite a large overhead. */ with the XA XID */ /* @} */ +#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_NONINL #include "trx0undo.ic" #endif +#endif /* !UNIV_INNOCHECKSUM */ #endif diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index eeeaca166a8..cb2e6613171 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -105,7 +105,7 @@ if we are compiling on Windows. */ /* Include the header file generated by GNU autoconf */ # ifndef __WIN__ # ifndef UNIV_HOTBACKUP -# include "config.h" +# include "my_config.h" # endif /* UNIV_HOTBACKUP */ # endif diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 7d1c3cd4f0b..939ccee6e3e 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -36,6 +36,8 @@ Created 1/20/1994 Heikki Tuuri # include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */ #endif /* UNIV_HOTBACKUP */ +#endif /* !UNIV_INNOCHECKSUM */ + #include #ifndef MYSQL_SERVER #include @@ -64,6 +66,7 @@ private: F& f; }; +#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_HOTBACKUP # if defined(HAVE_PAUSE_INSTRUCTION) /* According to the gcc info page, asm volatile means that the @@ -162,6 +165,7 @@ ut_pair_cmp( ulint a2, /*!< in: less significant part of first pair */ ulint b1, /*!< in: more significant part of second pair */ ulint b2); /*!< in: less significant part of second pair */ +#endif /* !UNIV_INNOCHECKSUM */ /*************************************************************//** Determines if a number is zero or a power of two. @param n in: number @@ -192,6 +196,7 @@ when m is a power of two. In other words, rounds n up to m * k. @param m in: alignment, must be a power of two @return n rounded up to the smallest possible integer multiple of m */ #define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~((m) - 1)) +#ifndef UNIV_INNOCHECKSUM /*************************************************************//** Calculates fast the 2-logarithm of a number, rounded upward to an integer. diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 6989953cb0c..85ee661a746 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -36,6 +36,10 @@ using namespace std; # include "page0zip.ic" #endif #undef THIS_MODULE +#include "fil0fil.h" +#include "buf0checksum.h" +#include "mach0data.h" +#ifndef UNIV_INNOCHECKSUM #include "page0page.h" #include "mtr0log.h" #include "ut0sort.h" @@ -43,15 +47,18 @@ using namespace std; #include "btr0cur.h" #include "page0types.h" #include "log0recv.h" +#endif /* !UNIV_INNOCHECKSUM */ #include "zlib.h" #ifndef UNIV_HOTBACKUP +#ifndef UNIV_INNOCHECKSUM # include "buf0buf.h" -# include "buf0lru.h" # include "btr0sea.h" # include "dict0boot.h" # include "lock0lock.h" -# include "srv0mon.h" # include "srv0srv.h" +#endif /* !UNIV_INNOCHECKSUM */ +# include "buf0lru.h" +# include "srv0mon.h" # include "ut0crc32.h" #else /* !UNIV_HOTBACKUP */ # include "buf0checksum.h" @@ -60,6 +67,7 @@ using namespace std; #endif /* !UNIV_HOTBACKUP */ #ifndef UNIV_HOTBACKUP +#ifndef UNIV_INNOCHECKSUM /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */ UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_SSIZE_MAX]; /** Statistics on compression, indexed by index->id */ @@ -69,6 +77,7 @@ UNIV_INTERN ib_mutex_t page_zip_stat_per_index_mutex; #ifdef HAVE_PSI_INTERFACE UNIV_INTERN mysql_pfs_key_t page_zip_stat_per_index_mutex_key; #endif /* HAVE_PSI_INTERFACE */ +#endif /* !UNIV_INNOCHECKSUM */ #endif /* !UNIV_HOTBACKUP */ /* Compression level to be used by zlib. Settable by user. */ @@ -117,6 +126,7 @@ Compare at most sizeof(field_ref_zero) bytes. /* Enable some extra debugging output. This code can be enabled independently of any UNIV_ debugging conditions. */ +#ifndef UNIV_INNOCHECKSUM #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG # include __attribute__((format (printf, 1, 2))) @@ -149,7 +159,9 @@ page_zip_fail_func( @param fmt_args ignored: printf(3) format string and arguments */ # define page_zip_fail(fmt_args) /* empty */ #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ +#endif /* !UNIV_INNOCHECKSUM */ +#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_HOTBACKUP /**********************************************************************//** Determine the guaranteed free space on an empty page. @@ -4838,6 +4850,7 @@ corrupt: return(ptr + 8 + size + trailer_size); } +#endif /* !UNIV_INNOCHECKSUM */ /**********************************************************************//** Calculate the compressed page checksum. @@ -4913,6 +4926,10 @@ page_zip_verify_checksum( stored = static_cast(mach_read_from_4( static_cast(data) + FIL_PAGE_SPACE_OR_CHKSUM)); +#ifndef UNIV_INNOCHECKSUM + /* innochecksum doesn't compile with ut_d. Since we don't + need to check for empty pages when running innochecksum, + just don't include this code. */ /* declare empty pages non-corrupted */ if (stored == 0) { /* make sure that the page is really empty */ @@ -4925,6 +4942,7 @@ page_zip_verify_checksum( return(TRUE); } +#endif calc = static_cast(page_zip_calc_checksum( data, size, static_cast( From f78078a840bc99c0225b10523e20d311a3b8187d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:07:22 +0100 Subject: [PATCH 176/201] mtr+valgrind: fix jemalloc check to work correctly for bundler and system jemalloc --- mysql-test/mysql-test-run.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a1cacb2099b..701dd30528b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -6187,7 +6187,6 @@ sub debugger_arguments { } } - # # Modify the exe and args so that program is run in valgrind # @@ -6209,10 +6208,14 @@ sub valgrind_arguments { if -f "$glob_mysql_test_dir/valgrind.supp"; # Ensure the jemalloc works with mysqld - if ($mysqld_variables{'version-malloc-library'} ne "system" && - $$exe =~ /mysqld/) + if ($$exe =~ /mysqld/) { - mtr_add_arg($args, "--soname-synonyms=somalloc=NONE" ); + my %somalloc=( + 'system jemalloc' => 'libjemalloc*', + 'bundled jemalloc' => 'NONE' + ); + my ($syn) = $somalloc{$mysqld_variables{'version-malloc-library'}}; + mtr_add_arg($args, '--soname-synonyms=somalloc=%s', $syn) if $syn; } } From b4cd8a8a5afd28d55d6ea2d795819098490c944e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:07:29 +0100 Subject: [PATCH 177/201] MDEV-7224 OQGraph compile error copy the workaround from 5.5 --- storage/oqgraph/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 151082469a9..1a59ae0f0dc 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -1,7 +1,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") MESSAGE(STATUS "Configuring OQGraph") -FIND_PACKAGE(Boost) +FIND_PACKAGE(Boost 1.40.0) IF(NOT Boost_FOUND) MESSAGE(STATUS "Boost not found. OQGraph will not be compiled") RETURN() From 56c323c10f4e37318255c9d386e650e1513322e1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:07:41 +0100 Subject: [PATCH 178/201] MDEV-6728 KILL QUERY executed on an idle connection can interrupt the next query reset KILL_QUERY when a new query execution is just about to be started --- mysql-test/r/kill_processlist-6619.result | 4 +++- mysql-test/r/kill_query-6728.result | 7 +++++++ mysql-test/r/show_check.result | 6 ------ mysql-test/t/kill_processlist-6619.test | 7 ++++++- mysql-test/t/kill_query-6728.test | 14 +++++++++++++ mysql-test/t/show_check.test | 25 ----------------------- mysql-test/t/sp_notembedded.test | 3 +++ sql/sql_class.h | 8 ++++++++ sql/sql_parse.cc | 7 ++----- 9 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 mysql-test/r/kill_query-6728.result create mode 100644 mysql-test/t/kill_query-6728.test diff --git a/mysql-test/r/kill_processlist-6619.result b/mysql-test/r/kill_processlist-6619.result index 588c8e6d139..8cb9fe7270c 100644 --- a/mysql-test/r/kill_processlist-6619.result +++ b/mysql-test/r/kill_processlist-6619.result @@ -3,10 +3,12 @@ SHOW PROCESSLIST; Id User Host db Command Time State Info Progress # root # test Sleep # # NULL 0.000 # root # test Query # # SHOW PROCESSLIST 0.000 +SET DEBUG_SYNC='before_execute_sql_command WAIT_FOR go'; +SHOW PROCESSLIST; connection default; KILL QUERY con_id; +SET DEBUG_SYNC='now SIGNAL go'; connection con1; -SHOW PROCESSLIST; ERROR 70100: Query execution was interrupted SHOW PROCESSLIST; Id User Host db Command Time State Info Progress diff --git a/mysql-test/r/kill_query-6728.result b/mysql-test/r/kill_query-6728.result new file mode 100644 index 00000000000..6638edebeea --- /dev/null +++ b/mysql-test/r/kill_query-6728.result @@ -0,0 +1,7 @@ +connect con1,localhost,root,,; +connection default; +kill query id; +connection con1; +select count(*) > 0 from mysql.user; +count(*) > 0 +1 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 6d6fd2e43d6..880c424391e 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1456,12 +1456,6 @@ GRANT PROCESS ON *.* TO test_u@localhost; SHOW ENGINE MYISAM MUTEX; SHOW ENGINE MYISAM STATUS; DROP USER test_u@localhost; -# -# Bug #48985: show create table crashes if previous access to the table -# was killed -# -SHOW CREATE TABLE non_existent; -ERROR 70100: Query execution was interrupted End of 5.1 tests # # Bug#52593 SHOW CREATE TABLE is blocked if table is locked diff --git a/mysql-test/t/kill_processlist-6619.test b/mysql-test/t/kill_processlist-6619.test index 2333f02eac6..472d2d57fb2 100644 --- a/mysql-test/t/kill_processlist-6619.test +++ b/mysql-test/t/kill_processlist-6619.test @@ -2,16 +2,21 @@ # MDEV-6619 SHOW PROCESSLIST returns empty result set after KILL QUERY # --source include/not_embedded.inc +--source include/have_debug_sync.inc + --enable_connect_log --connect (con1,localhost,root,,) --let $con_id = `SELECT CONNECTION_ID()` --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; +SET DEBUG_SYNC='before_execute_sql_command WAIT_FOR go'; +send SHOW PROCESSLIST; --connection default --replace_result $con_id con_id eval KILL QUERY $con_id; +SET DEBUG_SYNC='now SIGNAL go'; --connection con1 --error ER_QUERY_INTERRUPTED -SHOW PROCESSLIST; +reap; --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; diff --git a/mysql-test/t/kill_query-6728.test b/mysql-test/t/kill_query-6728.test new file mode 100644 index 00000000000..485256a65b6 --- /dev/null +++ b/mysql-test/t/kill_query-6728.test @@ -0,0 +1,14 @@ +# +# MDEV-6728 KILL QUERY executed on an idle connection can interrupt the next query +# +--enable_connect_log +--connect (con1,localhost,root,,) +let $id=`select connection_id()`; + +--connection default +--replace_result $id id +eval kill query $id; + +--connection con1 +select count(*) > 0 from mysql.user; + diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 14d50709921..c43193d1b57 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -1210,33 +1210,8 @@ disconnect conn1; connection default; DROP USER test_u@localhost; - ---echo # ---echo # Bug #48985: show create table crashes if previous access to the table ---echo # was killed ---echo # - -connect(con1,localhost,root,,); -CONNECTION con1; -LET $ID= `SELECT connection_id()`; - -CONNECTION default; ---disable_query_log -eval KILL QUERY $ID; ---enable_query_log - -CONNECTION con1; ---error ER_QUERY_INTERRUPTED -SHOW CREATE TABLE non_existent; - -DISCONNECT con1; ---source include/wait_until_disconnected.inc -CONNECTION default; - - --echo End of 5.1 tests - --echo # --echo # Bug#52593 SHOW CREATE TABLE is blocked if table is locked --echo # for write by another connection diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index dee6a7ee8f2..42a3dd193c4 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -374,6 +374,9 @@ CREATE VIEW v1 AS SELECT f1('a') FROM t1; --send SELECT * FROM v1 --connection default +let $wait_condition= + select count(*) = 2 from information_schema.processlist where state = "User sleep"; +--source include/wait_condition.inc --disable_query_log --eval KILL QUERY $ID_2 --eval KILL QUERY $ID_1 diff --git a/sql/sql_class.h b/sql/sql_class.h index 4ec16bff33d..5d64837a2c1 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3229,6 +3229,14 @@ public: mysql_mutex_unlock(&LOCK_thd_data); } } + inline void reset_kill_query() + { + if (killed < KILL_CONNECTION) + { + reset_killed(); + mysys_var->abort= 0; + } + } inline void send_kill_message() const { int err= killed_errno(); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3e200c6a000..88dc862df3e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1124,6 +1124,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->enable_slow_log= TRUE; thd->query_plan_flags= QPLAN_INIT; thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */ + thd->reset_kill_query(); DEBUG_SYNC(thd,"dispatch_command_before_set_time"); @@ -5111,11 +5112,7 @@ finish: if (! thd->get_stmt_da()->is_set()) thd->send_kill_message(); } - if (thd->killed < KILL_CONNECTION) - { - thd->reset_killed(); - thd->mysys_var->abort= 0; - } + thd->reset_kill_query(); } if (thd->is_error() || (thd->variables.option_bits & OPTION_MASTER_SQL_ERROR)) trans_rollback_stmt(thd); From 1f4ebbd6e0a7f5e8b640c51aaf8e7e9ab6d6ddd3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:07:51 +0100 Subject: [PATCH 179/201] MDEV-7184 main.key_cache fails in buildbot on Windows 32bit change the test not to use absolute values of Key_blocks_unused. --- mysql-test/r/key_cache.result | 64 +++++++++++++++++++---------------- mysql-test/t/key_cache.test | 12 +++---- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 8634beb290f..1146ae8bbfa 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -435,16 +435,16 @@ p i a 4 3 zzzz update t1 set p=3 where p=1; update t2 set i=2 where i=1; -show status like 'key_%'; -Variable_name Value -Key_blocks_not_flushed 0 -Key_blocks_unused KEY_BLOCKS_UNUSED -Key_blocks_used 4 -Key_blocks_warm 0 -Key_read_requests 22 -Key_reads 0 -Key_write_requests 26 -Key_writes 6 +select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused'; +VARIABLE_NAME VARIABLE_VALUE +KEY_BLOCKS_NOT_FLUSHED 0 +KEY_BLOCKS_USED 4 +KEY_BLOCKS_WARM 0 +KEY_READ_REQUESTS 22 +KEY_READS 0 +KEY_WRITE_REQUESTS 26 +KEY_WRITES 6 +select variable_value into @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES default NULL NULL 2097152 1024 4 # 0 22 0 26 6 @@ -483,16 +483,18 @@ p i a 4 3 zzzz update t1 set p=3 where p=1; update t2 set i=2 where i=1; -show status like 'key_%'; -Variable_name Value -Key_blocks_not_flushed 0 -Key_blocks_unused KEY_BLOCKS_UNUSED -Key_blocks_used 4 -Key_blocks_warm 0 -Key_read_requests 22 -Key_reads 0 -Key_write_requests 26 -Key_writes 6 +select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused'; +VARIABLE_NAME VARIABLE_VALUE +KEY_BLOCKS_NOT_FLUSHED 0 +KEY_BLOCKS_USED 4 +KEY_BLOCKS_WARM 0 +KEY_READ_REQUESTS 22 +KEY_READS 0 +KEY_WRITE_REQUESTS 26 +KEY_WRITES 6 +select variable_value < @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; +variable_value < @key_blocks_unused +1 select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES default 2 NULL 2097152 1024 4 # 0 22 0 26 6 @@ -526,16 +528,18 @@ p i a 4 3 zzzz update t1 set p=3 where p=1; update t2 set i=2 where i=1; -show status like 'key_%'; -Variable_name Value -Key_blocks_not_flushed 0 -Key_blocks_unused KEY_BLOCKS_UNUSED -Key_blocks_used 4 -Key_blocks_warm 0 -Key_read_requests 22 -Key_reads 0 -Key_write_requests 26 -Key_writes 6 +select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused'; +VARIABLE_NAME VARIABLE_VALUE +KEY_BLOCKS_NOT_FLUSHED 0 +KEY_BLOCKS_USED 4 +KEY_BLOCKS_WARM 0 +KEY_READ_REQUESTS 22 +KEY_READS 0 +KEY_WRITE_REQUESTS 26 +KEY_WRITES 6 +select variable_value = @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; +variable_value = @key_blocks_unused +1 select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES default 1 NULL 2097152 1024 4 # 0 22 0 26 6 diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 86e56a8301b..d28e7c23a4c 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -301,8 +301,8 @@ select * from t2; update t1 set p=3 where p=1; update t2 set i=2 where i=1; ---replace_result 1804 KEY_BLOCKS_UNUSED 1801 KEY_BLOCKS_UNUSED 1663 KEY_BLOCKS_UNUSED 1782 KEY_BLOCKS_UNUSED -show status like 'key_%'; +select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused'; +select variable_value into @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; --replace_column 7 # select * from information_schema.key_caches where segment_number is null; @@ -334,8 +334,8 @@ update t1 set p=3 where p=1; update t2 set i=2 where i=1; ---replace_result 1800 KEY_BLOCKS_UNUSED 1794 KEY_BLOCKS_UNUSED 1656 KEY_BLOCKS_UNUSED 1775 KEY_BLOCKS_UNUSED -show status like 'key_%'; +select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused'; +select variable_value < @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; --replace_column 7 # select * from information_schema.key_caches where segment_number is null; @@ -359,8 +359,8 @@ select * from t2; update t1 set p=3 where p=1; update t2 set i=2 where i=1; ---replace_result 1804 KEY_BLOCKS_UNUSED 1801 KEY_BLOCKS_UNUSED 1663 KEY_BLOCKS_UNUSED 1782 KEY_BLOCKS_UNUSED -show status like 'key_%'; +select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused'; +select variable_value = @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; --replace_column 7 # select * from information_schema.key_caches where segment_number is null; From ce0ed977d51e4621fbb241ea7f231ee35db48b39 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:18:34 +0100 Subject: [PATCH 180/201] MDEV-7186 get_lock() crashes on Windows, main.sp_notembedded and main.trigger_notembedded fail in buildbot user locks are not affected by lowed_case_table_names --- sql/mdl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mdl.h b/sql/mdl.h index 47c587eb3be..c4d792acd29 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -351,7 +351,7 @@ public: NAME_LEN) - m_ptr + 1); m_hash_value= my_hash_sort(&my_charset_bin, (uchar*) m_ptr + 1, m_length - 1); - DBUG_ASSERT(ok_for_lower_case_names(db)); + DBUG_ASSERT(mdl_namespace == USER_LOCK || ok_for_lower_case_names(db)); } void mdl_key_init(const MDL_key *rhs) { From 47c844f236fc7e9f6065ba4332facea6b51fe26e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:18:44 +0100 Subject: [PATCH 181/201] MDEV-7219 SQL_CALC_FOUND_ROWS yields wrong result revert the code in filesort that conditionally updated 'found_rows', rely on filesort_limit_arg instead. --- mysql-test/r/select_found.result | 16 ++++++++++++++++ mysql-test/t/select_found.test | 20 ++++++++++++++++++++ sql/filesort.cc | 13 +++---------- sql/sql_select.cc | 18 +++++++++--------- sql/sql_select.h | 1 - 5 files changed, 48 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 04eb2c90d31..92758fa134b 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -332,3 +332,19 @@ select found_rows() as count; count 2 drop table t1, t2; +create table t1 (i int, v varchar(64), key (i)); +select sql_calc_found_rows * from t1 where i = 0 order by v limit 59,2; +i v +0 foo +0 foo +select found_rows(); +found_rows() +75 +select sql_calc_found_rows * from t1 ignore index (i) where i = 0 order by v limit 59,2; +i v +0 foo +0 foo +select found_rows(); +found_rows() +75 +drop table t1; diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index d529dc415e7..88940eaf2b8 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -257,3 +257,23 @@ select sql_calc_found_rows 1 as res from t1 left join t2 on i1 = i2 where v2 = 5 select found_rows() as count; drop table t1, t2; +# +# MDEV-7219 SQL_CALC_FOUND_ROWS yields wrong result +# +create table t1 (i int, v varchar(64), key (i)); + +--disable_query_log +let $1=150; +while ($1) +{ + eval insert into t1 values ($1 % 2, 'foo'); + dec $1; +} +--enable_query_log + +select sql_calc_found_rows * from t1 where i = 0 order by v limit 59,2; +select found_rows(); +select sql_calc_found_rows * from t1 ignore index (i) where i = 0 order by v limit 59,2; +select found_rows(); +drop table t1; + diff --git a/sql/filesort.cc b/sql/filesort.cc index 509a7f8e9b3..027437fca67 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -166,8 +166,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, TABLE_LIST *tab= table->pos_in_table_list; Item_subselect *subselect= tab ? tab->containing_subselect() : 0; - *found_rows= HA_POS_ERROR; - MYSQL_FILESORT_START(table->s->db.str, table->s->table_name.str); DEBUG_SYNC(thd, "filesort_start"); @@ -190,6 +188,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, my_b_clear(&buffpek_pointers); buffpek=0; error= 1; + *found_rows= HA_POS_ERROR; param.init_for_filesort(sortlength(thd, sortorder, s_length, &multi_byte_charset), @@ -690,8 +689,7 @@ static ha_rows find_all_keys(Sort_param *param, SQL_SELECT *select, ref_pos= ref_buff; quick_select=select && select->quick; record=0; - if (pq) // don't count unless pq is used - *found_rows= 0; + *found_rows= 0; flag= ((file->ha_table_flags() & HA_REC_NOT_IN_SEQ) || quick_select); if (flag) ref_pos= &file->ref[0]; @@ -814,14 +812,9 @@ static ha_rows find_all_keys(Sort_param *param, SQL_SELECT *select, if (write_record) { + ++(*found_rows); if (pq) { - /* - only count rows when pq is used - otherwise there might be - other filters *after* the filesort, we don't know the final row - count here - */ - (*found_rows)++; pq->push(ref_pos); idx= pq->num_elements(); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2eb2ddc057e..3912a039b9c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3032,6 +3032,7 @@ void JOIN::exec_inner() const ha_rows select_limit_arg= select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : unit->select_limit_cnt; + curr_join->filesort_found_rows= filesort_limit_arg != HA_POS_ERROR; DBUG_PRINT("info", ("has_group_by %d " "curr_join->table_count %d " @@ -3079,7 +3080,8 @@ void JOIN::exec_inner() Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF); error= do_select(curr_join, curr_fields_list, NULL, procedure); thd->limit_found_rows= curr_join->send_records; - if (curr_join->order && curr_join->filesort_found_rows) + if (curr_join->order && curr_join->sortorder && + curr_join->filesort_found_rows) { /* Use info provided by filesort. */ DBUG_ASSERT(curr_join->table_count > curr_join->const_tables); @@ -18900,7 +18902,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), records are read. Because of optimization in some cases it can provide only select_limit_cnt+1 records. */ - if (join->order && join->filesort_found_rows && + if (join->order && join->sortorder && + join->filesort_found_rows && join->select_options & OPTION_FOUND_ROWS) { DBUG_PRINT("info", ("filesort NESTED_LOOP_QUERY_LIMIT")); @@ -18922,8 +18925,9 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), /* Join over all rows in table; Return number of found rows */ TABLE *table=jt->table; - join->select_options ^= OPTION_FOUND_ROWS; - if (join->filesort_found_rows) + join->select_options ^= OPTION_FOUND_ROWS; + if (table->sort.record_pointers || + (table->sort.io_cache && my_b_inited(table->sort.io_cache))) { /* Using filesort */ join->send_records= table->sort.found_records; @@ -20754,11 +20758,7 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, select, filesort_limit, 0, &examined_rows, &found_rows); table->sort.found_records= filesort_retval; - if (found_rows != HA_POS_ERROR) - { - tab->records= found_rows; // For SQL_CALC_ROWS - join->filesort_found_rows= true; - } + tab->records= found_rows; // For SQL_CALC_ROWS if (quick_created) { diff --git a/sql/sql_select.h b/sql/sql_select.h index 490d8c91a9e..7d53731b558 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1341,7 +1341,6 @@ public: emb_sjm_nest= NULL; sjm_lookup_tables= 0; - filesort_found_rows= false; exec_saved_explain= false; /* The following is needed because JOIN::cleanup(true) may be called for From e2a27682788afacc738914976014b324b1be6ad9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:18:55 +0100 Subject: [PATCH 182/201] remove unused st_my_thread_var::cmp_length --- include/my_pthread.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/my_pthread.h b/include/my_pthread.h index 0be821586a1..2e5f177eea4 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -721,7 +721,6 @@ struct st_my_thread_var mysql_cond_t * volatile current_cond; pthread_t pthread_self; my_thread_id id; - int cmp_length; int volatile abort; my_bool init; struct st_my_thread_var *next,**prev; From c75eec8e0de23a6314ce021bafeb4ab4eeb1105f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:19:05 +0100 Subject: [PATCH 183/201] rename st_my_thread_var::opt_info -> st_my_thread_var::keycache_link --- include/my_pthread.h | 2 +- mysys/mf_keycache.c | 24 ++++++++++++------------ sql/sql_show.cc | 7 +++---- storage/maria/ma_pagecache.c | 20 ++++++++++---------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/include/my_pthread.h b/include/my_pthread.h index 2e5f177eea4..36664775545 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -724,7 +724,7 @@ struct st_my_thread_var int volatile abort; my_bool init; struct st_my_thread_var *next,**prev; - void *opt_info; + void *keycache_link; uint lock_type; /* used by conditional release the queue */ void *stack_ends_here; safe_mutex_t *mutex_in_use; diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index b9da197d311..c0cd1594e72 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1370,7 +1370,7 @@ static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block, keycache->waiting_for_block.last_thread; struct st_my_thread_var *first_thread= last_thread->next; struct st_my_thread_var *next_thread= first_thread; - HASH_LINK *hash_link= (HASH_LINK *) first_thread->opt_info; + HASH_LINK *hash_link= (HASH_LINK *) first_thread->keycache_link; struct st_my_thread_var *thread; do { @@ -1380,7 +1380,7 @@ static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block, We notify about the event all threads that ask for the same page as the first thread in the queue */ - if ((HASH_LINK *) thread->opt_info == hash_link) + if ((HASH_LINK *) thread->keycache_link == hash_link) { KEYCACHE_DBUG_PRINT("link_block: signal", ("thread %ld", thread->id)); keycache_pthread_cond_signal(&thread->suspend); @@ -1714,7 +1714,7 @@ static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link) keycache->waiting_for_hash_link.last_thread; struct st_my_thread_var *first_thread= last_thread->next; struct st_my_thread_var *next_thread= first_thread; - KEYCACHE_PAGE *first_page= (KEYCACHE_PAGE *) (first_thread->opt_info); + KEYCACHE_PAGE *first_page= (KEYCACHE_PAGE *) (first_thread->keycache_link); struct st_my_thread_var *thread; hash_link->file= first_page->file; @@ -1723,7 +1723,7 @@ static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link) { KEYCACHE_PAGE *page; thread= next_thread; - page= (KEYCACHE_PAGE *) thread->opt_info; + page= (KEYCACHE_PAGE *) thread->keycache_link; next_thread= thread->next; /* We notify about the event all threads that ask @@ -1812,13 +1812,13 @@ restart: KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting")); page.file= file; page.filepos= filepos; - thread->opt_info= (void *) &page; + thread->keycache_link= (void *) &page; link_into_queue(&keycache->waiting_for_hash_link, thread); KEYCACHE_DBUG_PRINT("get_hash_link: wait", ("suspend thread %ld", thread->id)); keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); - thread->opt_info= NULL; + thread->keycache_link= NULL; goto restart; } hash_link->file= file; @@ -1976,7 +1976,7 @@ restart: for another file/pos. */ thread= my_thread_var; - thread->opt_info= (void *) hash_link; + thread->keycache_link= (void *) hash_link; link_into_queue(&keycache->waiting_for_block, thread); do { @@ -1985,7 +1985,7 @@ restart: keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock); } while (thread->next); - thread->opt_info= NULL; + thread->keycache_link= NULL; /* A block should now be assigned to the hash_link. But it may still need to be evicted. Anyway, we should re-check the @@ -2323,7 +2323,7 @@ restart: */ struct st_my_thread_var *thread= my_thread_var; - thread->opt_info= (void *) hash_link; + thread->keycache_link= (void *) hash_link; link_into_queue(&keycache->waiting_for_block, thread); do { @@ -2333,7 +2333,7 @@ restart: &keycache->cache_lock); } while (thread->next); - thread->opt_info= NULL; + thread->keycache_link= NULL; /* Assert that block has a request registered. */ DBUG_ASSERT(hash_link->block->requests); /* Assert that block is not in LRU ring. */ @@ -4588,7 +4588,7 @@ static void keycache_dump(SIMPLE_KEY_CACHE_CB *keycache) do { thread=thread->next; - page= (KEYCACHE_PAGE *) thread->opt_info; + page= (KEYCACHE_PAGE *) thread->keycache_link; fprintf(keycache_dump_file, "thread:%u, (file,filepos)=(%u,%lu)\n", thread->id,(uint) page->file,(ulong) page->filepos); @@ -4604,7 +4604,7 @@ static void keycache_dump(SIMPLE_KEY_CACHE_CB *keycache) do { thread=thread->next; - hash_link= (HASH_LINK *) thread->opt_info; + hash_link= (HASH_LINK *) thread->keycache_link; fprintf(keycache_dump_file, "thread:%u hash_link:%u (file,filepos)=(%u,%lu)\n", thread->id, (uint) HASH_LINK_NUMBER(hash_link), diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 9dbee701061..6dabd349214 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4275,7 +4275,7 @@ fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys, Again we don't do this for SHOW COLUMNS/KEYS because of backward compatibility. */ - if (!is_show_fields_or_keys && result && thd->is_error() && + if (!is_show_fields_or_keys && result && (thd->get_stmt_da()->sql_errno() == ER_NO_SUCH_TABLE || thd->get_stmt_da()->sql_errno() == ER_WRONG_OBJECT)) { @@ -5282,12 +5282,11 @@ err: column with the error text, and clear the error so that the operation can continue. */ - const char *error= thd->is_error() ? thd->get_stmt_da()->message() : ""; + const char *error= thd->get_stmt_da()->message(); table->field[20]->store(error, strlen(error), cs); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, - thd->get_stmt_da()->sql_errno(), - thd->get_stmt_da()->message()); + thd->get_stmt_da()->sql_errno(), error); thd->clear_error(); } diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index bb085bbdc7a..ac66fdf6c57 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -1314,7 +1314,7 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, struct st_my_thread_var *first_thread= last_thread->next; struct st_my_thread_var *next_thread= first_thread; PAGECACHE_HASH_LINK *hash_link= - (PAGECACHE_HASH_LINK *) first_thread->opt_info; + (PAGECACHE_HASH_LINK *) first_thread->keycache_link; struct st_my_thread_var *thread; DBUG_ASSERT(block->requests + block->wlocks + block->rlocks + @@ -1329,7 +1329,7 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, We notify about the event all threads that ask for the same page as the first thread in the queue */ - if ((PAGECACHE_HASH_LINK *) thread->opt_info == hash_link) + if ((PAGECACHE_HASH_LINK *) thread->keycache_link == hash_link) { DBUG_PRINT("signal", ("thread: %s %ld", thread->name, thread->id)); pagecache_pthread_cond_signal(&thread->suspend); @@ -1642,7 +1642,7 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link) pagecache->waiting_for_hash_link.last_thread; struct st_my_thread_var *first_thread= last_thread->next; struct st_my_thread_var *next_thread= first_thread; - PAGECACHE_PAGE *first_page= (PAGECACHE_PAGE *) (first_thread->opt_info); + PAGECACHE_PAGE *first_page= (PAGECACHE_PAGE *) (first_thread->keycache_link); struct st_my_thread_var *thread; hash_link->file= first_page->file; @@ -1652,7 +1652,7 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link) { PAGECACHE_PAGE *page; thread= next_thread; - page= (PAGECACHE_PAGE *) thread->opt_info; + page= (PAGECACHE_PAGE *) thread->keycache_link; next_thread= thread->next; /* We notify about the event all threads that ask @@ -1798,13 +1798,13 @@ restart: PAGECACHE_PAGE page; page.file= *file; page.pageno= pageno; - thread->opt_info= (void *) &page; + thread->keycache_link= (void *) &page; wqueue_link_into_queue(&pagecache->waiting_for_hash_link, thread); DBUG_PRINT("wait", ("suspend thread %s %ld", thread->name, thread->id)); pagecache_pthread_cond_wait(&thread->suspend, &pagecache->cache_lock); - thread->opt_info= NULL; + thread->keycache_link= NULL; DBUG_PRINT("thread", ("restarting...")); goto restart; } @@ -2067,7 +2067,7 @@ restart: */ struct st_my_thread_var *thread= my_thread_var; - thread->opt_info= (void *) hash_link; + thread->keycache_link= (void *) hash_link; wqueue_link_into_queue(&pagecache->waiting_for_block, thread); do { @@ -2077,7 +2077,7 @@ restart: &pagecache->cache_lock); } while (thread->next); - thread->opt_info= NULL; + thread->keycache_link= NULL; block= hash_link->block; /* Ensure that the block is registered */ DBUG_ASSERT(block->requests >= 1); @@ -5057,7 +5057,7 @@ static void pagecache_dump(PAGECACHE *pagecache) do { thread= thread->next; - page= (PAGECACHE_PAGE *) thread->opt_info; + page= (PAGECACHE_PAGE *) thread->keycache_link; fprintf(pagecache_dump_file, "thread: %s %ld, (file,pageno)=(%u,%lu)\n", thread->name, thread->id, @@ -5074,7 +5074,7 @@ static void pagecache_dump(PAGECACHE *pagecache) do { thread=thread->next; - hash_link= (PAGECACHE_HASH_LINK *) thread->opt_info; + hash_link= (PAGECACHE_HASH_LINK *) thread->keycache_link; fprintf(pagecache_dump_file, "thread: %s %u hash_link:%u (file,pageno)=(%u,%lu)\n", thread->name, thread->id, From 73ebabd2eea6db71db2270e855a4af9630306a54 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:19:14 +0100 Subject: [PATCH 184/201] MDEV-7299 Assertion `m_status == DA_ERROR || m_status == DA_OK' fails on concurrent execution of DDL, queries from I_S, and KILL QUERY Fix MDL to report an error when a wait was killed, but preserve the old documented behavior of GET_LOCK() where killing it is not an error. Also remove race conditions in main.create_or_replace test --- mysql-test/r/create_or_replace.result | 2 ++ mysql-test/t/create_or_replace.test | 10 ++++++++-- sql/item_func.cc | 12 ++++++++---- sql/mdl.cc | 1 + 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/create_or_replace.result b/mysql-test/r/create_or_replace.result index a2f06c38cb5..ff8170b7309 100644 --- a/mysql-test/r/create_or_replace.result +++ b/mysql-test/r/create_or_replace.result @@ -436,7 +436,9 @@ CREATE OR REPLACE TEMPORARY TABLE tmp LIKE t1; LOCK TABLE t1 WRITE; CREATE OR REPLACE TABLE t1 LIKE tmp; KILL QUERY con_id; +ERROR 70100: Query execution was interrupted CREATE OR REPLACE TABLE t1 (a int); KILL QUERY con_id; +ERROR 70100: Query execution was interrupted drop table t1; DROP TABLE t2; diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test index 2bdd23c21f6..9e37950dbef 100644 --- a/mysql-test/t/create_or_replace.test +++ b/mysql-test/t/create_or_replace.test @@ -346,20 +346,26 @@ LOCK TABLE t1 WRITE; --let $con_id = `SELECT CONNECTION_ID()` --send CREATE OR REPLACE TABLE t1 LIKE tmp --connection default +let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist + WHERE state= 'Waiting for table metadata lock'; +--source include/wait_condition.inc --replace_result $con_id con_id --eval KILL QUERY $con_id --connection con1 ---error 0,ER_QUERY_INTERRUPTED +--error ER_QUERY_INTERRUPTED --reap --send CREATE OR REPLACE TABLE t1 (a int) --connection default +let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist + WHERE state= 'Waiting for table metadata lock'; +--source include/wait_condition.inc --replace_result $con_id con_id --eval KILL QUERY $con_id --connection con1 ---error 0,ER_QUERY_INTERRUPTED +--error ER_QUERY_INTERRUPTED --reap --disconnect con1 --connection default diff --git a/sql/item_func.cc b/sql/item_func.cc index 098845d372e..de05ee358a2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4179,9 +4179,10 @@ void mysql_ull_set_explicit_lock_duration(THD *thd) When MDL detects a lock wait timeout, it pushes an error into the statement diagnostics area. For GET_LOCK(), lock wait timeout is not an error, - but a special return value (0). NULL is returned in - case of error. - Capture and suppress lock wait timeout. + but a special return value (0). + Similarly, killing get_lock wait is not an error either, + but a return value NULL. + Capture and suppress lock wait timeouts and kills. */ class Lock_wait_timeout_handler: public Internal_error_handler @@ -4200,7 +4201,7 @@ public: bool Lock_wait_timeout_handler:: -handle_condition(THD * /* thd */, uint sql_errno, +handle_condition(THD *thd, uint sql_errno, const char * /* sqlstate */, Sql_condition::enum_warning_level /* level */, const char *message, @@ -4211,6 +4212,9 @@ handle_condition(THD * /* thd */, uint sql_errno, m_lock_wait_timeout= true; return true; /* condition handled */ } + if (thd->is_killed()) + return true; + return false; } diff --git a/sql/mdl.cc b/sql/mdl.cc index 2c2d64e96b2..b94a3710fd1 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -2413,6 +2413,7 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout) my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0)); break; case MDL_wait::KILLED: + get_thd()->send_kill_message(); break; default: DBUG_ASSERT(0); From 510ca9b6973eacf879b94baeb8bbdd84d224c8d6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 14:32:28 +0100 Subject: [PATCH 185/201] MDEV-7402 'reset master' hangs, waits for signalled COND_xid_list Using a boolean flag for 'there is a RESET MASTER in progress' doesn't work very well for multiple concurrent RESET MASTER statements. Changed to a counter. --- .../suite/binlog/r/binlog_checkpoint.result | 12 +++++++ .../suite/binlog/t/binlog_checkpoint.test | 31 +++++++++++++++++++ sql/log.cc | 7 +++-- sql/log.h | 2 +- 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result index 2ce9ed760f5..f76fc6da189 100644 --- a/mysql-test/suite/binlog/r/binlog_checkpoint.result +++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result @@ -112,6 +112,18 @@ master-bin.000003 # master-bin.000004 # master-bin.000005 # master-bin.000006 # +SET debug_sync = 'reset'; +*** MDEV-7402: 'reset master' hangs, waits for signalled COND_xid_list *** +SET debug_sync="reset_logs_after_set_reset_master_pending SIGNAL reset_master_ready WAIT_FOR reset_master_cont"; +RESET MASTER; +SET @old_dbug= @@global.DEBUG_DBUG; +SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done"; +SET debug_sync="now WAIT_FOR reset_master_ready"; +RESET MASTER; +SET debug_sync="now WAIT_FOR injected_binlog_background_thread"; +SET GLOBAL debug_dbug=@old_dbug; +SET debug_sync="now SIGNAL reset_master_cont"; +SET debug_sync = 'reset'; DROP TABLE t1, t2; SET GLOBAL max_binlog_size= @old_max_binlog_size; SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint.test b/mysql-test/suite/binlog/t/binlog_checkpoint.test index 356f860af32..cdb71887ad6 100644 --- a/mysql-test/suite/binlog/t/binlog_checkpoint.test +++ b/mysql-test/suite/binlog/t/binlog_checkpoint.test @@ -138,8 +138,39 @@ SET DEBUG_SYNC= "now WAIT_FOR injected_binlog_background_thread"; SET GLOBAL debug_dbug= @old_dbug; INSERT INTO t1 VALUES (31, REPEAT("x", 4100)); --source include/show_binary_logs.inc +SET debug_sync = 'reset'; +--echo *** MDEV-7402: 'reset master' hangs, waits for signalled COND_xid_list *** + +--source include/wait_for_binlog_checkpoint.inc + +connect(con3,localhost,root,,); +# Make the binlog background thread wait before clearing the pending checkpoint. +# The bug was that one RESET MASTER would clear the reset_master_pending +# flag set by another RESET MASTER; this could cause the wakeup from the +# binlog background thread not to be sent, and thus the second RESET MASTER +# to wait infinitely. +SET debug_sync="reset_logs_after_set_reset_master_pending SIGNAL reset_master_ready WAIT_FOR reset_master_cont"; +send RESET MASTER; + +--connection default +SET @old_dbug= @@global.DEBUG_DBUG; +SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done"; +SET debug_sync="now WAIT_FOR reset_master_ready"; +RESET MASTER; +SET debug_sync="now WAIT_FOR injected_binlog_background_thread"; +SET GLOBAL debug_dbug=@old_dbug; +SET debug_sync="now SIGNAL reset_master_cont"; + +--connection con3 +REAP; + +--connection default +SET debug_sync = 'reset'; + + +# Clean up. DROP TABLE t1, t2; SET GLOBAL max_binlog_size= @old_max_binlog_size; SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/sql/log.cc b/sql/log.cc index 71b1b8728af..38fe1066896 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3031,7 +3031,7 @@ const char *MYSQL_LOG::generate_name(const char *log_name, MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period) - :reset_master_pending(false), mark_xid_done_waiting(0), + :reset_master_pending(0), mark_xid_done_waiting(0), bytes_written(0), file_id(1), open_count(1), group_commit_queue(0), group_commit_queue_busy(FALSE), num_commits(0), num_group_commits(0), @@ -3867,12 +3867,13 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd, bool create_new_log, do this before we take the LOCK_log to not deadlock. */ mysql_mutex_lock(&LOCK_xid_list); - reset_master_pending= true; + reset_master_pending++; while (mark_xid_done_waiting > 0) mysql_cond_wait(&COND_xid_list, &LOCK_xid_list); mysql_mutex_unlock(&LOCK_xid_list); } + DEBUG_SYNC(thd, "reset_logs_after_set_reset_master_pending"); if (thd) ha_reset_logs(thd); /* @@ -4054,7 +4055,7 @@ err: DBUG_ASSERT(b->xid_count == 0); my_free(binlog_xid_count_list.get()); } - reset_master_pending= false; + reset_master_pending--; mysql_mutex_unlock(&LOCK_xid_list); } diff --git a/sql/log.h b/sql/log.h index 1bf87733ce2..a93e2e1c0b9 100644 --- a/sql/log.h +++ b/sql/log.h @@ -470,7 +470,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG anyway). Instead we should signal COND_xid_list whenever a new binlog checkpoint arrives - when all have arrived, RESET MASTER will complete. */ - bool reset_master_pending; + uint reset_master_pending; ulong mark_xid_done_waiting; /* LOCK_log and LOCK_index are inited by init_pthread_objects() */ From 919443f7a553534de38d40a5cdf50cd3660ace1a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 16:11:48 +0100 Subject: [PATCH 186/201] MDEV-5679 MariaDB holds stdin open after startup as mysqld --- sql/mysqld.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e0eaf55daf9..7138027ff0a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5527,6 +5527,7 @@ int mysqld_main(int argc, char **argv) (char*) "" : mysqld_unix_port), mysqld_port, MYSQL_COMPILATION_COMMENT); + fclose(stdin); #if defined(_WIN32) && !defined(EMBEDDED_LIBRARY) Service.SetRunning(); #endif From 5d0d6cb129f64bfaed2128d2bcc366aeee44e5ad Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 16:28:58 +0100 Subject: [PATCH 187/201] MDEV-7294 MTR does not use /dev/shm with a out-of-source build mtr internally does the following: 1. $default_vardir=.... 2. $opt_vardir=$default_vardir unless $opt_vardir; 3. $opt_vardir=realpath $opt_vardir unless IS_WINDOWS 4. if ($opt_vardir eq $default_vardir) { .... use /dev/shm ... } thus we have to realpath $default_datadir too, otherwise the comparison logic might be broken --- mysql-test/mysql-test-run.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index daf9c6744da..ce07866ff9f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1494,6 +1494,7 @@ sub command_line_setup { { $default_vardir= "$glob_mysql_test_dir/var"; } + $default_vardir = realpath $default_vardir unless IS_WINDOWS; if ( ! $opt_vardir ) { From 595cf636fd9b07f64dd12d6ca9585a269fc67f45 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 16:29:18 +0100 Subject: [PATCH 188/201] MDEV-7475 Wrong implementation of checking PLUGIN_VAR_SET condition correct the check for PLUGIN_VAR_STR --- sql/sql_plugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index e1784c1f027..d1838bab4c9 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -3916,7 +3916,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, we copy string values to a plugin's memroot. */ if (mysqld_server_started && - ((o->flags & (PLUGIN_VAR_STR | PLUGIN_VAR_NOCMDOPT | + ((o->flags & (PLUGIN_VAR_TYPEMASK | PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_MEMALLOC)) == PLUGIN_VAR_STR)) { sysvar_str_t* str= (sysvar_str_t *)o; From d854a254b84595b3a8f3a4d8083a2b997d59912e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 16:30:32 +0100 Subject: [PATCH 189/201] remove incorrect asserts in innodb/xtradb. 0 is a valid file handle value. --- storage/innobase/os/os0file.cc | 10 ---------- storage/xtradb/os/os0file.cc | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index f94d6353431..e835c1b4e92 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -1999,8 +1999,6 @@ os_file_close_func( #ifdef __WIN__ BOOL ret; - ut_a(file); - ret = CloseHandle(file); if (ret) { @@ -2038,8 +2036,6 @@ os_file_close_no_error_handling( #ifdef __WIN__ BOOL ret; - ut_a(file); - ret = CloseHandle(file); if (ret) { @@ -2266,8 +2262,6 @@ os_file_flush_func( #ifdef __WIN__ BOOL ret; - ut_a(file); - os_n_fsyncs++; ret = FlushFileBuffers(file); @@ -2598,7 +2592,6 @@ os_file_read_func( os_bytes_read_since_printout += n; try_again: - ut_ad(file); ut_ad(buf); ut_ad(n > 0); @@ -2725,7 +2718,6 @@ os_file_read_no_error_handling_func( os_bytes_read_since_printout += n; try_again: - ut_ad(file); ut_ad(buf); ut_ad(n > 0); @@ -2861,7 +2853,6 @@ os_file_write_func( os_n_file_writes++; - ut_ad(file); ut_ad(buf); ut_ad(n > 0); retry: @@ -4581,7 +4572,6 @@ os_aio_func( #endif /* WIN_ASYNC_IO */ ulint wake_later; - ut_ad(file); ut_ad(buf); ut_ad(n > 0); ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0); diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index d1724c378bd..691054a7e47 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -2163,8 +2163,6 @@ os_file_close_func( #ifdef __WIN__ BOOL ret; - ut_a(file); - ret = CloseHandle(file); if (ret) { @@ -2201,8 +2199,6 @@ os_file_close_no_error_handling( #ifdef __WIN__ BOOL ret; - ut_a(file); - ret = CloseHandle(file); if (ret) { @@ -2452,8 +2448,6 @@ os_file_flush_func( #ifdef __WIN__ BOOL ret; - ut_a(file); - os_n_fsyncs++; ret = FlushFileBuffers(file); @@ -2856,7 +2850,6 @@ os_file_read_func( os_bytes_read_since_printout += n; try_again: - ut_ad(file); ut_ad(buf); ut_ad(n > 0); @@ -2956,7 +2949,6 @@ os_file_read_no_error_handling_func( os_bytes_read_since_printout += n; try_again: - ut_ad(file); ut_ad(buf); ut_ad(n > 0); @@ -3062,7 +3054,6 @@ os_file_write_func( os_n_file_writes++; - ut_ad(file); ut_ad(buf); ut_ad(n > 0); retry: @@ -4731,7 +4722,6 @@ os_aio_func( #endif ulint wake_later; - ut_ad(file); ut_ad(buf); ut_ad(n > 0); ut_ad(n % OS_MIN_LOG_BLOCK_SIZE == 0); From a18eb833cd1947737ef44a4151803d618b5dcd0b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 16:41:37 +0100 Subject: [PATCH 190/201] MDEV-7226 sql-bench test-table-elimination does not execute --- sql-bench/test-table-elimination.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-bench/test-table-elimination.sh b/sql-bench/test-table-elimination.sh index 5b494688bec..7772cab42b0 100755 --- a/sql-bench/test-table-elimination.sh +++ b/sql-bench/test-table-elimination.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Test of table elimination feature use Cwd; From 3212aaa995b9a20d4986f563bc7ebd34d5fc1477 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 17:18:24 +0100 Subject: [PATCH 191/201] MDEV-6220 mysqldump will not backup database with --flush-logs parameter and log_error my.cnf parameter defined some checks were "if [ -n "$err_log" ]", others were "if [ $want_syslog -eq 0 ]", so when both are set, error log file was only partially initialized. To avoid this ambiguity we reset want_syslog when error log file is used. --- scripts/mysqld_safe.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index e5e0b768440..3428fff6a59 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -586,6 +586,7 @@ then then # User explicitly asked for syslog, so warn that it isn't used log_error "Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect." + want_syslog=0 fi # Log to err_log file From 8bc712e481a18976853fa57a7be77aab6159d431 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Jan 2015 17:31:59 +0100 Subject: [PATCH 192/201] MDEV-6671 mysql_server_end breaks OpenSSL --- include/mysql.h | 1 + include/mysql.h.pp | 1 + libmysql/CMakeLists.txt | 2 ++ libmysql/libmysql.c | 3 ++- sql-common/client.c | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/mysql.h b/include/mysql.h index 090abf46377..d7fe5edef1e 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -75,6 +75,7 @@ typedef int my_socket; #include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */ +extern unsigned int mariadb_deinitialize_ssl; extern unsigned int mysql_port; extern char *mysql_unix_port; diff --git a/include/mysql.h.pp b/include/mysql.h.pp index c45a8d72c7c..b7b1ea2d96d 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -168,6 +168,7 @@ extern LIST *list_reverse(LIST *root); extern void list_free(LIST *root,unsigned int free_data); extern unsigned int list_length(LIST *); extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); +extern unsigned int mariadb_deinitialize_ssl; extern unsigned int mysql_port; extern char *mysql_unix_port; typedef struct st_mysql_field { diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index fc4abb0ddd4..ca5d1ec8947 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -236,6 +236,8 @@ dynamic_column_exists dynamic_column_list dynamic_column_get dynamic_column_prepare_decimal +# +mariadb_deinitialize_ssl ) SET(CLIENT_API_FUNCTIONS diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 7a4fc9fabd4..df18d6d60da 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -205,7 +205,8 @@ void STDCALL mysql_server_end() mysql_client_plugin_deinit(); finish_client_errs(); - vio_end(); + if (mariadb_deinitialize_ssl) + vio_end(); #ifdef EMBEDDED_LIBRARY end_embedded_server(); #endif diff --git a/sql-common/client.c b/sql-common/client.c index 69387391e6d..193f80f5788 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -118,6 +118,7 @@ my_bool net_flush(NET *net); #define native_password_plugin_name "mysql_native_password" #define old_password_plugin_name "mysql_old_password" +uint mariadb_deinitialize_ssl= 1; uint mysql_port=0; char *mysql_unix_port= 0; const char *unknown_sqlstate= "HY000"; From 2d2e110bcef08a772cae8e2ee7d226e2831f6459 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 19 Jan 2015 18:55:25 +0100 Subject: [PATCH 193/201] - Adding the JSON table type added: storage/connect/json.cpp storage/connect/json.h storage/connect/mysql-test/connect/r/json.result storage/connect/mysql-test/connect/std_data/biblio.jsn storage/connect/mysql-test/connect/std_data/expense.jsn storage/connect/mysql-test/connect/std_data/mulexp3.jsn storage/connect/mysql-test/connect/std_data/mulexp4.jsn storage/connect/mysql-test/connect/std_data/mulexp5.jsn storage/connect/mysql-test/connect/t/json.test storage/connect/tabjson.cpp storage/connect/tabjson.h modified: storage/connect/CMakeLists.txt storage/connect/engmsg.h storage/connect/filamtxt.h storage/connect/ha_connect.cc storage/connect/msgid.h storage/connect/mycat.cc storage/connect/plgdbsem.h storage/connect/tabdos.cpp storage/connect/value.cpp storage/connect/value.h --- storage/connect/CMakeLists.txt | 14 +- storage/connect/engmsg.h | 5 + storage/connect/filamtxt.h | 1 + storage/connect/ha_connect.cc | 6 +- storage/connect/json.cpp | 1055 +++++++++++++ storage/connect/json.h | 240 +++ storage/connect/msgid.h | 5 + storage/connect/mycat.cc | 10 +- .../connect/mysql-test/connect/r/json.result | 439 ++++++ .../mysql-test/connect/std_data/biblio.jsn | 45 + .../mysql-test/connect/std_data/expense.jsn | 158 ++ .../mysql-test/connect/std_data/mulexp3.jsn | 52 + .../mysql-test/connect/std_data/mulexp4.jsn | 52 + .../mysql-test/connect/std_data/mulexp5.jsn | 52 + .../connect/mysql-test/connect/t/json.test | 247 +++ storage/connect/plgdbsem.h | 11 +- storage/connect/tabdos.cpp | 3 +- storage/connect/tabjson.cpp | 1327 +++++++++++++++++ storage/connect/tabjson.h | 197 +++ storage/connect/value.cpp | 87 +- storage/connect/value.h | 6 +- 21 files changed, 3962 insertions(+), 50 deletions(-) create mode 100644 storage/connect/json.cpp create mode 100644 storage/connect/json.h create mode 100644 storage/connect/mysql-test/connect/r/json.result create mode 100644 storage/connect/mysql-test/connect/std_data/biblio.jsn create mode 100644 storage/connect/mysql-test/connect/std_data/expense.jsn create mode 100644 storage/connect/mysql-test/connect/std_data/mulexp3.jsn create mode 100644 storage/connect/mysql-test/connect/std_data/mulexp4.jsn create mode 100644 storage/connect/mysql-test/connect/std_data/mulexp5.jsn create mode 100644 storage/connect/mysql-test/connect/t/json.test create mode 100644 storage/connect/tabjson.cpp create mode 100644 storage/connect/tabjson.h diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 40b2a84d87d..956372e4960 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -21,18 +21,18 @@ ha_connect.cc connect.cc user_connect.cc mycat.cc fmdlex.c osutil.c plugutil.c rcmsg.c rcmsg.h array.cpp blkfil.cpp colblk.cpp csort.cpp filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filamzip.cpp -filter.cpp maputil.cpp myutil.cpp plgdbutl.cpp reldef.cpp tabcol.cpp -tabdos.cpp tabfix.cpp tabfmt.cpp table.cpp tabmul.cpp taboccur.cpp +filter.cpp json.cpp maputil.cpp myutil.cpp plgdbutl.cpp reldef.cpp tabcol.cpp +tabdos.cpp tabfix.cpp tabfmt.cpp tabjson.cpp table.cpp tabmul.cpp taboccur.cpp tabpivot.cpp tabsys.cpp tabtbl.cpp tabutil.cpp tabvct.cpp tabvir.cpp tabxcl.cpp valblk.cpp value.cpp xindex.cpp xobject.cpp array.h blkfil.h block.h catalog.h checklvl.h colblk.h connect.h csort.h engmsg.h filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h -filter.h global.h ha_connect.h inihandl.h maputil.h msgid.h mycat.h myutil.h -os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource.h tabcol.h -tabdos.h tabfix.h tabfmt.h tabmul.h taboccur.h tabpivot.h tabsys.h -tabtbl.h tabutil.h tabvct.h tabvir.h tabxcl.h user_connect.h valblk.h value.h -xindex.h xobject.h xtable.h) +filter.h global.h ha_connect.h inihandl.h json.h maputil.h msgid.h mycat.h +myutil.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource.h +tabcol.h tabdos.h tabfix.h tabfmt.h tabjson.h tabmul.h taboccur.h tabpivot.h +tabsys.h tabtbl.h tabutil.h tabvct.h tabvir.h tabxcl.h user_connect.h +valblk.h value.h xindex.h xobject.h xtable.h) # # Definitions that are shared for all OSes diff --git a/storage/connect/engmsg.h b/storage/connect/engmsg.h index ad6dc6b5689..14808758efd 100644 --- a/storage/connect/engmsg.h +++ b/storage/connect/engmsg.h @@ -103,6 +103,10 @@ #define MSG_FILE_MAP_ERROR "CreateFileMapping %s error rc=%d" #define MSG_FILE_OPEN_YET "File %s already open" #define MSG_FILE_UNFOUND "File %s not found" +#define MSG_FIX_OVFLW_ADD "Fixed Overflow on add" +#define MSG_FIX_OVFLW_TIMES "Fixed Overflow on times" +#define MSG_FIX_UNFLW_ADD "Fixed Underflow on add" +#define MSG_FIX_UNFLW_TIMES "Fixed Underflow on times" #define MSG_FLD_TOO_LNG_FOR "Field %d too long for %s line %d of %s" #define MSG_FLT_BAD_RESULT "Float inexact result" #define MSG_FLT_DENORMAL_OP "Float denormal operand" @@ -318,3 +322,4 @@ #define MSG_XPATH_CNTX_ERR "Unable to create new XPath context" #define MSG_XPATH_EVAL_ERR "Unable to evaluate xpath location '%s'" #define MSG_XPATH_NOT_SUPP "Unsupported Xpath for column %s" +#define MSG_ZERO_DIVIDE "Zero divide in expression" diff --git a/storage/connect/filamtxt.h b/storage/connect/filamtxt.h index b89d58965f9..864ca66dd34 100644 --- a/storage/connect/filamtxt.h +++ b/storage/connect/filamtxt.h @@ -26,6 +26,7 @@ class DllExport TXTFAM : public BLOCK { friend class TDBCSV; friend class TDBFIX; friend class TDBVCT; + friend class TDBJSON; friend class DOSCOL; friend class BINCOL; friend class VCTCOL; diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index eee0c334bb1..a0ac4668eba 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,8 +170,8 @@ #define SZWMIN 4194304 // Minimum work area size 4M extern "C" { - char version[]= "Version 1.03.0005 January 13, 2015"; - char compver[]= "Version 1.03.0005 " __DATE__ " " __TIME__; + char version[]= "Version 1.03.0006 January 13, 2015"; + char compver[]= "Version 1.03.0006 " __DATE__ " " __TIME__; #if defined(WIN32) char slash= '\\'; @@ -3834,7 +3834,7 @@ bool ha_connect::check_privileges(THD *thd, PTOS options, char *dbn) case TAB_XML: case TAB_INI: case TAB_VEC: -// case TAB_JSON: + case TAB_JSON: if (options->filename && *options->filename) { char *s, path[FN_REFLEN], dbpath[FN_REFLEN]; #if defined(WIN32) diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp new file mode 100644 index 00000000000..7798139cd35 --- /dev/null +++ b/storage/connect/json.cpp @@ -0,0 +1,1055 @@ +/*************** json CPP Declares Source Code File (.H) ***************/ +/* Name: json.cpp Version 1.0 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */ +/* */ +/* This file contains the JSON classes functions. */ +/***********************************************************************/ + +/***********************************************************************/ +/* Include relevant sections of the MariaDB header file. */ +/***********************************************************************/ +#include + +/***********************************************************************/ +/* Include application header files: */ +/* global.h is header containing all global declarations. */ +/* plgdbsem.h is header containing the DB application declarations. */ +/* xjson.h is header containing the JSON classes declarations. */ +/***********************************************************************/ +#include "global.h" +#include "plgdbsem.h" +#include "json.h" + +#define ARGS MY_MIN(24,len-i),s+MY_MAX(i-3,0) + +#if defined(WIN32) +#define EL "\r\n" +#else +#define EL "\n" +#endif + +/***********************************************************************/ +/* Parse a json string. */ +/***********************************************************************/ +PJSON ParseJson(PGLOBAL g, char *s, int len, int pretty, bool *comma) +{ + int i; + bool b = false; + PJSON jsp = NULL; + STRG src; + + if (!s || !len) { + strcpy(g->Message, "Void JSON object"); + return NULL; + } else if (comma) + *comma = false; + + src.str = s; + src.len = len; + + for (i = 0; i < len; i++) + switch (s[i]) { + case '[': + if (jsp) { + strcpy(g->Message, "More than one item in file"); + return NULL; + } else if (!(jsp = ParseArray(g, ++i, src))) + return NULL; + + break; + case '{': + if (jsp) { + strcpy(g->Message, "More than one item in file"); + return NULL; + } else if (!(jsp = ParseObject(g, ++i, src))) + return NULL; + break; + case ' ': + case '\t': + case '\n': + case '\r': + break; + case ',': + if (jsp && pretty == 1) { + if (comma) + *comma = true; + + break; + } // endif pretty + + sprintf(g->Message, "Unexpected ',' (pretty=%d)", pretty); + return NULL; + case '(': + b = true; + break; + case ')': + if (b) { + b = false; + break; + } // endif b + + default: + sprintf(g->Message, "Bad '%c' character near %.*s", + s[i], ARGS); + return NULL; + }; // endswitch s[i] + + if (!jsp) + sprintf(g->Message, "Invalid Json string '%.*s'", 50, s); + + return jsp; +} // end of ParseJson + +/***********************************************************************/ +/* Parse a JSON Array. */ +/***********************************************************************/ +PJAR ParseArray(PGLOBAL g, int& i, STRG& src) +{ + char *s = src.str; + int len = src.len; + int level = 0; + PJAR jarp = new(g) JARRAY; + PJVAL jvp = NULL; + + for (; i < len; i++) + switch (s[i]) { + case ',': + if (level < 2) { + sprintf(g->Message, "Unexpected ',' near %.*s",ARGS); + return NULL; + } else + level = 1; + + break; + case ']': + if (level == 1) { + sprintf(g->Message, "Unexpected ',]' near %.*s", ARGS); + return NULL; + } // endif level + + jarp->InitArray(g); + return jarp; + case ' ': + case '\t': + case '\n': + case '\r': + break; + default: + if (level == 2) { + sprintf(g->Message, "Unexpected value near %.*s", ARGS); + return NULL; + } else if ((jvp = ParseValue(g, i, src))) { + jarp->AddValue(g, jvp); + level = 2; + } else + return NULL; + + level = 2; + break; + }; // endswitch s[i] + + strcpy(g->Message, "Unexpected EOF in array"); + return NULL; +} // end of ParseArray + +/***********************************************************************/ +/* Parse a JSON Object. */ +/***********************************************************************/ +PJOB ParseObject(PGLOBAL g, int& i, STRG& src) +{ + PSZ key; + char *s = src.str; + int len = src.len; + int level = 0; + PJOB jobp = new(g) JOBJECT; + PJPR jpp = NULL; + + for (; i < len; i++) + switch (s[i]) { + case '"': + if (level < 2) { + if ((key = ParseString(g, ++i, src))) { + jpp = jobp->AddPair(g, key); + level = 1; + } else + return NULL; + + } else { + sprintf(g->Message, "misplaced string near %.*s", ARGS); + return NULL; + } // endif level + + break; + case ':': + if (level == 1) { + if (!(jpp->Val = ParseValue(g, ++i, src))) + return NULL; + + level = 2; + } else { + sprintf(g->Message, "Unexpected ':' near %.*s", ARGS); + return NULL; + } // endif level + + break; + case ',': + if (level < 2) { + sprintf(g->Message, "Unexpected ',' near %.*s", ARGS); + return NULL; + } else + level = 1; + + break; + case '}': + if (level == 1) { + sprintf(g->Message, "Unexpected '}' near %.*s", ARGS); + return NULL; + } // endif level + + return jobp; + case ' ': + case '\t': + case '\n': + case '\r': + break; + default: + sprintf(g->Message, "Unexpected character '%c' near %.*s", + s[i], ARGS); + return NULL; + }; // endswitch s[i] + + strcpy(g->Message, "Unexpected EOF in Object"); + return NULL; +} // end of ParseObject + +/***********************************************************************/ +/* Parse a JSON Value. */ +/***********************************************************************/ +PJVAL ParseValue(PGLOBAL g, int& i, STRG& src) +{ + char *strval, *s = src.str; + int n, len = src.len; + PJVAL jvp = new(g) JVALUE; + + for (; i < len; i++) + switch (s[i]) { + case ' ': + case '\t': + case '\n': + case '\r': + break; + default: + goto suite; + } // endswitch + + suite: + switch (s[i]) { + case '[': + if (!(jvp->Jsp = ParseArray(g, ++i, src))) + return NULL; + + break; + case '{': + if (!(jvp->Jsp = ParseObject(g, ++i, src))) + return NULL; + + break; + case '"': + if ((strval = ParseString(g, ++i, src))) + jvp->Value = AllocateValue(g, strval, TYPE_STRING); + else + return NULL; + + break; + case 't': + if (!strncmp(s + i, "true", 4)) { + n = 1; + jvp->Value = AllocateValue(g, &n, TYPE_TINY); + i += 3; + } else + goto err; + + break; + case 'f': + if (!strncmp(s + i, "false", 5)) { + n = 0; + jvp->Value = AllocateValue(g, &n, TYPE_TINY); + i += 4; + } else + goto err; + + break; + case 'n': + if (!strncmp(s + i, "null", 4)) + i += 3; + else + goto err; + + break; + case '-': + default: + if (s[i] == '-' || isdigit(s[i])) { + if (!(jvp->Value = ParseNumeric(g, i, src))) + goto err; + + } else + goto err; + + }; // endswitch s[i] + + jvp->Size = 1; + return jvp; + +err: + sprintf(g->Message, "Unexpected character '%c' near %.*s", + s[i], ARGS); + return NULL; +} // end of ParseValue + +/***********************************************************************/ +/* Unescape and parse a JSON string. */ +/***********************************************************************/ +char *ParseString(PGLOBAL g, int& i, STRG& src) +{ + char *p, *s = src.str; + int n = 0, len = src.len; + + // The size to allocate is not known yet + p = (char*)PlugSubAlloc(g, NULL, 0); + + for (; i < len; i++) + switch (s[i]) { + case '"': + p[n++] = 0; + PlugSubAlloc(g, NULL, n); + return p; + case '\\': + if (++i < len) { + if (s[i] == 'u') { + if (len - i > 5) { +// if (charset == utf8) { + char xs[5]; + UINT hex; + + xs[0] = s[++i]; + xs[1] = s[++i]; + xs[2] = s[++i]; + xs[3] = s[++i]; + xs[4] = 0; + hex = strtoul(xs, NULL, 16); + + if (hex < 0x80) { + p[n] = (UCHAR)hex; + } else if (hex < 0x800) { + p[n++] = (UCHAR)(0xC0 | (hex >> 6)); + p[n] = (UCHAR)(0x80 | (hex & 0x3F)); + } else if (hex < 0x10000) { + p[n++] = (UCHAR)(0xE0 | (hex >> 12)); + p[n++] = (UCHAR)(0x80 | ((hex >> 6) & 0x3f)); + p[n] = (UCHAR)(0x80 | (hex & 0x3f)); + } else + p[n] = '?'; + +#if 0 + } else { + char xs[3]; + UINT hex; + + i += 2; + xs[0] = s[++i]; + xs[1] = s[++i]; + xs[2] = 0; + hex = strtoul(xs, NULL, 16); + p[n] = (char)hex; + } // endif charset +#endif // 0 + } else + goto err; + + } else switch(s[i]) { + case 't': p[n] = '\t'; break; + case 'n': p[n] = '\n'; break; + case 'r': p[n] = '\r'; break; + case 'b': p[n] = '\b'; break; + case 'f': p[n] = '\f'; break; + default: p[n] = s[i]; break; + } // endswitch + + n++; + } else + goto err; + + break; + default: + p[n++] = s[i]; + break; + }; // endswitch s[i] + + err: + strcpy(g->Message, "Unexpected EOF in String"); + return NULL; +} // end of ParseString + +/***********************************************************************/ +/* Parse a JSON numeric value. */ +/***********************************************************************/ +PVAL ParseNumeric(PGLOBAL g, int& i, STRG& src) +{ + char *s = src.str, buf[50]; + int n = 0, len = src.len; + short nd = 0; + bool has_dot = false; + bool has_e = false; + bool found_digit = false; + PVAL valp = NULL; + + for (; i < len; i++) { + switch (s[i]) { + case '.': + if (!found_digit || has_dot || has_e) + goto err; + + has_dot = true; + break; + case 'e': + case 'E': + if (!found_digit || has_e) + goto err; + + has_e = true; + found_digit = false; + break; + case '+': + if (!has_e) + goto err; + + // passthru + case '-': + if (found_digit) + goto err; + + break; + default: + if (isdigit(s[i])) { + if (has_dot && !has_e) + nd++; // Number of decimals + + found_digit = true; + } else + goto fin; + + }; // endswitch s[i] + + buf[n++] = s[i]; + } // endfor i + + fin: + if (found_digit) { + buf[n] = 0; + + if (has_dot || has_e) { + double dv = strtod(buf, NULL); + + valp = AllocateValue(g, &dv, TYPE_DOUBLE, nd); + } else { + int iv = strtol(buf, NULL, 10); + + valp = AllocateValue(g, &iv, TYPE_INT); + } // endif has + + i--; // Unstack following character + return valp; + } else { + strcpy(g->Message, "No digit found"); + return NULL; + } // endif found_digit + + err: + strcpy(g->Message, "Unexpected EOF in number"); + return NULL; +} // end of ParseNumeric + +/***********************************************************************/ +/* Serialize a JSON tree: */ +/***********************************************************************/ +PSZ Serialize(PGLOBAL g, PJSON jsp, FILE *fs, int pretty) +{ + bool b = false, err = true; + JOUT *jp; + + g->Message[0] = 0; + + if (!jsp) { + strcpy(g->Message, "Null json tree"); + return NULL; + } else if (!fs) { + // Serialize to a string + jp = new(g) JOUTSTR(g); + b = pretty == 1; + } else if (pretty == 2) { + // Serialize to a pretty file + jp = new(g) JOUTPRT(g, fs); + } else { + // Serialize to a flat file + jp = new(g) JOUTFILE(g, fs); + b = pretty == 1; + } // endif's + + switch (jsp->GetType()) { + case TYPE_JAR: + err = SerializeArray(jp, (PJAR)jsp, b); + break; + case TYPE_JOB: + err = (b && jp->Write('\t')); + err |= SerializeObject(jp, (PJOB)jsp); + break; + default: + strcpy(g->Message, "json tree is not an Array or an Object"); + } // endswitch Type + + if (fs) { + fputc('\n', fs); + fclose(fs); + return (err) ? g->Message : NULL; + } else if (!err) { + PSZ str = ((JOUTSTR*)jp)->Strp; + + jp->Write('\0'); + PlugSubAlloc(g, NULL, ((JOUTSTR*)jp)->N); + return str; + } else { + if (!g->Message[0]) + strcpy(g->Message, "Error in Serialize"); + + return NULL; + } // endif's + +} // end of Serialize + +/***********************************************************************/ +/* Serialize a JSON Array. */ +/***********************************************************************/ +bool SerializeArray(JOUT *js, PJAR jarp, bool b) +{ + bool first = true; + + + if (js->Write('[')) + return true; + else if (b && (js->Write(EL) || js->Write('\t'))) + return true; + + for (int i = 0; i < jarp->size(); i++) { + if (first) + first = false; + else if (js->Write(',')) + return true; + else if (b && (js->Write(EL) || js->Write('\t'))) + return true; + + if (SerializeValue(js, jarp->GetValue(i))) + return true; + + } // endfor i + + if (b && js->Write(EL)) + return true; + + return js->Write(']'); +} // end of SerializeArray + +/***********************************************************************/ +/* Serialize a JSON Object. */ +/***********************************************************************/ +bool SerializeObject(JOUT *js, PJOB jobp) +{ + bool first = true; + + if (js->Write('{')) + return true; + + for (PJPR pair = jobp->First; pair; pair = pair->Next) { + if (first) + first = false; + else if (js->Write(',')) + return true; + + if (js->Write("\"") || + js->Write(pair->Key) || + js->Write("\"") || + js->Write(':') || + SerializeValue(js, pair->Val)) + return true; + + } // endfor i + + return js->Write('}'); +} // end of SerializeObject + +/***********************************************************************/ +/* Serialize a JSON Value. */ +/***********************************************************************/ +bool SerializeValue(JOUT *js, PJVAL jvp) +{ + PJAR jap; + PJOB jop; + PVAL valp; + + if ((jap = jvp->GetArray())) + return SerializeArray(js, jap, false); + else if ((jop = jvp->GetObject())) + return SerializeObject(js, jop); + else if (!(valp = jvp->Value) || valp->IsNull()) + return js->Write("null"); + else switch (valp->GetType()) { + case TYPE_TINY: + return js->Write(valp->GetTinyValue() ? "true" : "false"); + case TYPE_STRING: + return js->Escape(valp->GetCharValue()); + default: + if (valp->IsTypeNum()) { + char buf[32]; + + return js->Write(valp->GetCharString(buf)); + } // endif valp + + } // endswitch Type + +strcpy(js->g->Message, "Unrecognized value"); +return true; +} // end of SerializeValue + +/* -------------------------- Class JOUTSTR -------------------------- */ + +/***********************************************************************/ +/* JOUTSTR constructor. */ +/***********************************************************************/ +JOUTSTR::JOUTSTR(PGLOBAL g) : JOUT(g) +{ + PPOOLHEADER pph = (PPOOLHEADER)g->Sarea; + + N = 0; + Max = pph->FreeBlk; + Max = (Max > 512) ? Max - 512 : Max; + Strp = (char*)PlugSubAlloc(g, NULL, 0); // Size not know yet +} // end of JOUTSTR constructor + +/***********************************************************************/ +/* Concatenate a string to the Serialize string. */ +/***********************************************************************/ +bool JOUTSTR::Write(char *s) +{ + if (s) { + size_t len = strlen(s); + + if (N + len > Max) + return true; + + memcpy(Strp + N, s, len); + N += len; + return false; + } else + return true; + +} // end of Write + +/***********************************************************************/ +/* Concatenate a character to the Serialize string. */ +/***********************************************************************/ +bool JOUTSTR::Write(char c) +{ + if (N + 1 > Max) + return true; + + Strp[N++] = c; + return false; +} // end of Write + +/***********************************************************************/ +/* Escape and Concatenate a string to the Serialize string. */ +/***********************************************************************/ +bool JOUTSTR::Escape(char *s) +{ + Write('"'); + + for (unsigned int i = 0; i < strlen(s); i++) + switch (s[i]) { + case '\t': Write("\\t"); break; + case '\n': Write("\\t"); break; + case '\r': Write("\\t"); break; + case '\b': Write("\\t"); break; + case '\f': Write("\\t"); break; + case '"': Write('\\'); + // passthru + default: + Write(s[i]); + break; + } // endswitch s[i] + + Write('"'); + return false; +} // end of Escape + +/* ------------------------- Class JOUTFILE -------------------------- */ + +/***********************************************************************/ +/* Write a string to the Serialize file. */ +/***********************************************************************/ +bool JOUTFILE::Write(char *s) +{ + // This is temporary + fputs(s, Stream); + return false; +} // end of Write + +/***********************************************************************/ +/* Write a character to the Serialize file. */ +/***********************************************************************/ +bool JOUTFILE::Write(char c) +{ + // This is temporary + fputc(c, Stream); + return false; +} // end of Write + +/***********************************************************************/ +/* Escape and Concatenate a string to the Serialize string. */ +/***********************************************************************/ +bool JOUTFILE::Escape(char *s) +{ + // This is temporary + fputc('"', Stream); + + for (unsigned int i = 0; i < strlen(s); i++) + switch (s[i]) { + case '\t': fputs("\\t", Stream); break; + case '\n': fputs("\\n", Stream); break; + case '\r': fputs("\\r", Stream); break; + case '\b': fputs("\\b", Stream); break; + case '\f': fputs("\\f", Stream); break; + case '"': fputs("\\\"", Stream); break; + default: + fputc(s[i], Stream); + break; + } // endswitch s[i] + + fputc('"', Stream); + return false; +} // end of Escape + +/* ------------------------- Class JOUTPRT --------------------------- */ + +/***********************************************************************/ +/* Write a string to the Serialize pretty file. */ +/***********************************************************************/ +bool JOUTPRT::Write(char *s) +{ + // This is temporary + if (B) { + fputs(EL, Stream); + M--; + + for (int i = 0; i < M; i++) + fputc('\t', Stream); + + B = false; + } // endif B + + fputs(s, Stream); + return false; +} // end of Write + +/***********************************************************************/ +/* Write a character to the Serialize pretty file. */ +/***********************************************************************/ +bool JOUTPRT::Write(char c) +{ + switch (c) { + case ':': + fputs(": ", Stream); + break; + case '{': + case '[': +#if 0 + if (M) + fputs(EL, Stream); + + for (int i = 0; i < M; i++) + fputc('\t', Stream); +#endif // 0 + + fputc(c, Stream); + fputs(EL, Stream); + M++; + + for (int i = 0; i < M; i++) + fputc('\t', Stream); + + break; + case '}': + case ']': + M--; + fputs(EL, Stream); + + for (int i = 0; i < M; i++) + fputc('\t', Stream); + + fputc(c, Stream); + B = true; + break; + case ',': + fputc(c, Stream); + fputs(EL, Stream); + + for (int i = 0; i < M; i++) + fputc('\t', Stream); + + B = false; + break; + default: + fputc(c, Stream); + } // endswitch c + +return false; +} // end of Write + +/* -------------------------- Class JOBJECT -------------------------- */ + +/***********************************************************************/ +/* Add a new pair to an Object. */ +/***********************************************************************/ +PJPR JOBJECT::AddPair(PGLOBAL g, PSZ key) +{ + PJPR jpp = new(g) JPAIR(key); + + if (Last) + Last->Next = jpp; + else + First = jpp; + + Last = jpp; + Size++; + return jpp; +} // end of AddPair + +/***********************************************************************/ +/* Get the value corresponding to the given key. */ +/***********************************************************************/ +PJVAL JOBJECT::GetValue(const char* key) +{ + for (PJPR jp = First; jp; jp = jp->Next) + if (!strcmp(jp->Key, key)) + return jp->Val; + + return NULL; +} // end of GetValue; + +/***********************************************************************/ +/* Return the text corresponding to all keys (XML like). */ +/***********************************************************************/ +PSZ JOBJECT::GetText(PGLOBAL g) +{ + char *p, *text = (char*)PlugSubAlloc(g, NULL, 0); + bool b = true; + + if (!First) + return NULL; + else for (PJPR jp = First; jp; jp = jp->Next) { + if (!(p = jp->Val->GetString())) + p = "???"; + + if (b) { + strcpy(text, p); + b = false; + } else + strcat(strcat(text, " "), p); + + } // endfor jp + + PlugSubAlloc(g, NULL, strlen(text) + 1); + return text; +} // end of GetValue; + +/***********************************************************************/ +/* Set or add a value corresponding to the given key. */ +/***********************************************************************/ +void JOBJECT::SetValue(PGLOBAL g, PJVAL jvp, PSZ key) +{ + PJPR jp; + + for (jp = First; jp; jp = jp->Next) + if (!strcmp(jp->Key, key)) { + jp->Val = jvp; + break; + } // endif key + + if (!jp) { + jp = AddPair(g, key); + jp->Val = jvp; + } // endif jp + +} // end of SetValue + +/* -------------------------- Class JARRAY --------------------------- */ + +/***********************************************************************/ +/* Make the array of values from the values list. */ +/***********************************************************************/ +void JARRAY::InitArray(PGLOBAL g) +{ + int i; + PJVAL jvp; + + for (Size = 0, jvp = First; jvp; jvp = jvp->Next) + if (!jvp->Del) + Size++; + + if (!Size) { + return; + } else if (Size > Alloc) { + // No need to realloc after deleting values + Mvals = (PJVAL*)PlugSubAlloc(g, NULL, Size * sizeof(PJVAL)); + Alloc = Size; + } // endif Size + + for (i = 0, jvp = First; jvp; jvp = jvp->Next) + if (!jvp->Del) + Mvals[i++] = jvp; + +} // end of InitArray + +/***********************************************************************/ +/* Get the Nth value of an Array. */ +/***********************************************************************/ +PJVAL JARRAY::GetValue(int i) +{ + if (Mvals && i >= 0 && i < Size) + return Mvals[i]; + else + return NULL; +} // end of GetValue + +/***********************************************************************/ +/* Add a Value to the Arrays Value list. */ +/***********************************************************************/ +PJVAL JARRAY::AddValue(PGLOBAL g, PJVAL jvp) +{ + if (!jvp) + jvp = new(g) JVALUE; + + if (Last) + Last->Next = jvp; + else + First = jvp; + + Last = jvp; + return jvp; +} // end of AddValue + +/***********************************************************************/ +/* Add a Value to the Arrays Value list. */ +/***********************************************************************/ +bool JARRAY::SetValue(PGLOBAL g, PJVAL jvp, int n) +{ + int i = 0; + PJVAL jp, *jpp = &First; + + for (i = 0, jp = First; i < n; i++, jp = *(jpp = &jp->Next)) + if (!jp) + *jpp = jp = new(g) JVALUE; + + *jpp = jvp; + jvp->Next = (jp ? jp->Next : NULL); + return false; +} // end of SetValue + +/***********************************************************************/ +/* Delete a Value from the Arrays Value list. */ +/***********************************************************************/ +bool JARRAY::DeleteValue(int n) +{ + PJVAL jvp = GetValue(n); + + if (jvp) { + jvp->Del = true; + return false; + } else + return true; + +} // end of DeleteValue + +/* -------------------------- Class JVALUE- -------------------------- */ + +/***********************************************************************/ +/* Constructor for a Value with a given string or numeric value. */ +/***********************************************************************/ +JVALUE::JVALUE(PGLOBAL g, PVAL valp) : JSON() +{ + Jsp = NULL; + Value = AllocateValue(g, valp); + Next = NULL; + Del = false; +} // end of JVALUE constructor + +/***********************************************************************/ +/* Returns the type of the Value's value. */ +/***********************************************************************/ +JTYP JVALUE::GetValType(void) +{ + if (Jsp) + return Jsp->GetType(); + else if (Value) + return (JTYP)Value->GetType(); + else + return (JTYP)TYPE_VOID; + +} // end of GetValType + +/***********************************************************************/ +/* Return the Value's Object value. */ +/***********************************************************************/ +PJOB JVALUE::GetObject(void) +{ + if (Jsp && Jsp->GetType() == TYPE_JOB) + return (PJOB)Jsp; + + return NULL; +} // end of GetObject + +/***********************************************************************/ +/* Return the Value's Array value. */ +/***********************************************************************/ +PJAR JVALUE::GetArray(void) +{ + if (Jsp && Jsp->GetType() == TYPE_JAR) + return (PJAR)Jsp; + + return NULL; +} // end of GetArray + +/***********************************************************************/ +/* Return the Value's Integer value. */ +/***********************************************************************/ +int JVALUE::GetInteger(void) +{ + return (Value) ? Value->GetIntValue() : 0; +} // end of GetInteger + +/***********************************************************************/ +/* Return the Value's Double value. */ +/***********************************************************************/ +double JVALUE::GetFloat(void) +{ + return (Value) ? Value->GetFloatValue() : 0.0; +} // end of GetFloat + +/***********************************************************************/ +/* Return the Value's String value. */ +/***********************************************************************/ +PSZ JVALUE::GetString(void) +{ + char buf[32]; + return (Value) ? Value->GetCharString(buf) : NULL; +} // end of GetString + diff --git a/storage/connect/json.h b/storage/connect/json.h new file mode 100644 index 00000000000..1e84e64b668 --- /dev/null +++ b/storage/connect/json.h @@ -0,0 +1,240 @@ +/**************** json H Declares Source Code File (.H) ****************/ +/* Name: json.h Version 1.0 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */ +/* */ +/* This file contains the JSON classes declares. */ +/***********************************************************************/ +#include "value.h" + +#if defined(_DEBUG) +#define X assert(false); +#else +#define X +#endif + +enum JTYP {TYPE_JSON = 12, TYPE_JAR, TYPE_JOB, TYPE_JVAL}; + +class JOUT; +class JSON; +class JMAP; +class JVALUE; +class JOBJECT; +class JARRAY; + +typedef class JPAIR *PJPR; +typedef class JSON *PJSON; +typedef class JVALUE *PJVAL; +typedef class JOBJECT *PJOB; +typedef class JARRAY *PJAR; + +typedef struct { + char *str; + int len; + } STRG, *PSG; + +PJSON ParseJson(PGLOBAL g, char *s, int n, int prty, bool *b = NULL); +PJAR ParseArray(PGLOBAL g, int& i, STRG& src); +PJOB ParseObject(PGLOBAL g, int& i, STRG& src); +PJVAL ParseValue(PGLOBAL g, int& i, STRG& src); +char *ParseString(PGLOBAL g, int& i, STRG& src); +PVAL ParseNumeric(PGLOBAL g, int& i, STRG& src); +PSZ Serialize(PGLOBAL g, PJSON jsp, FILE *fs, int pretty); +bool SerializeArray(JOUT *js, PJAR jarp, bool b); +bool SerializeObject(JOUT *js, PJOB jobp); +bool SerializeValue(JOUT *js, PJVAL jvp); + +/***********************************************************************/ +/* Class JOUT. Used by Serialize. */ +/***********************************************************************/ +class JOUT : public BLOCK { + public: + JOUT(PGLOBAL gp) : BLOCK() {g = gp;} + + virtual bool Write(char *s) = 0; + virtual bool Write(char c) = 0; + virtual bool Escape(char *s) = 0; + + // Member + PGLOBAL g; +}; // end of class JOUT + +/***********************************************************************/ +/* Class JOUTSTR. Used to Serialize to a string. */ +/***********************************************************************/ +class JOUTSTR : public JOUT { + public: + JOUTSTR(PGLOBAL g); + + virtual bool Write(char *s); + virtual bool Write(char c); + virtual bool Escape(char *s); + + // Member + char *Strp; // The serialized string + size_t N; // Position of next char + size_t Max; // String max size +}; // end of class JOUTSTR + +/***********************************************************************/ +/* Class JOUTFILE. Used to Serialize to a file. */ +/***********************************************************************/ +class JOUTFILE : public JOUT { + public: + JOUTFILE(PGLOBAL g, FILE *str) : JOUT(g) {Stream = str;} + + virtual bool Write(char *s); + virtual bool Write(char c); + virtual bool Escape(char *s); + + // Member + FILE *Stream; +}; // end of class JOUTFILE + +/***********************************************************************/ +/* Class JOUTPRT. Used to Serialize to a pretty file. */ +/***********************************************************************/ +class JOUTPRT : public JOUTFILE { + public: + JOUTPRT(PGLOBAL g, FILE *str) : JOUTFILE(g, str) {M = 0; B = false;} + + virtual bool Write(char *s); + virtual bool Write(char c); + + // Member + int M; + bool B; +}; // end of class JOUTPRT + +/***********************************************************************/ +/* Class PAIR. The pairs of a json Object. */ +/***********************************************************************/ +class JPAIR : public BLOCK { + friend class JOBJECT; + friend PJOB ParseObject(PGLOBAL, int&, STRG&); + friend bool SerializeObject(JOUT *, PJOB); + public: + JPAIR(PSZ key) : BLOCK() {Key = key; Val = NULL; Next = NULL;} + + protected: + PSZ Key; // This pair key name + PJVAL Val; // To the value of the pair + PJPR Next; // To the next pair +}; // end of class JPAIR + +/***********************************************************************/ +/* Class JSON. The base class for all other json classes. */ +/***********************************************************************/ +class JSON : public BLOCK { + public: + JSON(void) {Size = 0;} + + int size(void) {return Size;} + virtual void Clear(void) {Size = 0;} + virtual JTYP GetType(void) {return TYPE_JSON;} + virtual JTYP GetValType(void) {X return TYPE_JSON;} + virtual void InitArray(PGLOBAL g) {X} + virtual PJVAL AddValue(PGLOBAL g, PJVAL jvp = NULL) {X return NULL;} + virtual PJPR AddPair(PGLOBAL g, PSZ key) {X return NULL;} + virtual PJVAL GetValue(const char *key) {X return NULL;} + virtual PJOB GetObject(void) {X return NULL;} + virtual PJAR GetArray(void) {X return NULL;} + virtual PJVAL GetValue(int i) {X return NULL;} + virtual PVAL GetValue(void) {X return NULL;} + virtual PJSON GetJson(void) {X return NULL;} + virtual int GetInteger(void) {X return 0;} + virtual double GetFloat() {X return 0.0;} + virtual PSZ GetString() {X return NULL;} + virtual PSZ GetText(PGLOBAL g) {X return NULL;} + virtual bool SetValue(PGLOBAL g, PJVAL jvp, int i) {X return true;} + virtual void SetValue(PGLOBAL g, PJVAL jvp, PSZ key) {X} + virtual void SetValue(PVAL valp) {X} + virtual void SetValue(PJSON jsp) {X} + virtual bool DeleteValue(int i) {X return true;} + + protected: + int Size; +}; // end of class JSON + +/***********************************************************************/ +/* Class JOBJECT: contains a list of value pairs. */ +/***********************************************************************/ +class JOBJECT : public JSON { + friend PJOB ParseObject(PGLOBAL, int&, STRG&); + friend bool SerializeObject(JOUT *, PJOB); + public: + JOBJECT(void) : JSON() {First = Last = NULL;} + + virtual void Clear(void) {First = Last = NULL; Size = 0;} + virtual JTYP GetType(void) {return TYPE_JOB;} + virtual PJPR AddPair(PGLOBAL g, PSZ key); + virtual PJOB GetObject(void) {return this;} + virtual PJVAL GetValue(const char* key); + virtual PSZ GetText(PGLOBAL g); + virtual void SetValue(PGLOBAL g, PJVAL jvp, PSZ key); + + protected: + PJPR First; + PJPR Last; +}; // end of class JOBJECT + +/***********************************************************************/ +/* Class JARRAY. */ +/***********************************************************************/ +class JARRAY : public JSON { + friend PJAR ParseArray(PGLOBAL, int&, STRG&); + public: + JARRAY(void) : JSON() {Alloc = 0; First = Last = NULL; Mvals = NULL;} + + virtual void Clear(void) {First = Last = NULL; Size = 0;} + virtual JTYP GetType(void) {return TYPE_JAR;} + virtual PJAR GetArray(void) {return this;} + virtual PJVAL AddValue(PGLOBAL g, PJVAL jvp = NULL); + virtual void InitArray(PGLOBAL g); + virtual PJVAL GetValue(int i); + virtual bool SetValue(PGLOBAL g, PJVAL jvp, int i); + virtual bool DeleteValue(int n); + + protected: + // Members + int Alloc; // The Mvals allocated size + PJVAL First; // Used when constructing + PJVAL Last; // Last constructed value + PJVAL *Mvals; // Allocated when finished +}; // end of class JARRAY + +/***********************************************************************/ +/* Class JVALUE. */ +/***********************************************************************/ +class JVALUE : public JSON { + friend class JARRAY; + friend PJVAL ParseValue(PGLOBAL, int&, STRG&); + friend bool SerializeValue(JOUT *, PJVAL); + public: + JVALUE(void) : JSON() + {Jsp = NULL; Value = NULL; Next = NULL; Del = false;} + JVALUE(PJSON jsp) : JSON() + {Jsp = jsp; Value = NULL; Next = NULL; Del = false;} + JVALUE(PGLOBAL g, PVAL valp); + + virtual void Clear(void) + {Jsp = NULL; Value = NULL; Next = NULL; Del = false; Size = 0;} + virtual JTYP GetType(void) {return TYPE_JVAL;} + virtual JTYP GetValType(void); + virtual PJOB GetObject(void); + virtual PJAR GetArray(void); + virtual PVAL GetValue(void) {return Value;} + virtual PJSON GetJson(void) {return (Jsp ? Jsp : this);} + virtual int GetInteger(void); + virtual double GetFloat(void); + virtual PSZ GetString(void); + virtual void SetValue(PVAL valp) {Value = valp;} + virtual void SetValue(PJSON jsp) {Jsp = jsp;} + + protected: + PJSON Jsp; // To the json value + PVAL Value; // The numeric value + PJVAL Next; // Next value in array + bool Del; // True when deleted +}; // end of class JVALUE + diff --git a/storage/connect/msgid.h b/storage/connect/msgid.h index 4496994afa3..0e9c036dc49 100644 --- a/storage/connect/msgid.h +++ b/storage/connect/msgid.h @@ -318,3 +318,8 @@ #define MSG_XPATH_CNTX_ERR 517 #define MSG_XPATH_EVAL_ERR 518 #define MSG_XPATH_NOT_SUPP 519 +#define MSG_ZERO_DIVIDE 520 +#define MSG_FIX_OVFLW_ADD 521 +#define MSG_FIX_OVFLW_TIMES 522 +#define MSG_FIX_UNFLW_ADD 523 +#define MSG_FIX_UNFLW_TIMES 524 diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 57b2e5d1a9c..0ae0537ba6f 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -89,7 +89,7 @@ #include "tabpivot.h" #endif // PIVOT_SUPPORT #include "tabvir.h" -//#include "tabjson.h" +#include "tabjson.h" #include "ha_connect.h" #include "mycat.h" @@ -140,7 +140,7 @@ TABTYPE GetTypeID(const char *type) : (!stricmp(type, "PIVOT")) ? TAB_PIVOT #endif : (!stricmp(type, "VIR")) ? TAB_VIR -// : (!stricmp(type, "JSON")) ? TAB_JSON + : (!stricmp(type, "JSON")) ? TAB_JSON : (!stricmp(type, "OEM")) ? TAB_OEM : TAB_NIY; } // end of GetTypeID @@ -161,7 +161,7 @@ bool IsFileType(TABTYPE type) case TAB_XML: case TAB_INI: case TAB_VEC: -// case TAB_JSON: + case TAB_JSON: isfile= true; break; default: @@ -254,6 +254,7 @@ bool IsTypeIndexable(TABTYPE type) case TAB_BIN: case TAB_VEC: case TAB_DBF: + case TAB_JSON: idx= true; break; default: @@ -279,6 +280,7 @@ int GetIndexType(TABTYPE type) case TAB_BIN: case TAB_VEC: case TAB_DBF: + case TAB_JSON: xtyp= 1; break; case TAB_MYSQL: @@ -542,7 +544,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am) case TAB_PIVOT: tdp= new(g) PIVOTDEF; break; #endif // PIVOT_SUPPORT case TAB_VIR: tdp= new(g) VIRDEF; break; -// case TAB_JSON: tdp= new(g) JSONDEF; break; + case TAB_JSON: tdp= new(g) JSONDEF; break; default: sprintf(g->Message, MSG(BAD_TABLE_TYPE), am, name); } // endswitch diff --git a/storage/connect/mysql-test/connect/r/json.result b/storage/connect/mysql-test/connect/r/json.result new file mode 100644 index 00000000000..137e82b1bc4 --- /dev/null +++ b/storage/connect/mysql-test/connect/r/json.result @@ -0,0 +1,439 @@ +# +# Testing doc samples +# +CREATE TABLE t1 +( +ISBN CHAR(15), +LANG CHAR(2), +SUBJECT CHAR(32), +AUTHOR CHAR(64), +TITLE CHAR(32), +TRANSLATION CHAR(32), +TRANSLATOR CHAR(80), +PUBLISHER CHAR(32), +DATEPUB int(4) +) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +ISBN LANG SUBJECT AUTHOR TITLE TRANSLATION TRANSLATOR PUBLISHER DATEPUB +9782212090819 fr applications Jean-Christophe Bernadac Construire une application XML Eyrolles Paris 1999 +9782840825685 fr applications William J. Pardi XML en Action adapté de l'anglais par James Guerin Microsoft Press Paris 1999 +DROP TABLE t1; +# +# Testing Jpath. Get the number of authors +# +CREATE TABLE t1 +( +ISBN CHAR(15), +Language CHAR(2) FIELD_FORMAT='LANG', +Subject CHAR(32) FIELD_FORMAT='SUBJECT', +Authors INT(2) FIELD_FORMAT='AUTHOR:[#]', +Title CHAR(32) FIELD_FORMAT='TITLE', +Translation CHAR(32) FIELD_FORMAT='TRANSLATION', +Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', +Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', +Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', +Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +ISBN Language Subject Authors Title Translation Translator Publisher Location Year +9782212090819 fr applications 2 Construire une application XML Eyrolles Paris 1999 +9782840825685 fr applications 1 XML en Action adapté de l'anglais par James Guerin Microsoft Press Paris 1999 +DROP TABLE t1; +# +# Concatenates the authors +# +CREATE TABLE t1 +( +ISBN CHAR(15), +Language CHAR(2) FIELD_FORMAT='LANG', +Subject CHAR(32) FIELD_FORMAT='SUBJECT', +AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:FIRSTNAME', +AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:LASTNAME', +Title CHAR(32) FIELD_FORMAT='TITLE', +Translation CHAR(32) FIELD_FORMAT='TRANSLATION', +Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', +Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', +Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', +Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year +9782212090819 fr applications Jean-Christophe and François Bernadac and Knab Construire une application XML Eyrolles Paris 1999 +9782840825685 fr applications William J. Pardi XML en Action adapté de l'anglais par James Guerin Microsoft Press Paris 1999 +DROP TABLE t1; +# +# Testing expanding authors +# +CREATE TABLE t1 +( +ISBN CHAR(15), +Language CHAR(2) FIELD_FORMAT='LANG', +Subject CHAR(32) FIELD_FORMAT='SUBJECT', +AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:FIRSTNAME', +AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:LASTNAME', +Title CHAR(32) FIELD_FORMAT='TITLE', +Translation CHAR(32) FIELD_FORMAT='TRANSLATION', +Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', +Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', +Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', +Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year +9782212090819 fr applications Jean-Christophe Bernadac Construire une application XML Eyrolles Paris 1999 +9782212090819 fr applications François Knab Construire une application XML Eyrolles Paris 1999 +9782840825685 fr applications William J. Pardi XML en Action adapté de l'anglais par James Guerin Microsoft Press Paris 1999 +UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab'; +SELECT * FROM t1 WHERE ISBN = '9782212090819'; +ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year +9782212090819 fr applications Jean-Christophe Bernadac Construire une application XML Eyrolles Paris 1999 +9782212090819 fr applications Philippe Knab Construire une application XML Eyrolles Paris 1999 +# +# To add an author a new table must be created +# +CREATE TABLE t2 ( +FIRSTNAME CHAR(32), +LASTNAME CHAR(32)) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn' OPTION_LIST='Object=[2]:AUTHOR'; +SELECT * FROM t2; +FIRSTNAME LASTNAME +William J. Pardi +INSERT INTO t2 VALUES('Charles','Dickens'); +SELECT * FROM t1; +ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year +9782212090819 fr applications Jean-Christophe Bernadac Construire une application XML Eyrolles Paris 1999 +9782212090819 fr applications Philippe Knab Construire une application XML Eyrolles Paris 1999 +9782840825685 fr applications William J. Pardi XML en Action adapté de l'anglais par James Guerin Microsoft Press Paris 1999 +9782840825685 fr applications Charles Dickens XML en Action adapté de l'anglais par James Guerin Microsoft Press Paris 1999 +DROP TABLE t1; +DROP TABLE t2; +# +# Check the biblio file has the good format +# +CREATE TABLE t1 +( +line char(255) +) +ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +line +[ + { + "ISBN": "9782212090819", + "LANG": "fr", + "SUBJECT": "applications", + "AUTHOR": [ + { + "FIRSTNAME": "Jean-Christophe", + "LASTNAME": "Bernadac" + }, + { + "FIRSTNAME": "Philippe", + "LASTNAME": "Knab" + } + ], + "TITLE": "Construire une application XML", + "PUBLISHER": { + "NAME": "Eyrolles", + "PLACE": "Paris" + }, + "DATEPUB": 1999 + }, + { + "ISBN": "9782840825685", + "LANG": "fr", + "SUBJECT": "applications", + "AUTHOR": [ + { + "FIRSTNAME": "William J.", + "LASTNAME": "Pardi" + }, + { + "FIRSTNAME": "Charles", + "LASTNAME": "Dickens" + } + ], + "TITLE": "XML en Action", + "TRANSLATION": "adapté de l'anglais par", + "TRANSLATOR": { + "FIRSTNAME": "James", + "LASTNAME": "Guerin" + }, + "PUBLISHER": { + "NAME": "Microsoft Press", + "PLACE": "Paris" + }, + "DATEPUB": 1999 + } +] +DROP TABLE t1; +# +# A file with 2 arrays +# +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK::EXPENSE:["+"]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK::EXPENSE:[+]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t1; +WHO WEEK WHAT AMOUNT +Joe 3 Beer+Food+Food+Car 69.00 +Joe 4 Beer+Beer+Food+Food+Beer 83.00 +Joe 5 Beer+Food 26.00 +Beth 3 Beer 16.00 +Beth 4 Food+Beer 32.00 +Beth 5 Food+Beer 32.00 +Janet 3 Car+Food+Beer 55.00 +Janet 4 Car 17.00 +Janet 5 Beer+Car+Beer+Food 57.00 +DROP TABLE t1; +# +# Cannot be fully expanded +# +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t1; +ERROR HY000: Got error 174 'Cannot expand more than one array' from CONNECT +DROP TABLE t1; +# +# Expand expense in 3 one week tables +# +CREATE TABLE t2 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t2; +WHO WEEK WHAT AMOUNT +Joe 3 Beer 18.00 +Joe 3 Food 12.00 +Joe 3 Food 19.00 +Joe 3 Car 20.00 +Beth 3 Beer 16.00 +Janet 3 Car 19.00 +Janet 3 Food 18.00 +Janet 3 Beer 18.00 +CREATE TABLE t3 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t3; +WHO WEEK WHAT AMOUNT +Joe 4 Beer 19.00 +Joe 4 Beer 16.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 +Joe 4 Beer 14.00 +Beth 4 Food 17.00 +Beth 4 Beer 15.00 +Janet 4 Car 17.00 +CREATE TABLE t4 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[3]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t4; +WHO WEEK WHAT AMOUNT +Joe 5 Beer 14.00 +Joe 5 Food 12.00 +Beth 5 Food 12.00 +Beth 5 Beer 20.00 +Janet 5 Beer 14.00 +Janet 5 Car 12.00 +Janet 5 Beer 19.00 +Janet 5 Food 12.00 +# +# The expanded table is made as a TBL table +# +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32), +AMOUNT DOUBLE(8,2)) +ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t2,t3,t4'; +SELECT * FROM t1; +WHO WEEK WHAT AMOUNT +Joe 3 Beer 18.00 +Joe 3 Food 12.00 +Joe 3 Food 19.00 +Joe 3 Car 20.00 +Beth 3 Beer 16.00 +Janet 3 Car 19.00 +Janet 3 Food 18.00 +Janet 3 Beer 18.00 +Joe 4 Beer 19.00 +Joe 4 Beer 16.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 +Joe 4 Beer 14.00 +Beth 4 Food 17.00 +Beth 4 Beer 15.00 +Janet 4 Car 17.00 +Joe 5 Beer 14.00 +Joe 5 Food 12.00 +Beth 5 Food 12.00 +Beth 5 Beer 20.00 +Janet 5 Beer 14.00 +Janet 5 Car 12.00 +Janet 5 Beer 19.00 +Janet 5 Food 12.00 +DROP TABLE t1, t2, t3, t4; +# +# Three partial JSON tables +# +CREATE TABLE t2 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.jsn'; +SELECT * FROM t2; +WHO WEEK WHAT AMOUNT +Joe 3 Beer 18.00 +Joe 3 Food 12.00 +Joe 3 Food 19.00 +Joe 3 Car 20.00 +Beth 3 Beer 16.00 +Janet 3 Car 19.00 +Janet 3 Food 18.00 +Janet 3 Beer 18.00 +CREATE TABLE t3 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.jsn'; +SELECT * FROM t3; +WHO WEEK WHAT AMOUNT +Joe 4 Beer 19.00 +Joe 4 Beer 16.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 +Joe 4 Beer 14.00 +Beth 4 Food 17.00 +Beth 4 Beer 15.00 +Janet 4 Car 17.00 +CREATE TABLE t4 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.jsn'; +SELECT * FROM t4; +WHO WEEK WHAT AMOUNT +Joe 5 Beer 14.00 +Joe 5 Food 12.00 +Beth 5 Food 12.00 +Beth 5 Beer 20.00 +Janet 5 Beer 14.00 +Janet 5 Car 12.00 +Janet 5 Beer 19.00 +Janet 5 Food 12.00 +# +# The complete table can be a multiple JSON table +# +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.jsn' MULTIPLE=1; +SELECT * FROM t1; +WHO WEEK WHAT AMOUNT +Joe 3 Beer 18.00 +Joe 3 Food 12.00 +Joe 3 Food 19.00 +Joe 3 Car 20.00 +Beth 3 Beer 16.00 +Janet 3 Car 19.00 +Janet 3 Food 18.00 +Janet 3 Beer 18.00 +Joe 4 Beer 19.00 +Joe 4 Beer 16.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 +Joe 4 Beer 14.00 +Beth 4 Food 17.00 +Beth 4 Beer 15.00 +Janet 4 Car 17.00 +Joe 5 Beer 14.00 +Joe 5 Food 12.00 +Beth 5 Food 12.00 +Beth 5 Beer 20.00 +Janet 5 Beer 14.00 +Janet 5 Car 12.00 +Janet 5 Beer 19.00 +Janet 5 Food 12.00 +DROP TABLE t1; +# +# Or also a partition JSON table +# +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.jsn'; +ALTER TABLE t1 +PARTITION BY LIST COLUMNS(WEEK) ( +PARTITION `3` VALUES IN(3), +PARTITION `4` VALUES IN(4), +PARTITION `5` VALUES IN(5)); +Warnings: +Warning 1105 Data repartition in 3 is unchecked +Warning 1105 Data repartition in 4 is unchecked +Warning 1105 Data repartition in 5 is unchecked +SHOW WARNINGS; +Level Code Message +Warning 1105 Data repartition in 3 is unchecked +Warning 1105 Data repartition in 4 is unchecked +Warning 1105 Data repartition in 5 is unchecked +SELECT * FROM t1; +WHO WEEK WHAT AMOUNT +Joe 3 Beer 18.00 +Joe 3 Food 12.00 +Joe 3 Food 19.00 +Joe 3 Car 20.00 +Beth 3 Beer 16.00 +Janet 3 Car 19.00 +Janet 3 Food 18.00 +Janet 3 Beer 18.00 +Joe 4 Beer 19.00 +Joe 4 Beer 16.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 +Joe 4 Beer 14.00 +Beth 4 Food 17.00 +Beth 4 Beer 15.00 +Janet 4 Car 17.00 +Joe 5 Beer 14.00 +Joe 5 Food 12.00 +Beth 5 Food 12.00 +Beth 5 Beer 20.00 +Janet 5 Beer 14.00 +Janet 5 Car 12.00 +Janet 5 Beer 19.00 +Janet 5 Food 12.00 +SELECT * FROM t1 WHERE WEEK = 4; +WHO WEEK WHAT AMOUNT +Joe 4 Beer 19.00 +Joe 4 Beer 16.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 +Joe 4 Beer 14.00 +Beth 4 Food 17.00 +Beth 4 Beer 15.00 +Janet 4 Car 17.00 +DROP TABLE t1, t2, t3, t4; diff --git a/storage/connect/mysql-test/connect/std_data/biblio.jsn b/storage/connect/mysql-test/connect/std_data/biblio.jsn new file mode 100644 index 00000000000..bab8fd24305 --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/biblio.jsn @@ -0,0 +1,45 @@ +[ + { + "ISBN": "9782212090819", + "LANG": "fr", + "SUBJECT": "applications", + "AUTHOR": [ + { + "FIRSTNAME": "Jean-Christophe", + "LASTNAME": "Bernadac" + }, + { + "FIRSTNAME": "François", + "LASTNAME": "Knab" + } + ], + "TITLE": "Construire une application XML", + "PUBLISHER": { + "NAME": "Eyrolles", + "PLACE": "Paris" + }, + "DATEPUB": 1999 + }, + { + "ISBN": "9782840825685", + "LANG": "fr", + "SUBJECT": "applications", + "AUTHOR": [ + { + "FIRSTNAME": "William J.", + "LASTNAME": "Pardi" + } + ], + "TITLE": "XML en Action", + "TRANSLATION": "adapté de l'anglais par", + "TRANSLATOR": { + "FIRSTNAME": "James", + "LASTNAME": "Guerin" + }, + "PUBLISHER": { + "NAME": "Microsoft Press", + "PLACE": "Paris" + }, + "DATEPUB": 1999 + } +] diff --git a/storage/connect/mysql-test/connect/std_data/expense.jsn b/storage/connect/mysql-test/connect/std_data/expense.jsn new file mode 100644 index 00000000000..e65ad5261f1 --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/expense.jsn @@ -0,0 +1,158 @@ +[ + { + "WHO": "Joe", + "WEEK": [ + { + "NUMBER": 3, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 18.00 + }, + { + "WHAT": "Food", + "AMOUNT": 12.00 + }, + { + "WHAT": "Food", + "AMOUNT": 19.00 + }, + { + "WHAT": "Car", + "AMOUNT": 20.00 + } + ] + }, + { + "NUMBER": 4, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 19.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 16.00 + }, + { + "WHAT": "Food", + "AMOUNT": 17.00 + }, + { + "WHAT": "Food", + "AMOUNT": 17.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 14.00 + } + ] + }, + { + "NUMBER": 5, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 14.00 + }, + { + "WHAT": "Food", + "AMOUNT": 12.00 + } + ] + } + ] + }, + { + "WHO": "Beth", + "WEEK": [ + { + "NUMBER": 3, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 16.00 + } + ] + }, + { + "NUMBER": 4, + "EXPENSE": [ + { + "WHAT": "Food", + "AMOUNT": 17.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 15.00 + } + ] + }, + { + "NUMBER": 5, + "EXPENSE": [ + { + "WHAT": "Food", + "AMOUNT": 12.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 20.00 + } + ] + } + ] + }, + { + "WHO": "Janet", + "WEEK": [ + { + "NUMBER": 3, + "EXPENSE": [ + { + "WHAT": "Car", + "AMOUNT": 19.00 + }, + { + "WHAT": "Food", + "AMOUNT": 18.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 18.00 + } + ] + }, + { + "NUMBER": 4, + "EXPENSE": [ + { + "WHAT": "Car", + "AMOUNT": 17.00 + } + ] + }, + { + "NUMBER": 5, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 14.00 + }, + { + "WHAT": "Car", + "AMOUNT": 12.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 19.00 + }, + { + "WHAT": "Food", + "AMOUNT": 12.00 + } + ] + } + ] + } +] diff --git a/storage/connect/mysql-test/connect/std_data/mulexp3.jsn b/storage/connect/mysql-test/connect/std_data/mulexp3.jsn new file mode 100644 index 00000000000..c228448b073 --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/mulexp3.jsn @@ -0,0 +1,52 @@ +[ + { + "WHO": "Joe", + "WEEK": 3, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 18.00 + }, + { + "WHAT": "Food", + "AMOUNT": 12.00 + }, + { + "WHAT": "Food", + "AMOUNT": 19.00 + }, + { + "WHAT": "Car", + "AMOUNT": 20.00 + } + ] + }, + { + "WHO": "Beth", + "WEEK": 3, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 16.00 + } + ] + }, + { + "WHO": "Janet", + "WEEK": 3, + "EXPENSE": [ + { + "WHAT": "Car", + "AMOUNT": 19.00 + }, + { + "WHAT": "Food", + "AMOUNT": 18.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 18.00 + } + ] + } +] diff --git a/storage/connect/mysql-test/connect/std_data/mulexp4.jsn b/storage/connect/mysql-test/connect/std_data/mulexp4.jsn new file mode 100644 index 00000000000..0e43ffec07b --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/mulexp4.jsn @@ -0,0 +1,52 @@ +[ + { + "WHO": "Joe", + "WEEK": 4, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 19.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 16.00 + }, + { + "WHAT": "Food", + "AMOUNT": 17.00 + }, + { + "WHAT": "Food", + "AMOUNT": 17.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 14.00 + } + ] + }, + { + "WHO": "Beth", + "WEEK": 4, + "EXPENSE": [ + { + "WHAT": "Food", + "AMOUNT": 17.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 15.00 + } + ] + }, + { + "WHO": "Janet", + "WEEK": 4, + "EXPENSE": [ + { + "WHAT": "Car", + "AMOUNT": 17.00 + } + ] + } +] diff --git a/storage/connect/mysql-test/connect/std_data/mulexp5.jsn b/storage/connect/mysql-test/connect/std_data/mulexp5.jsn new file mode 100644 index 00000000000..7a707506c2f --- /dev/null +++ b/storage/connect/mysql-test/connect/std_data/mulexp5.jsn @@ -0,0 +1,52 @@ +[ + { + "WHO": "Joe", + "WEEK": 5, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 14.00 + }, + { + "WHAT": "Food", + "AMOUNT": 12.00 + } + ] + }, + { + "WHO": "Beth", + "WEEK": 5, + "EXPENSE": [ + { + "WHAT": "Food", + "AMOUNT": 12.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 20.00 + } + ] + }, + { + "WHO": "Janet", + "WEEK": 5, + "EXPENSE": [ + { + "WHAT": "Beer", + "AMOUNT": 14.00 + }, + { + "WHAT": "Car", + "AMOUNT": 12.00 + }, + { + "WHAT": "Beer", + "AMOUNT": 19.00 + }, + { + "WHAT": "Food", + "AMOUNT": 12.00 + } + ] + } +] diff --git a/storage/connect/mysql-test/connect/t/json.test b/storage/connect/mysql-test/connect/t/json.test new file mode 100644 index 00000000000..08297e5c556 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/json.test @@ -0,0 +1,247 @@ +--source include/not_embedded.inc +--source include/have_partition.inc + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file $MTR_SUITE_DIR/std_data/biblio.jsn $MYSQLD_DATADIR/test/biblio.jsn +--copy_file $MTR_SUITE_DIR/std_data/expense.jsn $MYSQLD_DATADIR/test/expense.jsn +--copy_file $MTR_SUITE_DIR/std_data/mulexp3.jsn $MYSQLD_DATADIR/test/mulexp3.jsn +--copy_file $MTR_SUITE_DIR/std_data/mulexp4.jsn $MYSQLD_DATADIR/test/mulexp4.jsn +--copy_file $MTR_SUITE_DIR/std_data/mulexp5.jsn $MYSQLD_DATADIR/test/mulexp5.jsn + +--echo # +--echo # Testing doc samples +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + LANG CHAR(2), + SUBJECT CHAR(32), + AUTHOR CHAR(64), + TITLE CHAR(32), + TRANSLATION CHAR(32), + TRANSLATOR CHAR(80), + PUBLISHER CHAR(32), + DATEPUB int(4) +) ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +DROP TABLE t1; + + +--echo # +--echo # Testing Jpath. Get the number of authors +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + Language CHAR(2) FIELD_FORMAT='LANG', + Subject CHAR(32) FIELD_FORMAT='SUBJECT', + Authors INT(2) FIELD_FORMAT='AUTHOR:[#]', + Title CHAR(32) FIELD_FORMAT='TITLE', + Translation CHAR(32) FIELD_FORMAT='TRANSLATION', + Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', + Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', + Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', + Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Concatenates the authors +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + Language CHAR(2) FIELD_FORMAT='LANG', + Subject CHAR(32) FIELD_FORMAT='SUBJECT', + AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:FIRSTNAME', + AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[" and "]:LASTNAME', + Title CHAR(32) FIELD_FORMAT='TITLE', + Translation CHAR(32) FIELD_FORMAT='TRANSLATION', + Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', + Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', + Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', + Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Testing expanding authors +--echo # +CREATE TABLE t1 +( + ISBN CHAR(15), + Language CHAR(2) FIELD_FORMAT='LANG', + Subject CHAR(32) FIELD_FORMAT='SUBJECT', + AuthorFN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:FIRSTNAME', + AuthorLN CHAR(128) FIELD_FORMAT='AUTHOR:[X]:LASTNAME', + Title CHAR(32) FIELD_FORMAT='TITLE', + Translation CHAR(32) FIELD_FORMAT='TRANSLATION', + Translator CHAR(80) FIELD_FORMAT='TRANSLATOR', + Publisher CHAR(20) FIELD_FORMAT='PUBLISHER:NAME', + Location CHAR(16) FIELD_FORMAT='PUBLISHER:PLACE', + Year int(4) FIELD_FORMAT='DATEPUB' +) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab'; +SELECT * FROM t1 WHERE ISBN = '9782212090819'; + +--echo # +--echo # To add an author a new table must be created +--echo # +CREATE TABLE t2 ( +FIRSTNAME CHAR(32), +LASTNAME CHAR(32)) +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.jsn' OPTION_LIST='Object=[2]:AUTHOR'; +SELECT * FROM t2; +INSERT INTO t2 VALUES('Charles','Dickens'); +SELECT * FROM t1; +DROP TABLE t1; +DROP TABLE t2; + +--echo # +--echo # Check the biblio file has the good format +--echo # +CREATE TABLE t1 +( + line char(255) +) +ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='biblio.jsn'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # A file with 2 arrays +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK::EXPENSE:["+"]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK::EXPENSE:[+]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Cannot be fully expanded +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[X]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[X]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +--error ER_GET_ERRMSG +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Expand expense in 3 one week tables +--echo # +CREATE TABLE t2 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[1]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[1]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t2; + +CREATE TABLE t3 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[2]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[2]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t3; + +CREATE TABLE t4 ( +WHO CHAR(12), +WEEK INT(2) FIELD_FORMAT='WEEK:[3]:NUMBER', +WHAT CHAR(32) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='WEEK:[3]:EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.jsn'; +SELECT * FROM t4; + +--echo # +--echo # The expanded table is made as a TBL table +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32), +AMOUNT DOUBLE(8,2)) +ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t2,t3,t4'; +SELECT * FROM t1; +DROP TABLE t1, t2, t3, t4; + +--echo # +--echo # Three partial JSON tables +--echo # +CREATE TABLE t2 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.jsn'; +SELECT * FROM t2; + +CREATE TABLE t3 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.jsn'; +SELECT * FROM t3; + +CREATE TABLE t4 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.jsn'; +SELECT * FROM t4; + +--echo # +--echo # The complete table can be a multiple JSON table +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.jsn' MULTIPLE=1; +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # Or also a partition JSON table +--echo # +CREATE TABLE t1 ( +WHO CHAR(12), +WEEK INT(2), +WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', +AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') +ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.jsn'; +ALTER TABLE t1 +PARTITION BY LIST COLUMNS(WEEK) ( +PARTITION `3` VALUES IN(3), +PARTITION `4` VALUES IN(4), +PARTITION `5` VALUES IN(5)); +SHOW WARNINGS; +SELECT * FROM t1; +SELECT * FROM t1 WHERE WEEK = 4; +DROP TABLE t1, t2, t3, t4; + +# +# Clean up +# +--remove_file $MYSQLD_DATADIR/test/biblio.jsn +--remove_file $MYSQLD_DATADIR/test/expense.jsn +--remove_file $MYSQLD_DATADIR/test/mulexp3.jsn +--remove_file $MYSQLD_DATADIR/test/mulexp4.jsn +--remove_file $MYSQLD_DATADIR/test/mulexp5.jsn diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index 24090e98804..e61a49ba9f9 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -74,11 +74,10 @@ enum TABTYPE {TAB_UNDEF = 0, /* Table of undefined type */ TAB_PLG = 20, /* PLG NIY */ TAB_PIVOT = 21, /* PIVOT table */ TAB_VIR = 22, /* Virtual tables */ -// TAB_JSON = 23, /* JSON tables */ -// TAB_JSN = 24, /* Semi-json tables */ - TAB_JCT = 25, /* Junction tables NIY */ - TAB_DMY = 26, /* DMY Dummy tables NIY */ - TAB_NIY = 27}; /* Table not implemented yet */ + TAB_JSON = 23, /* JSON tables */ + TAB_JCT = 24, /* Junction tables NIY */ + TAB_DMY = 25, /* DMY Dummy tables NIY */ + TAB_NIY = 26}; /* Table not implemented yet */ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */ TYPE_AM_ROWID = 1, /* ROWID type (special column) */ @@ -123,6 +122,8 @@ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */ TYPE_AM_BLK = 131, /* BLK access method type no */ TYPE_AM_ZIP = 132, /* ZIP access method type no */ TYPE_AM_ZLIB = 133, /* ZLIB access method type no */ + TYPE_AM_JSON = 134, /* JSON access method type no */ + TYPE_AM_JSN = 135, /* JSN access method type no */ TYPE_AM_MAC = 137, /* MAC table access method type */ TYPE_AM_WMI = 139, /* WMI table access method type */ TYPE_AM_XCL = 140, /* SYS column access method type */ diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index 0ef9625ac9b..ba22da52998 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -2211,7 +2211,8 @@ int TDBDOS::WriteDB(PGLOBAL g) htrc("DOS WriteDB: R%d Mode=%d \n", Tdb_No, Mode); // Make the line to write - (void)PrepareWriting(g); + if (PrepareWriting(g)) + return true; if (trace > 1) htrc("Write: line is='%s'\n", To_Line); diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp new file mode 100644 index 00000000000..69b05ee067d --- /dev/null +++ b/storage/connect/tabjson.cpp @@ -0,0 +1,1327 @@ +/************* tabjson C++ Program Source Code File (.CPP) *************/ +/* PROGRAM NAME: tabxjson Version 1.0 */ +/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */ +/* This program are the JSON class DB execution routines. */ +/***********************************************************************/ + +/***********************************************************************/ +/* Include relevant sections of the MariaDB header file. */ +/***********************************************************************/ +#include + +/***********************************************************************/ +/* Include application header files: */ +/* global.h is header containing all global declarations. */ +/* plgdbsem.h is header containing the DB application declarations. */ +/* tdbdos.h is header containing the TDBDOS declarations. */ +/* json.h is header containing the JSON classes declarations. */ +/***********************************************************************/ +#include "global.h" +#include "plgdbsem.h" +//#include "xtable.h" +//#include "mycat.h" // for FNC_COL +#include "maputil.h" +#include "filamtxt.h" +#include "tabdos.h" +//#include "resource.h" // for IDS_COLUMNS +#include "tabjson.h" +#include "filamap.h" +#if defined(ZIP_SUPPORT) +#include "filamzip.h" +#endif // ZIP_SUPPORT +#include "tabmul.h" +#include "checklvl.h" + +/***********************************************************************/ +/* External function. */ +/***********************************************************************/ +USETEMP UseTemp(void); + +/* -------------------------- Class JSONDEF -------------------------- */ + +JSONDEF::JSONDEF(void) +{ + Jmode = MODE_OBJECT; + Objname = NULL; + Xcol = NULL; + Limit = 1; + ReadMode = 0; +} // end of JSONDEF constructor + +/***********************************************************************/ +/* DefineAM: define specific AM block values. */ +/***********************************************************************/ +bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) +{ + Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT); + Objname = GetStringCatInfo(g, "Object", NULL); + Xcol = GetStringCatInfo(g, "Expand", NULL); + Pretty = GetIntCatInfo("Pretty", 2); + Limit = GetIntCatInfo("Limit", 10); + return DOSDEF::DefineAM(g, "DOS", poff); +} // end of DefineAM + +/***********************************************************************/ +/* GetTable: makes a new Table Description Block. */ +/***********************************************************************/ +PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) +{ + PTDBASE tdbp; + PTXF txfp = NULL; + + // JSN not used for pretty=1 for insert or delete + if (!Pretty || (Pretty == 1 && (m == MODE_READ || m == MODE_UPDATE))) { + USETEMP tmp = UseTemp(); + bool map = Mapped && m != MODE_INSERT && + !(tmp != TMP_NO && m == MODE_UPDATE) && + !(tmp == TMP_FORCE && + (m == MODE_UPDATE || m == MODE_DELETE)); + + if (Compressed) { +#if defined(ZIP_SUPPORT) + if (Compressed == 1) + txfp = new(g) ZIPFAM(this); + else + txfp = new(g) ZLBFAM(this); +#else // !ZIP_SUPPORT + sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "ZIP"); + return NULL; +#endif // !ZIP_SUPPORT + } else if (map) + txfp = new(g) MAPFAM(this); + else + txfp = new(g) DOSFAM(this); + + // Txfp must be set for TDBDOS + tdbp = new(g) TDBJSN(this, txfp); + } else { + txfp = new(g) DOSFAM(this); + tdbp = new(g) TDBJSON(this, txfp); + } // endif Pretty + + if (Multiple) + tdbp = new(g) TDBMUL(tdbp); + + return tdbp; +} // end of GetTable + +/* --------------------------- Class TDBJSN -------------------------- */ + +/***********************************************************************/ +/* Implementation of the TDBJSN class. */ +/***********************************************************************/ +TDBJSN::TDBJSN(PJDEF tdp, PTXF txfp) : TDBDOS(tdp, txfp) + { + Row = NULL; + Colp = NULL; + Jmode = tdp->Jmode; + Xcol = tdp->Xcol; + Fpos = -1; + Spos = N = 0; + Limit = tdp->Limit; + Pretty = tdp->Pretty; + Strict = tdp->Strict; + NextSame = false; + Comma = false; + SameRow = 0; + Xval = -1; + } // end of TDBJSN standard constructor + +TDBJSN::TDBJSN(TDBJSN *tdbp) : TDBDOS(NULL, tdbp) + { + Row = tdbp->Row; + Colp = tdbp->Colp; + Jmode = tdbp->Jmode; + Xcol = tdbp->Xcol; + Fpos = tdbp->Fpos; + Spos = tdbp->Spos; + N = tdbp->N; + Limit = tdbp->Limit; + Pretty = tdbp->Pretty; + Strict = tdbp->Strict; + NextSame = tdbp->NextSame; + Comma = tdbp->Comma; + SameRow = tdbp->SameRow; + Xval = tdbp->Xval; + } // end of TDBJSN copy constructor + +// Used for update +PTDB TDBJSN::CopyOne(PTABS t) + { + PTDB tp; + PJCOL cp1, cp2; + PGLOBAL g = t->G; + + tp = new(g) TDBJSN(this); + + for (cp1 = (PJCOL)Columns; cp1; cp1 = (PJCOL)cp1->GetNext()) { + cp2 = new(g) JSONCOL(cp1, tp); // Make a copy + NewPointer(t, cp1, cp2); + } // endfor cp1 + + return tp; + } // end of CopyOne + +/***********************************************************************/ +/* Allocate JSN column description block. */ +/***********************************************************************/ +PCOL TDBJSN::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) + { + PJCOL colp = new(g) JSONCOL(g, cdp, this, cprec, n); + + return (colp->ParseJpath(g)) ? NULL : colp; + } // end of MakeCol + +/***********************************************************************/ +/* InsertSpecialColumn: Put a special column ahead of the column list.*/ +/***********************************************************************/ +PCOL TDBJSN::InsertSpecialColumn(PGLOBAL g, PCOL colp) + { + if (!colp->IsSpecial()) + return NULL; + +//if (Xcol && ((SPCBLK*)colp)->GetRnm()) +// colp->SetKey(0); // Rownum is no more a key + + colp->SetNext(Columns); + Columns = colp; + return colp; + } // end of InsertSpecialColumn + +/***********************************************************************/ +/* JSON Cardinality: returns table size in number of rows. */ +/***********************************************************************/ +int TDBJSN::Cardinality(PGLOBAL g) + { + if (!g) + return 0; + else if (Cardinal < 0) + Cardinal = TDBDOS::Cardinality(g); + + return Cardinal; + } // end of Cardinality + +/***********************************************************************/ +/* JSON GetMaxSize: returns file size estimate in number of lines. */ +/***********************************************************************/ +int TDBJSN::GetMaxSize(PGLOBAL g) + { + if (MaxSize < 0) + MaxSize = TDBDOS::GetMaxSize(g) * ((Xcol) ? Limit : 1); + + return MaxSize; + } // end of GetMaxSize + +/***********************************************************************/ +/* OpenDB: Data Base open routine for JSN access method. */ +/***********************************************************************/ +bool TDBJSN::OpenDB(PGLOBAL g) + { + if (Use == USE_OPEN) { + /*******************************************************************/ + /* Table already open replace it at its beginning. */ + /*******************************************************************/ + for (PJCOL cp = (PJCOL)Columns; cp; cp = (PJCOL)cp->GetNext()) { + cp->Nx = 0; + cp->Arp = NULL; + } // endfor cp + + Fpos= -1; + Spos = 0; + NextSame = false; + SameRow = 0; + } else { + /*******************************************************************/ + /* First opening. */ + /*******************************************************************/ + if (Mode == MODE_INSERT) + switch (Jmode) { + case MODE_OBJECT: Row = new(g) JOBJECT; break; + case MODE_ARRAY: Row = new(g) JARRAY; break; + case MODE_VALUE: Row = new(g) JVALUE; break; + default: + sprintf(g->Message, "Invalid Jmode %d", Jmode); + return true; + } // endswitch Jmode + + } // endif Use + + return TDBDOS::OpenDB(g); + } // end of OpenDB + +/***********************************************************************/ +/* SkipHeader: Physically skip first header line if applicable. */ +/* This is called from TDBDOS::OpenDB and must be executed before */ +/* Kindex construction if the file is accessed using an index. */ +/***********************************************************************/ +bool TDBJSN::SkipHeader(PGLOBAL g) + { + int len = GetFileLength(g); + bool rc = false; + +#if defined(_DEBUG) + if (len < 0) + return true; +#endif // _DEBUG + +#if defined(WIN32) +#define Ending 2 +#else // !WIN32 +#define Ending 1 +#endif // !WIN32 + + if (Pretty == 1) { + if (Mode == MODE_INSERT || Mode == MODE_DELETE) { + // Mode Insert and delete are no more handled here + assert(false); + } else if (len) // !Insert && !Delete + rc = (Txfp->SkipRecord(g, false) == RC_FX || Txfp->RecordPos(g)); + + } // endif Pretty + + return rc; + } // end of SkipHeader + +/***********************************************************************/ +/* ReadDB: Data Base read routine for JSN access method. */ +/***********************************************************************/ +int TDBJSN::ReadDB(PGLOBAL g) + { + int rc; + + N++; + + if (NextSame) { + SameRow++; + return RC_OK; + } else if ((rc = TDBDOS::ReadDB(g)) == RC_OK) + if (!IsRead() && ((rc = ReadBuffer(g)) != RC_OK)) { + // Deferred reading failed + } else if (!(Row = ParseJson(g, To_Line, + strlen(To_Line), Pretty, &Comma))) { + rc = (Pretty == 1 && !strcmp(To_Line, "]")) ? RC_EF : RC_FX; + } else { + SameRow = 0; + Fpos++; + rc = RC_OK; + } // endif's + + return rc; + } // end of ReadDB + +/***********************************************************************/ +/* PrepareWriting: Prepare the line for WriteDB. */ +/***********************************************************************/ + bool TDBJSN::PrepareWriting(PGLOBAL g) + { + PSZ s = Serialize(g, Row, NULL, Pretty); + + if (s) { + if (Comma) + strcat(s, ","); + + if ((signed)strlen(s) > Lrecl) { + sprintf(g->Message, "Line would be truncated (lrecl=%d)", Lrecl); + return true; + } else + strcpy(To_Line, s); + + Row->Clear(); + return false; + } else + return true; + + } // end of PrepareWriting + +/* ----------------------------- JSNCOL ------------------------------- */ + +/***********************************************************************/ +/* JSNCOL public constructor. */ +/***********************************************************************/ +JSONCOL::JSONCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i) + : DOSCOL(g, cdp, tdbp, cprec, i, "DOS") + { + Tjp = (TDBJSN *)(tdbp->GetOrig() ? tdbp->GetOrig() : tdbp); + Arp = NULL; + Jpath = cdp->GetFmt(); + MulVal = NULL; + Nodes = NULL; + Nod = Nx =0; + Ival = -1; + Xpd = false; + Parsed = false; + } // end of JSONCOL constructor + +/***********************************************************************/ +/* JSONCOL constructor used for copying columns. */ +/* tdbp is the pointer to the new table descriptor. */ +/***********************************************************************/ +JSONCOL::JSONCOL(JSONCOL *col1, PTDB tdbp) : DOSCOL(col1, tdbp) + { + Tjp = col1->Tjp; + Arp = col1->Arp; + Jpath = col1->Jpath; + MulVal = col1->MulVal; + Nodes = col1->Nodes; + Nod = col1->Nod; + Ival = col1->Ival; + Nx = col1->Nx; + Xpd = col1->Xpd; + Parsed = col1->Parsed; + } // end of JSONCOL copy constructor + +/***********************************************************************/ +/* SetBuffer: prepare a column block for write operation. */ +/***********************************************************************/ +bool JSONCOL::SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check) + { + if (DOSCOL::SetBuffer(g, value, ok, check)) + return true; + + // Parse the json path + if (ParseJpath(g)) + return true; + + Tjp = (TDBJSN*)To_Tdb; + return false; + } // end of SetBuffer + +/***********************************************************************/ +/* Analyse array processing options. */ +/***********************************************************************/ +bool JSONCOL::CheckExpand(PGLOBAL g, int i, PSZ nm, bool b) + { + if (Tjp->Xcol && nm && !strcmp(nm, Tjp->Xcol) && + (Tjp->Xval < 0 || Tjp->Xval == i)) { + Xpd = true; // Expandable object + Nodes[i].Op = OP_XX; + Tjp->Xval = i; + } else if (b) { + strcpy(g->Message, "Cannot expand more than one array"); + return true; + } // endif Xcol + + return false; + } // end of CheckExpand + +/***********************************************************************/ +/* Analyse array processing options. */ +/***********************************************************************/ +bool JSONCOL::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) + { + int n = (int)strlen(p); + bool dg = true; + PJNODE jnp = &Nodes[i]; + + if (*p) { + if (p[--n] == ']') { + p[n--] = 0; + p++; + } else { + // Wrong array specification + sprintf(g->Message, + "Invalid array specification %s for %s", p, Name); + return true; + } // endif p + + } // endif *p + + // To check whether a numeric Rank was specified + for (int k = 0; dg && p[k]; k++) + dg = isdigit(p[k]) > 0; + + if (!n) { + // Default specifications + if (CheckExpand(g, i, nm, false)) + return true; + else if (jnp->Op != OP_XX) + if (!Value->IsTypeNum()) { + jnp->CncVal = AllocateValue(g, ", ", TYPE_STRING); + jnp->Op = OP_CNC; + } else + jnp->Op = OP_ADD; + + } else if (dg) { + if (atoi(p) > 0) { + // Return nth value + jnp->Rank = atoi(p); + jnp->Op = OP_EQ; + } else // Ignore array + jnp->Op = OP_NULL; + + } else if (n == 1) { + // Set the Op value; + switch (*p) { + case '+': jnp->Op = OP_ADD; break; + case '*': jnp->Op = OP_MULT; break; + case '>': jnp->Op = OP_MAX; break; + case '<': jnp->Op = OP_MIN; break; + case '#': jnp->Op = OP_NUM; break; + case '!': jnp->Op = OP_SEP; break; // Average + case 'x': + case 'X': // Expand this array + if (!Tjp->Xcol && nm) { + Xpd = true; + jnp->Op = OP_XX; + Tjp->Xval = i; + Tjp->Xcol = nm; + } else if (CheckExpand(g, i, nm, true)) + return true; + + break; + default: + sprintf(g->Message, + "Invalid function specification %c for %s", *p, Name); + return true; + } // endswitch *p + + } else if (*p == '"' && p[n - 1] == '"') { + // This is a concat specification + jnp->Op = OP_CNC; + + if (n > 2) { + // Set concat intermediate string + p[n - 1] = 0; + jnp->CncVal = AllocateValue(g, p + 1, TYPE_STRING); + } // endif n + + } else { + sprintf(g->Message, "Wrong array specification for %s", Name); + return true; + } // endif's + + return false; + } // end of SetArrayOptions + +/***********************************************************************/ +/* Parse the eventual passed Jpath information. */ +/* This information can be specified in the Fieldfmt column option */ +/* when creating the table. It permits to indicate the position of */ +/* the node corresponding to that column. */ +/***********************************************************************/ +bool JSONCOL::ParseJpath(PGLOBAL g) + { + char *p, *p2 = NULL, *pbuf = NULL; + int i; + bool mul = false; + + if (Parsed) + return false; // Already done + else if (InitValue(g)) + return true; + else if (!Jpath) + Jpath = Name; + + pbuf = (char*)PlugSubAlloc(g, NULL, strlen(Jpath) + 1); + strcpy(pbuf, Jpath); + + // The Jpath must be analyzed + for (i = 0, p = pbuf; (p = strchr(p, ':')); i++, p++) + Nod++; // One path node found + + Nodes = (PJNODE)PlugSubAlloc(g, NULL, (++Nod) * sizeof(JNODE)); + memset(Nodes, 0, (Nod) * sizeof(JNODE)); + + // Analyze the Jpath for this column + for (i = 0, p = pbuf; i < Nod; i++, p = (p2 ? p2 + 1 : p + strlen(p))) { + if ((p2 = strchr(p, ':'))) + *p2 = 0; + + // Jpath must be explicit + if (*p == 0 || *p == '[') { + // Analyse intermediate array processing + if (SetArrayOptions(g, p, i, Nodes[i-1].Key)) + return true; + + } else { + Nodes[i].Key = p; + Nodes[i].Op = OP_EXIST; + } // endif's + + } // endfor i, p + + MulVal = AllocateValue(g, Value); + Parsed = true; + return false; + } // end of ParseJpath + +/***********************************************************************/ +/* SetValue: Set a value from a JVALUE contains. */ +/***********************************************************************/ +void JSONCOL::SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n) + { + if (val) { + if (Nodes[n].Op == OP_NUM) + vp->SetValue(1); + else { + again: + switch (val->GetValType()) { + case TYPE_STRING: + case TYPE_INT: + case TYPE_DOUBLE: + vp->SetValue_pval(val->GetValue()); + break; + case TYPE_TINY: + if (vp->IsTypeNum()) + vp->SetValue(val->GetInteger() ? 1 : 0); + else + vp->SetValue_psz(val->GetInteger() ? "true" : "false"); + + break; + case TYPE_JAR: + val = val->GetArray()->GetValue(0); + goto again; + case TYPE_JOB: + if (!vp->IsTypeNum()) { + vp->SetValue_psz(val->GetObject()->GetText(g)); + break; + } // endif Type + + default: + vp->Reset(); + } // endswitch Type + + } // endelse + + } else + vp->Reset(); + + } // end of SetJsonValue + +/***********************************************************************/ +/* GetRow: Get the object containing this column. */ +/***********************************************************************/ +PJSON JSONCOL::GetRow(PGLOBAL g, int mode) + { + PJVAL val; + PJAR arp; + PJSON nwr, row = Tjp->Row; + + for (int i = 0; i < Nod-1 && row; i++) { + switch (row->GetType()) { + case TYPE_JOB: + if (!Nodes[i].Key) + // Expected Array was not there + continue; + + val = ((PJOB)row)->GetValue(Nodes[i].Key); + break; + case TYPE_JAR: + if (!Nodes[i].Key) { + if (Nodes[i].Op != OP_NULL) { + Ival = i; + arp = (PJAR)row; + + if (mode < 2) // First pass + Arp = arp; + + if (Nodes[i].Op != OP_XX) { + if (Nodes[i].Rank) + val = arp->GetValue(Nodes[i].Rank - 1); + else + val = arp->GetValue(arp == Arp ? Nx : 0); + + } else + val = arp->GetValue(Tjp->SameRow); + + } else + val = NULL; + + } else { + strcpy(g->Message, "Unexpected array"); + val = NULL; // Not an expected array + } // endif Nodes + + break; + case TYPE_JVAL: + val = (PJVAL)row; + break; + default: + sprintf(g->Message, "Invalid row JSON type %d", row->GetType()); + val = NULL; + } // endswitch Type + + if (val) { + row = val->GetJson(); + } else if (mode == 1) { // mode write + // Construct missing objects + for (i++; row && i < Nod; i++) { + if (!Nodes[i].Key) { + // Construct intermediate array + nwr = new(g) JARRAY; + } else { + nwr = new(g) JOBJECT; + } // endif Nodes + + if (row->GetType() == TYPE_JOB) { + ((PJOB)row)->SetValue(g, new(g) JVALUE(nwr), Nodes[i-1].Key); + } else if (row->GetType() == TYPE_JAR) { + ((PJAR)row)->AddValue(g, new(g) JVALUE(nwr)); + ((PJAR)row)->InitArray(g); + } else { + strcpy(g->Message, "Wrong type when writing new row"); + nwr = NULL; + } // endif's + + row = nwr; + } // endfor i + + break; + } else + row = NULL; + + } // endfor i + + return row; + } // end of GetRow + +/***********************************************************************/ +/* ReadColumn: */ +/***********************************************************************/ +void JSONCOL::ReadColumn(PGLOBAL g) + { + int mode = 0, n = Nod - 1; + PJSON row; + PJVAL val = NULL; + + evenmore: + row = GetRow(g, mode); + + more: + if (row) switch (row->GetType()) { + case TYPE_JOB: + if (Nodes[n].Key) + val = row->GetValue(Nodes[n].Key); + else + val = new(g) JVALUE(row); + + break; + case TYPE_JAR: + // Multiple column ? + if (Nodes[n].Op != OP_NULL) { + Arp = (PJAR)row; + val = Arp->GetValue(Nodes[n].Rank > 0 ? + Nodes[n].Rank - 1 : + Nodes[n].Op == OP_XX ? Tjp->SameRow : Nx); + Ival = n; + } else + val = NULL; + + break; + case TYPE_JVAL: + val = (PJVAL)row; + break; + default: + sprintf(g->Message, "Wrong return value type %d", row->GetType()); + Value->Reset(); + return; + } // endswitch Type + + if (!Nx /*|| (Xpd)*/) + SetJsonValue(g, Value, val, n); + + if (Arp) { + // Multiple column + int ars = (Nodes[Ival].Rank > 0) ? 1 : MY_MIN(Tjp->Limit, Arp->size()); + + if (Nodes[Ival].Op == OP_XX) { + if (ars > Tjp->SameRow + 1) + Tjp->NextSame = true; // More to come + else { + Tjp->NextSame = false; + Arp = NULL; + } // endelse + + } else { + if (Nx && val) { + SetJsonValue(g, MulVal, val, Ival); + + if (!MulVal->IsZero()) { + PVAL val[2]; + bool err; + + switch (Nodes[Ival].Op) { + case OP_CNC: + if (Nodes[Ival].CncVal) { + val[0] = Nodes[Ival].CncVal; + err = Value->Compute(g, val, 1, Nodes[Ival].Op); + } // endif CncVal + + val[0] = MulVal; + err = Value->Compute(g, val, 1, Nodes[Ival].Op); + break; + case OP_NUM: + case OP_SEP: + val[0] = Value; + val[1] = MulVal; + err = Value->Compute(g, val, 2, OP_ADD); + break; + default: + val[0] = Value; + val[1] = MulVal; + err = Value->Compute(g, val, 2, Nodes[Ival].Op); + } // endswitch Op + + if (err) + Value->Reset(); + + } // endif Zero + + } // endif Nx + + if (ars > ++Nx) { + if (Ival != n) { + mode = 2; + goto evenmore; + } else + goto more; + + } else { + if (Nodes[Ival].Op == OP_SEP) { + // Calculate average + PVAL val[2]; + + MulVal->SetValue(ars); + val[0] = Value; + val[1] = MulVal; + + if (Value->Compute(g, val, 2, OP_DIV)) + Value->Reset(); + + } // endif Op + + Arp = NULL; + Nx = 0; + } // endif ars + + } // endif Op + + } // endif Arp + + } // end of ReadColumn + +/***********************************************************************/ +/* WriteColumn: */ +/***********************************************************************/ +void JSONCOL::WriteColumn(PGLOBAL g) + { + /*********************************************************************/ + /* Check whether this node must be written. */ + /*********************************************************************/ + if (Value != To_Val) + Value->SetValue_pval(To_Val, FALSE); // Convert the updated value + + /*********************************************************************/ + /* On INSERT Null values are represented by no node. */ + /*********************************************************************/ + if (Value->IsNull() && Tjp->Mode == MODE_INSERT) + return; + + PJOB objp = NULL; + PJAR arp = NULL; + PJVAL jvp = NULL; + PJSON row = GetRow(g, 1); + JTYP type = row->GetType(); + + switch (row->GetType()) { + case TYPE_JOB: objp = (PJOB)row; break; + case TYPE_JAR: arp = (PJAR)row; break; + case TYPE_JVAL: jvp = (PJVAL)row; break; + default: row = NULL; // ??????????????????????????? + } // endswitch Type + + if (row) switch (Buf_Type) { + case TYPE_STRING: + case TYPE_DATE: + case TYPE_INT: + case TYPE_DOUBLE: + if (arp) { + if (Nodes[Nod-1].Rank) + arp->SetValue(g, new(g) JVALUE(g, Value), Nodes[Nod-1].Rank-1); + else + arp->AddValue(g, new(g) JVALUE(g, Value)); + + arp->InitArray(g); + } else if (objp) { + if (Nodes[Nod-1].Key) + objp->SetValue(g, new(g) JVALUE(g, Value), Nodes[Nod-1].Key); + + } else if (jvp) + jvp->SetValue(Value); + + break; + default: // ?????????? + sprintf(g->Message, "Invalid column type %d", Buf_Type); + } // endswitch Type + + } // end of WriteColumn + +/* -------------------------- Class TDBJSON -------------------------- */ + +/***********************************************************************/ +/* Implementation of the TDBJSON class. */ +/***********************************************************************/ +TDBJSON::TDBJSON(PJDEF tdp, PTXF txfp) : TDBJSN(tdp, txfp) + { + Top = NULL; + Doc = NULL; + Objname = tdp->Objname; + Multiple = tdp->Multiple; + Done = Changed = false; + } // end of TDBJSON standard constructor + +TDBJSON::TDBJSON(PJTDB tdbp) : TDBJSN(tdbp) + { + Top = tdbp->Top; + Doc = tdbp->Doc; + Objname = tdbp->Objname; + Multiple = tdbp->Multiple; + Done = tdbp->Done; + Changed = tdbp->Changed; + } // end of TDBJSON copy constructor + +// Used for update +PTDB TDBJSON::CopyOne(PTABS t) + { + PTDB tp; + PJCOL cp1, cp2; + PGLOBAL g = t->G; + + tp = new(g) TDBJSON(this); + + for (cp1 = (PJCOL)Columns; cp1; cp1 = (PJCOL)cp1->GetNext()) { + cp2 = new(g) JSONCOL(cp1, tp); // Make a copy + NewPointer(t, cp1, cp2); + } // endfor cp1 + + return tp; + } // end of CopyOne + +/***********************************************************************/ +/* Make the document tree from a file. */ +/***********************************************************************/ +int TDBJSON::MakeNewDoc(PGLOBAL g) + { + // Create a void table that will be populated + Doc = new(g) JARRAY; + + if (Objname) { + // Parse and allocate Objname item(s) + char *p; + char *objpath = (char*)PlugSubAlloc(g, NULL, strlen(Objname)+1); + int i; + PJOB objp; + PJAR arp; + PJVAL val = NULL; + + strcpy(objpath, Objname); + Top = NULL; + + for (; objpath; objpath = p) { + if ((p = strchr(objpath, ':'))) + *p++ = 0; + + if (*objpath != '[') { + objp = new(g) JOBJECT; + + if (!Top) + Top = objp; + + if (val) + val->SetValue(objp); + + val = new(g) JVALUE; + objp->SetValue(g, val, objpath); + } else if (objpath[strlen(objpath)-1] == ']') { + arp = new(g) JARRAY; + + if (!Top) + Top = arp; + + if (val) + val->SetValue(arp); + + val = new(g) JVALUE; + i = atoi(objpath+1) - 1; + arp->SetValue(g, val, i); + arp->InitArray(g); + } else { + sprintf(g->Message, "Invalid Table path %s", Objname); + return RC_FX; + } // endif objpath + + } // endfor p + + val->SetValue(Doc); + } else + Top = Doc; + + return RC_OK; + } // end of MakeNewDoc + +/***********************************************************************/ +/* Make the document tree from a file. */ +/***********************************************************************/ +int TDBJSON::MakeDocument(PGLOBAL g) + { + char *p, *memory, *objpath, *key, filename[_MAX_PATH]; + int i, len; + HANDLE hFile; + MEMMAP mm; + PJSON jsp; + PJOB objp = NULL; + PJAR arp = NULL; + PJVAL val = NULL; + + if (Done) + return RC_OK; + else + Done = true; + + // Now open the JSON file + PlugSetPath(filename, Txfp->To_File, GetPath()); + + /*********************************************************************/ + /* Create the mapping file object. */ + /*********************************************************************/ + hFile = CreateFileMap(g, filename, &mm, MODE_READ, false); + + if (hFile == INVALID_HANDLE_VALUE) { + DWORD drc = GetLastError(); + + if (drc != ERROR_FILE_NOT_FOUND || Mode != MODE_INSERT) { + sprintf(g->Message, MSG(OPEN_ERROR), drc, 10, filename); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, drc, 0, + (LPTSTR)filename, sizeof(filename), NULL); + strcat(g->Message, filename); + return RC_FX; + } else + return MakeNewDoc(g); + + } // endif hFile + + /*********************************************************************/ + /* Get the file size (assuming file is smaller than 4 GB) */ + /*********************************************************************/ + len = mm.lenL; + memory = (char *)mm.memory; + + if (!len) { // Empty file + CloseFileHandle(hFile); + UnmapViewOfFile(memory); + + if (Mode == MODE_INSERT) + return MakeNewDoc(g); + + } // endif len + + if (!memory) { + CloseFileHandle(hFile); + sprintf(g->Message, MSG(MAP_VIEW_ERROR), filename, GetLastError()); + return RC_FX; + } // endif Memory + + CloseFileHandle(hFile); // Not used anymore + hFile = INVALID_HANDLE_VALUE; // For Fblock + + /*********************************************************************/ + /* Parse the json file and allocate its tree structure. */ + /*********************************************************************/ + g->Message[0] = 0; + jsp = Top = ParseJson(g, memory, len, Pretty); + UnmapViewOfFile(memory); + + if (!jsp && g->Message[0]) + return RC_FX; + + if (Objname) { + objpath = (char*)PlugSubAlloc(g, NULL, strlen(Objname) + 1); + strcpy(objpath, Objname); + } else + objpath = NULL; + + /*********************************************************************/ + /* Find the table in the tree structure. */ + /*********************************************************************/ + for (; jsp && objpath; objpath = p) { + if ((p = strchr(objpath, ':'))) + *p++ = 0; + + if (*objpath != '[') { // objpass is a key + if (jsp->GetType() != TYPE_JOB) { + strcpy(g->Message, "Table path does no match json file"); + return RC_FX; + } // endif Type + + key = objpath; + objp = jsp->GetObject(); + arp = NULL; + val = objp->GetValue(key); + + if (!val || !(jsp = val->GetJson())) { + sprintf(g->Message, "Cannot find object key %s", key); + return RC_FX; + } // endif val + + } else if (objpath[strlen(objpath)-1] == ']') { + if (jsp->GetType() != TYPE_JAR) { + strcpy(g->Message, "Table path does no match json file"); + return RC_FX; + } // endif Type + + arp = jsp->GetArray(); + objp = NULL; + i = atoi(objpath+1) - 1; + val = arp->GetValue(i); + + if (!val) { + sprintf(g->Message, "Cannot find array value %d", i); + return RC_FX; + } // endif val + + } else { + sprintf(g->Message, "Invalid Table path %s", Objname); + return RC_FX; + } // endif objpath + + jsp = val->GetJson(); + } // endfor objpath + + if (jsp && jsp->GetType() == TYPE_JAR) + Doc = jsp->GetArray(); + else { + // The table is void or is just one object or one value + Doc = new(g) JARRAY; + + if (val) { + Doc->AddValue(g, val); + Doc->InitArray(g); + } else if (jsp) { + Doc->AddValue(g, new(g) JVALUE(jsp)); + Doc->InitArray(g); + } // endif val + + if (objp) + objp->SetValue(g, new(g) JVALUE(Doc), key); + else if (arp) + arp->SetValue(g, new(g) JVALUE(Doc), i); + else + Top = Doc; + + } // endif jsp + + return RC_OK; + } // end of MakeDocument + +/***********************************************************************/ +/* JSON Cardinality: returns table size in number of rows. */ +/***********************************************************************/ +int TDBJSON::Cardinality(PGLOBAL g) + { + if (!g) + return (Xcol || Multiple) ? 0 : 1; + else if (Cardinal < 0) + if (!Multiple) { + if (MakeDocument(g) == RC_OK) + Cardinal = Doc->size(); + + } else + return 10; + + return Cardinal; + } // end of Cardinality + +/***********************************************************************/ +/* JSON GetMaxSize: returns table size estimate in number of rows. */ +/***********************************************************************/ +int TDBJSON::GetMaxSize(PGLOBAL g) + { + if (MaxSize < 0) + MaxSize = Cardinality(g) * ((Xcol) ? Limit : 1); + + return MaxSize; + } // end of GetMaxSize + +/***********************************************************************/ +/* ResetSize: call by TDBMUL when calculating size estimate. */ +/***********************************************************************/ +void TDBJSON::ResetSize(void) + { + MaxSize = Cardinal = -1; + Fpos = -1; + N = 0; + Done = false; + } // end of ResetSize + +/***********************************************************************/ +/* TDBJSON is not indexable. */ +/***********************************************************************/ +int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) + { + if (pxdf) { + strcpy(g->Message, "JSON not indexable when pretty = 2"); + return RC_FX; + } else + return RC_OK; + + } // end of MakeIndex + +/***********************************************************************/ +/* JSON Access Method opening routine. */ +/***********************************************************************/ +bool TDBJSON::OpenDB(PGLOBAL g) + { + if (Use == USE_OPEN) { + /*******************************************************************/ + /* Table already open replace it at its beginning. */ + /*******************************************************************/ + for (PJCOL cp = (PJCOL)Columns; cp; cp = (PJCOL)cp->GetNext()) { + cp->Nx = 0; + cp->Arp = NULL; + } // endfor cp + + Fpos= -1; + Spos = 0; + NextSame = false; + SameRow = 0; + return false; + } // endif use + + /*********************************************************************/ + /* OpenDB: initialize the JSON file processing. */ + /*********************************************************************/ + if (MakeDocument(g) != RC_OK) + return true; + + if (Mode == MODE_INSERT) + switch (Jmode) { + case MODE_OBJECT: Row = new(g) JOBJECT; break; + case MODE_ARRAY: Row = new(g) JARRAY; break; + case MODE_VALUE: Row = new(g) JVALUE; break; + default: + sprintf(g->Message, "Invalid Jmode %d", Jmode); + return true; + } // endswitch Jmode + + Use = USE_OPEN; + return false; + } // end of OpenDB + +/***********************************************************************/ +/* ReadDB: Data Base read routine for JSON access method. */ +/***********************************************************************/ +int TDBJSON::ReadDB(PGLOBAL g) + { + int rc; + + N++; + + if (NextSame) { + SameRow++; + rc = RC_OK; + } else if (++Fpos < (signed)Doc->size()) { + Row = Doc->GetValue(Fpos); + + if (Row->GetType() == TYPE_JVAL) + Row = ((PJVAL)Row)->GetJson(); + + SameRow = 0; + rc = RC_OK; + } else + rc = RC_EF; + + return rc; + } // end of ReadDB + +/***********************************************************************/ +/* WriteDB: Data Base write routine for JSON access method. */ +/***********************************************************************/ +int TDBJSON::WriteDB(PGLOBAL g) + { + if (Jmode == MODE_OBJECT) { + PJVAL vp = new(g) JVALUE(Row); + + if (Mode == MODE_INSERT) { + Doc->AddValue(g, vp); + Row = new(g) JOBJECT; + } else if (Doc->SetValue(g, vp, Fpos)) + return RC_FX; + + } else if (Jmode == MODE_ARRAY) { + PJVAL vp = new(g) JVALUE(Row); + + if (Mode == MODE_INSERT) { + Doc->AddValue(g, vp); + Row = new(g) JARRAY; + } else if (Doc->SetValue(g, vp, Fpos)) + return RC_FX; + + } else { // if (Jmode == MODE_VALUE) + if (Mode == MODE_INSERT) + Doc->AddValue(g, (PJVAL)Row); + else if (Doc->SetValue(g, (PJVAL)Row, Fpos)) + return RC_FX; + + } // endif Jmode + + Changed = true; + return RC_OK; + } // end of WriteDB + +/***********************************************************************/ +/* Data Base delete line routine for JSON access method. */ +/***********************************************************************/ +int TDBJSON::DeleteDB(PGLOBAL g, int irc) + { + if (irc == RC_OK) { + // Deleted current row + if (Doc->DeleteValue(Fpos)) { + sprintf(g->Message, "Value %d does not exist", Fpos + 1); + return RC_FX; + } // endif Delete + + Changed = true; + } else if (irc == RC_FX) + // Delete all + for (int i = 0; i < Doc->size(); i++) { + Doc->DeleteValue(i); + Changed = true; + } // endfor i + + return RC_OK; + } // end of DeleteDB + +/***********************************************************************/ +/* Data Base close routine for JSON access methods. */ +/***********************************************************************/ +void TDBJSON::CloseDB(PGLOBAL g) + { + if (!Changed) + return; + + // Save the modified document + char filename[_MAX_PATH]; + PSZ msg; + FILE *fop; + + Doc->InitArray(g); + + // We used the file name relative to recorded datapath + PlugSetPath(filename, ((PJDEF)To_Def)->Fn, GetPath()); + + if (!(fop = fopen(filename, "wb"))) { + sprintf(g->Message, MSG(OPEN_MODE_ERROR), + "w", (int)errno, filename); + strcat(strcat(g->Message, ": "), strerror(errno)); + } else { + // Serialize the modified table + if ((msg = Serialize(g, Top, fop, Pretty))) + printf(msg); + + fclose(fop); + } // endif fop + + } // end of CloseDB + +/* -------------------------- End of json --------------------------- */ diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h new file mode 100644 index 00000000000..68f79a1526a --- /dev/null +++ b/storage/connect/tabjson.h @@ -0,0 +1,197 @@ +/*************** tabjson H Declares Source Code File (.H) **************/ +/* Name: tabjson.h Version 1.0 */ +/* */ +/* (C) Copyright to the author Olivier BERTRAND 2014 - 2015 */ +/* */ +/* This file contains the JSON classes declares. */ +/***********************************************************************/ +#include "osutil.h" +#include "block.h" +#include "colblk.h" +#include "json.h" + +enum JMODE {MODE_OBJECT, MODE_ARRAY, MODE_VALUE}; + +typedef class JSONDEF *PJDEF; +typedef class TDBJSON *PJTDB; +typedef class JSONCOL *PJCOL; + +class TDBJSN; + +/***********************************************************************/ +/* The JSON tree node. Can be an Object or an Array. */ +/***********************************************************************/ +typedef struct _jnode { + PSZ Key; // The key used for object + OPVAL Op; // Operator used for this node + PVAL CncVal; // To cont value used for OP_CNC + int Rank; // The rank in array +} JNODE, *PJNODE; + +/***********************************************************************/ +/* JSON table. */ +/***********************************************************************/ +class JSONDEF : public DOSDEF { /* Table description */ + friend class TDBJSON; + friend class TDBJSN; + public: + // Constructor + JSONDEF(void); + + // Implementation + virtual const char *GetType(void) {return "JSON";} + + // Methods + virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff); + virtual PTDB GetTable(PGLOBAL g, MODE m); + + protected: + // Members + JMODE Jmode; /* MODE_OBJECT by default */ + char *Objname; /* Name of first level object */ + char *Xcol; /* Name of expandable column */ + int Limit; /* Limit of multiple values */ + int Pretty; /* Depends on file structure */ + bool Strict; /* Strict syntax checking */ + }; // end of JSONDEF + +/* -------------------------- TDBJSN class --------------------------- */ + +/***********************************************************************/ +/* This is the JSN Access Method class declaration. */ +/* The table is a DOS file, each record being a JSON object. */ +/***********************************************************************/ +class TDBJSN : public TDBDOS { + friend class JSONCOL; + public: + // Constructor + TDBJSN(PJDEF tdp, PTXF txfp); + TDBJSN(TDBJSN *tdbp); + + // Implementation + virtual AMT GetAmType(void) {return TYPE_AM_JSN;} + virtual bool SkipHeader(PGLOBAL g); + virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSN(this);} + + // Methods + virtual PTDB CopyOne(PTABS t); + virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + virtual PCOL InsertSpecialColumn(PGLOBAL g, PCOL colp); + virtual int RowNumber(PGLOBAL g, BOOL b = FALSE) + {return (b) ? N : Fpos + 1;} + + // Database routines + virtual int Cardinality(PGLOBAL g); + virtual int GetMaxSize(PGLOBAL g); + virtual bool OpenDB(PGLOBAL g); + virtual bool PrepareWriting(PGLOBAL g); + virtual int ReadDB(PGLOBAL g); + + protected: + // Members + PJSON Row; // The current row + PJCOL Colp; // The multiple column + JMODE Jmode; // MODE_OBJECT by default + char *Xcol; // Name of expandable column + int Fpos; // The current row index + int Spos; // DELETE start index + int N; // The current Rownum + int Limit; // Limit of multiple values + int Pretty; // Depends on file structure + bool Strict; // Strict syntax checking + bool NextSame; // Same next row + bool Comma; // Row has final comma + int SameRow; // Same row nb + int Xval; // Index of expandable array + }; // end of class TDBJSN + +/* -------------------------- JSONCOL class -------------------------- */ + +/***********************************************************************/ +/* Class JSONCOL: JSON access method column descriptor. */ +/***********************************************************************/ +class JSONCOL : public DOSCOL { + friend class TDBJSN; + friend class TDBJSON; + public: + // Constructors + JSONCOL(PGLOBAL g, PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i); + JSONCOL(JSONCOL *colp, PTDB tdbp); // Constructor used in copy process + + // Implementation + virtual int GetAmType(void) {return Tjp->GetAmType();} + + // Methods + virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); + bool ParseJpath(PGLOBAL g); + virtual void ReadColumn(PGLOBAL g); + virtual void WriteColumn(PGLOBAL g); + + protected: + bool CheckExpand(PGLOBAL g, int i, PSZ nm, bool b); + bool SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm); + PJSON GetRow(PGLOBAL g, int mode); + void SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n); + + // Default constructor not to be used + JSONCOL(void) {} + + // Members + TDBJSN *Tjp; // To the JSN table block + PVAL MulVal; // To value used by multiple column + PJAR Arp; // The intermediate array + char *Jpath; // The json path + JNODE *Nodes ; // The intermediate objects + int Nod; // The number of intermediate objects + int Ival; // Index of multiple values + int Nx; // The last read sub-row + bool Xpd; // True for expandable column + bool Parsed; // True when parsed + }; // end of class JSONCOL + +/* -------------------------- TDBJSON class -------------------------- */ + +/***********************************************************************/ +/* This is the JSON Access Method class declaration. */ +/***********************************************************************/ +class TDBJSON : public TDBJSN { + friend class JSONCOL; + public: + // Constructor + TDBJSON(PJDEF tdp, PTXF txfp); + TDBJSON(PJTDB tdbp); + + // Implementation + virtual AMT GetAmType(void) {return TYPE_AM_JSON;} + virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBJSON(this);} + + // Methods + virtual PTDB CopyOne(PTABS t); + + // Database routines + virtual int Cardinality(PGLOBAL g); + virtual int GetMaxSize(PGLOBAL g); + virtual void ResetSize(void); + virtual int GetRecpos(void) {return Fpos;} + virtual bool OpenDB(PGLOBAL g); + virtual int ReadDB(PGLOBAL g); + virtual bool PrepareWriting(PGLOBAL g) {return false;} + virtual int WriteDB(PGLOBAL g); + virtual int DeleteDB(PGLOBAL g, int irc); + virtual void CloseDB(PGLOBAL g); + + // Optimization routines + virtual int MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add); + + protected: + int MakeNewDoc(PGLOBAL g); + int MakeDocument(PGLOBAL g); + + // Members + PJSON Top; // The file JSON tree + PJAR Doc; // The document array + char *Objname; // The table object name + int Multiple; // 0: No 1: DIR 2: Section 3: filelist + bool Done; // True when document parsing is done + bool Changed; // After Update, Insert or Delete + }; // end of class TDBJSON diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 3ed58d3e257..1176ada5173 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -67,6 +67,22 @@ #define FOURYEARS 126230400 // Four years in seconds (1 leap) +#define MAXUINT8 ((UINT8)~((UINT8)0)) +#define MAXINT8 ((INT8)(MAXUINT8 >> 1)) +#define MININT8 ((INT8)~MAXINT8) + +#define MAXUINT16 ((UINT16)~((UINT16)0)) +#define MAXINT16 ((INT16)(MAXUINT16 >> 1)) +#define MININT16 ((INT16)~MAXINT16) + +#define MAXUINT32 ((UINT32)~((UINT32)0)) +#define MAXINT32 ((INT32)(MAXUINT32 >> 1)) +#define MININT32 ((INT32)~MAXINT32) + +#define MAXUINT64 ((UINT64)~((UINT64)0)) +#define MAXINT64 ((INT64)(MAXUINT64 >> 1)) +#define MININT64 ((INT64)~MAXINT64) + /***********************************************************************/ /* Initialize the DTVAL static member. */ /***********************************************************************/ @@ -434,6 +450,7 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns) { PSZ p, sp; bool un = (uns < 0) ? false : (uns > 0) ? true : valp->IsUnsigned(); + PVAL vp; if (newtype == TYPE_VOID) // Means allocate a value of the same type newtype = valp->GetType(); @@ -445,53 +462,55 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns) if ((sp = valp->GetCharString(p)) != p) strcpy (p, sp); - valp = new(g) TYPVAL(g, p, valp->GetValLen(), valp->GetValPrec()); + vp = new(g) TYPVAL(g, p, valp->GetValLen(), valp->GetValPrec()); break; case TYPE_SHORT: if (un) - valp = new(g) TYPVAL(valp->GetUShortValue(), - TYPE_SHORT, 0, true); + vp = new(g) TYPVAL(valp->GetUShortValue(), + TYPE_SHORT, 0, true); else - valp = new(g) TYPVAL(valp->GetShortValue(), TYPE_SHORT); + vp = new(g) TYPVAL(valp->GetShortValue(), TYPE_SHORT); break; case TYPE_INT: if (un) - valp = new(g) TYPVAL(valp->GetUIntValue(), TYPE_INT, 0, true); + vp = new(g) TYPVAL(valp->GetUIntValue(), TYPE_INT, 0, true); else - valp = new(g) TYPVAL(valp->GetIntValue(), TYPE_INT); + vp = new(g) TYPVAL(valp->GetIntValue(), TYPE_INT); break; case TYPE_BIGINT: if (un) - valp = new(g) TYPVAL(valp->GetUBigintValue(), - TYPE_BIGINT, 0, true); + vp = new(g) TYPVAL(valp->GetUBigintValue(), + TYPE_BIGINT, 0, true); else - valp = new(g) TYPVAL(valp->GetBigintValue(), TYPE_BIGINT); + vp = new(g) TYPVAL(valp->GetBigintValue(), TYPE_BIGINT); break; case TYPE_DATE: - valp = new(g) DTVAL(g, valp->GetIntValue()); + vp = new(g) DTVAL(g, valp->GetIntValue()); break; case TYPE_DOUBLE: - valp = new(g) TYPVAL(valp->GetFloatValue(), TYPE_DOUBLE, - (uns) ? uns : valp->GetValPrec()); + vp = new(g) TYPVAL(valp->GetFloatValue(), TYPE_DOUBLE, + (uns) ? uns : valp->GetValPrec()); break; case TYPE_TINY: if (un) - valp = new(g) TYPVAL(valp->GetUTinyValue(), + vp = new(g) TYPVAL(valp->GetUTinyValue(), TYPE_TINY, 0, true); else - valp = new(g) TYPVAL(valp->GetTinyValue(), TYPE_TINY); + vp = new(g) TYPVAL(valp->GetTinyValue(), TYPE_TINY); break; default: sprintf(g->Message, MSG(BAD_VALUE_TYPE), newtype); return NULL; } // endswitch type - - valp->SetGlobal(g); - return valp; + + vp->SetNullable(valp->GetNullable()); + vp->SetNull(valp->IsNull()); + vp->SetGlobal(g); + return vp; } // end of AllocateValue /* -------------------------- Class VALUE ---------------------------- */ @@ -939,7 +958,6 @@ int TYPVAL::CompareValue(PVAL vp) return (Tval > n) ? 1 : (Tval < n) ? (-1) : 0; } // end of CompareValue -#if 0 /***********************************************************************/ /* Return max type value if b is true, else min type value. */ /***********************************************************************/ @@ -1004,7 +1022,7 @@ TYPE TYPVAL::SafeAdd(TYPE n1, TYPE n2) template <> inline double TYPVAL::SafeAdd(double n1, double n2) { - assert(false); return 0; + return n1 + n2; } // end of SafeAdd /***********************************************************************/ @@ -1032,9 +1050,8 @@ TYPE TYPVAL::SafeMult(TYPE n1, TYPE n2) template <> inline double TYPVAL::SafeMult(double n1, double n2) { - assert(false); return 0; + return n1 * n2; } // end of SafeMult -#endif // 0 /***********************************************************************/ /* Compute defined functions for the type. */ @@ -1052,12 +1069,18 @@ bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) switch (op) { case OP_ADD: -// Tval = SafeAdd(val[0], val[1]); - Tval = val[0] + val[1]; + Tval = SafeAdd(val[0], val[1]); break; case OP_MULT: -// Tval = SafeMult(val[0], val[1]); - Tval = val[0] * val[1]; + Tval = SafeMult(val[0], val[1]); + break; + case OP_DIV: + if (!val[1]) { + strcpy(g->Message, MSG(ZERO_DIVIDE)); + return true; + } // endif + + Tval = val[0] / val[1]; break; default: rc = Compall(g, vp, np, op); @@ -1067,7 +1090,6 @@ bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) return rc; } // end of Compute -#if 0 template <> bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) { @@ -1092,7 +1114,6 @@ bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) return rc; } // end of Compute -#endif // 0 /***********************************************************************/ /* Compute a function for all types. */ @@ -1106,6 +1127,18 @@ bool TYPVAL::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op) val[i] = GetTypedValue(vp[i]); switch (op) { + case OP_DIV: + if (val[0]) { + if (!val[1]) { + strcpy(g->Message, MSG(ZERO_DIVIDE)); + return true; + } // endif + + Tval = val[0] / val[1]; + } else + Tval = 0; + + break; case OP_MIN: Tval = MY_MIN(val[0], val[1]); break; diff --git a/storage/connect/value.h b/storage/connect/value.h index c2cc24894ae..c5aeb5c2a2f 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -190,9 +190,9 @@ class DllExport TYPVAL : public VALUE { virtual void Print(PGLOBAL g, char *, uint); protected: -//static TYPE MinMaxVal(bool b); -// TYPE SafeAdd(TYPE n1, TYPE n2); -// TYPE SafeMult(TYPE n1, TYPE n2); + static TYPE MinMaxVal(bool b); + TYPE SafeAdd(TYPE n1, TYPE n2); + TYPE SafeMult(TYPE n1, TYPE n2); bool Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op); // Default constructor not to be used From e57677238379624fc4aa1ff5b2852acfad5c2372 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 20 Jan 2015 11:26:03 +0100 Subject: [PATCH 194/201] - Last revision was to add the JSON table type. This one adds a sort on the multiple table result to obtain the same result on Windows and Linux (because files can be retrieved in a different order) modified: storage/connect/mysql-test/connect/r/json.result storage/connect/mysql-test/connect/t/json.test --- storage/connect/mysql-test/connect/r/json.result | 16 ++++++++-------- storage/connect/mysql-test/connect/t/json.test | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/storage/connect/mysql-test/connect/r/json.result b/storage/connect/mysql-test/connect/r/json.result index 172cded444a..094bb669d18 100644 --- a/storage/connect/mysql-test/connect/r/json.result +++ b/storage/connect/mysql-test/connect/r/json.result @@ -350,32 +350,32 @@ WEEK INT(2), WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.jsn' MULTIPLE=1; -SELECT * FROM t1 ORDER BY WHO, WEEK; +SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT; WHO WEEK WHAT AMOUNT Beth 3 Beer 16.00 Beth 4 Beer 15.00 Beth 4 Food 17.00 -Beth 5 Food 12.00 Beth 5 Beer 20.00 +Beth 5 Food 12.00 Janet 3 Beer 18.00 -Janet 3 Food 18.00 Janet 3 Car 19.00 +Janet 3 Food 18.00 Janet 4 Car 17.00 -Janet 5 Beer 19.00 Janet 5 Beer 14.00 +Janet 5 Beer 19.00 Janet 5 Car 12.00 Janet 5 Food 12.00 -Joe 3 Food 12.00 Joe 3 Beer 18.00 Joe 3 Car 20.00 +Joe 3 Food 12.00 Joe 3 Food 19.00 Joe 4 Beer 14.00 -Joe 4 Food 17.00 -Joe 4 Food 17.00 Joe 4 Beer 16.00 Joe 4 Beer 19.00 -Joe 5 Food 12.00 +Joe 4 Food 17.00 +Joe 4 Food 17.00 Joe 5 Beer 14.00 +Joe 5 Food 12.00 DROP TABLE t1; # # Or also a partition JSON table diff --git a/storage/connect/mysql-test/connect/t/json.test b/storage/connect/mysql-test/connect/t/json.test index 2e66e566daf..a7e630ed0cf 100644 --- a/storage/connect/mysql-test/connect/t/json.test +++ b/storage/connect/mysql-test/connect/t/json.test @@ -215,7 +215,7 @@ WEEK INT(2), WHAT CHAR(32) FIELD_FORMAT='EXPENSE:[X]:WHAT', AMOUNT DOUBLE(8,2) FIELD_FORMAT='EXPENSE:[X]:AMOUNT') ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.jsn' MULTIPLE=1; -SELECT * FROM t1 ORDER BY WHO, WEEK; +SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT; DROP TABLE t1; --echo # From ff55d900fbeb1d426e7737caef6748c3f13bf4e6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 21 Jan 2015 14:02:26 +0100 Subject: [PATCH 195/201] after-merge fixes --- cmake/libutils.cmake | 2 ++ mysql-test/suite/innodb/t/insert_debug.test | 5 +++++ mysql-test/suite/innodb/t/sp_temp_table.test | 5 +++++ storage/tokudb/mysql-test/tokudb_bugs/disabled.def | 3 +++ 4 files changed, 15 insertions(+) diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 8f85b988f8d..8fcfe294f17 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -304,6 +304,8 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result) SET(${result} ${ret} PARENT_SCOPE) ENDFUNCTION() +INCLUDE(CheckCCompilerFlag) + SET(VISIBILITY_HIDDEN_FLAG) IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX) diff --git a/mysql-test/suite/innodb/t/insert_debug.test b/mysql-test/suite/innodb/t/insert_debug.test index 36ceba2ee8b..666b634bef9 100644 --- a/mysql-test/suite/innodb/t/insert_debug.test +++ b/mysql-test/suite/innodb/t/insert_debug.test @@ -2,6 +2,11 @@ --source include/have_debug.inc --source include/have_partition.inc +if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier +} + --echo # --echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 --echo # CAUSES INFINITE PAGE SPLIT diff --git a/mysql-test/suite/innodb/t/sp_temp_table.test b/mysql-test/suite/innodb/t/sp_temp_table.test index b2883f551b9..9a6be85fd7e 100644 --- a/mysql-test/suite/innodb/t/sp_temp_table.test +++ b/mysql-test/suite/innodb/t/sp_temp_table.test @@ -1,6 +1,11 @@ --source include/have_innodb.inc --source include/big_test.inc +if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier +} + --echo # --echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE --echo # CALLED FROM A FUNCTION diff --git a/storage/tokudb/mysql-test/tokudb_bugs/disabled.def b/storage/tokudb/mysql-test/tokudb_bugs/disabled.def index 0bf13a5e86e..86d38a530da 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/disabled.def +++ b/storage/tokudb/mysql-test/tokudb_bugs/disabled.def @@ -9,3 +9,6 @@ fileops-3: how this could work, if alter needs an exclusive mdl lock? checkpoint_lock_2: test can not work when the checkpoint_safe_lock is a fair rwlock +# this test was added in 7.5.4 and fails in 10.0 +# but running this very test in 7.5.3 fails in exactly the same manner +db768: never worked. tokutek was informed, 2015-01-14 From f2be9c0fea8e2d736a44bb46db5b87666e3eac9e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 22 Jan 2015 08:58:13 +0100 Subject: [PATCH 196/201] after merge. innodb/xtradb to work on Windows --- storage/innobase/fil/fil0fil.cc | 2 ++ storage/innobase/include/fil0fil.h | 1 - storage/xtradb/fil/fil0fil.cc | 2 ++ storage/xtradb/include/fil0fil.h | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index a77893b7ab7..4175abdf895 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -55,6 +55,8 @@ Created 10/25/1995 Heikki Tuuri static ulint srv_data_read, srv_data_written; #endif /* !UNIV_HOTBACKUP */ +MYSQL_PLUGIN_IMPORT extern my_bool lower_case_file_system; + /* IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE ============================================= diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 5d9f96ce364..da2ee1c5730 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -42,7 +42,6 @@ Created 10/25/1995 Heikki Tuuri #include -extern my_bool lower_case_file_system; // Forward declaration struct trx_t; struct fil_space_t; diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index 115d8da16be..5d547edaaf9 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -55,6 +55,8 @@ Created 10/25/1995 Heikki Tuuri static ulint srv_data_read, srv_data_written; #endif /* !UNIV_HOTBACKUP */ +MYSQL_PLUGIN_IMPORT extern my_bool lower_case_file_system; + /* IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE ============================================= diff --git a/storage/xtradb/include/fil0fil.h b/storage/xtradb/include/fil0fil.h index b6bc326ecdc..7edf79043d3 100644 --- a/storage/xtradb/include/fil0fil.h +++ b/storage/xtradb/include/fil0fil.h @@ -43,7 +43,6 @@ Created 10/25/1995 Heikki Tuuri #include -extern my_bool lower_case_file_system; // Forward declaration struct trx_t; struct fil_space_t; From c23c00136a2b855c22b0bd8d316f0793fb60ec04 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 22 Jan 2015 16:11:03 +0100 Subject: [PATCH 197/201] MDEV-7491: Occasional test failure in innodb.group_commit_crash_no_optimize_thread The test case deliberately crashes the server. If this crash happens in the middle of a page write, InnoDB crash recovery recovers the page from the doublewrite buffer, writing a message to the error log that is flagged as a test failure by mysql-test-run. So add a suppression for this. --- mysql-test/suite/innodb/r/group_commit_crash.result | 1 + .../suite/innodb/r/group_commit_crash_no_optimize_thread.result | 1 + mysql-test/suite/innodb/t/group_commit_crash.test | 2 ++ .../suite/innodb/t/group_commit_crash_no_optimize_thread.test | 2 ++ 4 files changed, 6 insertions(+) diff --git a/mysql-test/suite/innodb/r/group_commit_crash.result b/mysql-test/suite/innodb/r/group_commit_crash.result index 005049df281..5d5dffab33e 100644 --- a/mysql-test/suite/innodb/r/group_commit_crash.result +++ b/mysql-test/suite/innodb/r/group_commit_crash.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); CREATE TABLE t1(a CHAR(255), b CHAR(255), c CHAR(255), diff --git a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result index 846500ad2b1..542ce9d496e 100644 --- a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result +++ b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); CREATE TABLE t1(a CHAR(255), b CHAR(255), c CHAR(255), diff --git a/mysql-test/suite/innodb/t/group_commit_crash.test b/mysql-test/suite/innodb/t/group_commit_crash.test index 7ad0d9d1e74..cad349819bd 100644 --- a/mysql-test/suite/innodb/t/group_commit_crash.test +++ b/mysql-test/suite/innodb/t/group_commit_crash.test @@ -9,6 +9,8 @@ --source include/have_debug.inc --source include/have_log_bin.inc +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); + let $file_format_max=`SELECT @@innodb_file_format_max`; CREATE TABLE t1(a CHAR(255), b CHAR(255), diff --git a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test index 9dc2557e687..8d1f460b64b 100644 --- a/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test +++ b/mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test @@ -9,6 +9,8 @@ --source include/have_debug.inc --source include/have_log_bin.inc +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); + let $file_format_max=`SELECT @@innodb_file_format_max`; CREATE TABLE t1(a CHAR(255), b CHAR(255), From cb9c116a50367299f7faa592d51d95705a498567 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 23 Jan 2015 09:13:21 +0100 Subject: [PATCH 198/201] update tokudb version after merge --- storage/tokudb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 59fb55a57e8..be8f10e9808 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -25,7 +25,7 @@ IF (HAVE_WVLA) ENDIF() ############################################ -SET(TOKUDB_VERSION "tokudb-7.5.3") +SET(TOKUDB_VERSION "tokudb-7.5.4") SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-5.5/README-TOKUDB\nusr/share/doc/mariadb-server-5.5/README.md" PARENT_SCOPE) SET(USE_BDB OFF CACHE BOOL "") MARK_AS_ADVANCED(BUILDNAME) From c287873795debc6c7939f6425ee41348e4a30690 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Fri, 23 Jan 2015 13:56:46 +0100 Subject: [PATCH 199/201] MDEV-7352: main.kill_processlist-6619 fails sporadically in buildbot After fix of MDEV-6728, the KILL signal is reset at the start of query execution. This means that in this test case, we need to wait for the to-be-killed query to have started; otherwise the kill signal can be lost, causing the test case to fail. --- mysql-test/r/kill_processlist-6619.result | 4 +++- mysql-test/t/kill_processlist-6619.test | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/kill_processlist-6619.result b/mysql-test/r/kill_processlist-6619.result index 8cb9fe7270c..7dd42790cc7 100644 --- a/mysql-test/r/kill_processlist-6619.result +++ b/mysql-test/r/kill_processlist-6619.result @@ -3,13 +3,15 @@ SHOW PROCESSLIST; Id User Host db Command Time State Info Progress # root # test Sleep # # NULL 0.000 # root # test Query # # SHOW PROCESSLIST 0.000 -SET DEBUG_SYNC='before_execute_sql_command WAIT_FOR go'; +SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; SHOW PROCESSLIST; connection default; +SET DEBUG_SYNC='now WAIT_FOR ready'; KILL QUERY con_id; SET DEBUG_SYNC='now SIGNAL go'; connection con1; ERROR 70100: Query execution was interrupted +SET DEBUG_SYNC='reset'; SHOW PROCESSLIST; Id User Host db Command Time State Info Progress # root # test Sleep # # NULL 0.000 diff --git a/mysql-test/t/kill_processlist-6619.test b/mysql-test/t/kill_processlist-6619.test index 472d2d57fb2..95af83be56d 100644 --- a/mysql-test/t/kill_processlist-6619.test +++ b/mysql-test/t/kill_processlist-6619.test @@ -9,14 +9,19 @@ --let $con_id = `SELECT CONNECTION_ID()` --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; -SET DEBUG_SYNC='before_execute_sql_command WAIT_FOR go'; +SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go'; send SHOW PROCESSLIST; --connection default +# We must wait for the SHOW PROCESSLIST query to have started before sending +# the kill. Otherwise, the KILL may be lost since it is reset at the start of +# query execution. +SET DEBUG_SYNC='now WAIT_FOR ready'; --replace_result $con_id con_id eval KILL QUERY $con_id; SET DEBUG_SYNC='now SIGNAL go'; --connection con1 --error ER_QUERY_INTERRUPTED reap; +SET DEBUG_SYNC='reset'; --replace_column 1 # 3 # 6 # 7 # SHOW PROCESSLIST; From d1c4ff2b2cd54886087b6b879a6ea23f66d6582f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 23 Jan 2015 14:17:38 +0100 Subject: [PATCH 200/201] win32-debug build failure --- sql-common/client_plugin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index 133d008f99b..063fc5c6dc6 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -28,6 +28,11 @@ There is no reference counting and no unloading either. */ +#if _MSC_VER +/* Silence warnings about variable 'unused' being used. */ +#define FORCE_INIT_OF_VARS 1 +#endif + #include #include "mysql.h" #include From fb71449b10100e9a0f887b1585000fbfab294f3c Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Sun, 25 Jan 2015 16:16:25 +0100 Subject: [PATCH 201/201] MDEV-5719: Wrong result with GROUP BY and LEFT OUTER JOIN Merged revision 5224 from mysql-5.6 and added a test case. .. revno: 5224 committer: Sergey Glukhov branch nick: mysql-5.6 timestamp: Wed 2013-06-19 14:24:08 +0400 message: Bug#16620047 INCORRECT QUERY RESULT (AFTER SERVER UPGRADE) --- mysql-test/r/group_by_innodb.result | 23 +++++++++++++++++++++++ mysql-test/t/group_by_innodb.test | 19 +++++++++++++++++++ sql/field.h | 23 +++++++++++++++-------- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/group_by_innodb.result b/mysql-test/r/group_by_innodb.result index 4b5d9990c51..1098579a82d 100644 --- a/mysql-test/r/group_by_innodb.result +++ b/mysql-test/r/group_by_innodb.result @@ -57,3 +57,26 @@ i GROUP_CONCAT( d1, d2 ORDER BY d1, d2 ) NULL 11.1,22.2 DROP TABLE t1; End of 5.5 tests +# +# MDEV-5719: Wrong result with GROUP BY and LEFT OUTER JOIN +# +CREATE TABLE t1 (oidGroup INT, oid INT PRIMARY KEY)ENGINE=INNODB; +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 (oid INT PRIMARY KEY)ENGINE=INNODB; +INSERT INTO t2 VALUES (3); +SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON +a.oid=b.oid WHERE a.oidGroup=1; +oidGroup oid oid +1 1 NULL +1 2 NULL +1 3 3 +1 4 NULL +SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON +a.oid=b.oid WHERE a.oidGroup=1 GROUP BY a.oid; +oidGroup oid oid +1 1 NULL +1 2 NULL +1 3 3 +1 4 NULL +DROP TABLE t1, t2; +# End of tests diff --git a/mysql-test/t/group_by_innodb.test b/mysql-test/t/group_by_innodb.test index df213cc189f..75ee3d0802a 100644 --- a/mysql-test/t/group_by_innodb.test +++ b/mysql-test/t/group_by_innodb.test @@ -67,3 +67,22 @@ DROP TABLE t1; --echo End of 5.5 tests +--echo # +--echo # MDEV-5719: Wrong result with GROUP BY and LEFT OUTER JOIN +--echo # +CREATE TABLE t1 (oidGroup INT, oid INT PRIMARY KEY)ENGINE=INNODB; +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); + +CREATE TABLE t2 (oid INT PRIMARY KEY)ENGINE=INNODB; +INSERT INTO t2 VALUES (3); + +# Returns a value +SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON +a.oid=b.oid WHERE a.oidGroup=1; + +SELECT a.oidGroup, a.oid, b.oid FROM t1 a LEFT JOIN t2 b ON +a.oid=b.oid WHERE a.oidGroup=1 GROUP BY a.oid; + +DROP TABLE t1, t2; + +--echo # End of tests diff --git a/sql/field.h b/sql/field.h index dd603d41bf7..0390e95f954 100644 --- a/sql/field.h +++ b/sql/field.h @@ -656,21 +656,28 @@ public: inline bool is_null(my_ptrdiff_t row_offset= 0) const { /* + If the field is NULLable, it returns NULLity based + on null_ptr[row_offset] value. Otherwise it returns + NULL flag depending on TABLE::null_row value. + The table may have been marked as containing only NULL values for all fields if it is a NULL-complemented row of an OUTER JOIN or if the query is an implicitly grouped query (has aggregate functions but no GROUP BY clause) with no qualifying rows. If - this is the case (in which TABLE::null_row is true), the field - is considered to be NULL. + this is the case (in which TABLE::null_row is true) and the + field is not nullable, the field is considered to be NULL. + + Do not change the order of testing. Fields may be associated + with a TABLE object without being part of the current row. + For NULL value check to work for these fields, they must + have a valid null_ptr, and this pointer must be checked before + TABLE::null_row. + Note that if a table->null_row is set then also all null_bits are set for the row. - - Otherwise, if the field is NULLable, it has a valid null_ptr - pointer, and its NULLity is recorded in the "null_bit" bit of - null_ptr[row_offset]. */ - return (table->null_row ? TRUE : - null_ptr ? MY_TEST(null_ptr[row_offset] & null_bit) : 0); + return real_maybe_null() ? + MY_TEST(null_ptr[row_offset] & null_bit) : table->null_row; } inline bool is_real_null(my_ptrdiff_t row_offset= 0) const { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : 0; }