From: Bjorn Munch Date: January 29 2011 9:39pm Subject: bzr commit into mysql-5.1-mtr branch (bjorn.munch:2977) List-Archive: http://lists.mysql.com/commits/129943 Message-Id: <201101292139.p0TLdWuG012575@khepri15.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/bm136801/my/merge-51/ based on revid:bjorn.munch@stripped 2977 Bjorn Munch 2011-01-29 [merge] merge from 5.1 main added: mysql-test/include/have_dbi_dbd-mysql.inc mysql-test/std_data/checkDBI_DBD-mysql.pl modified: client/mysqltest.cc mysql-test/include/mysqlhotcopy.inc mysql-test/mysql-test-run.pl mysql-test/r/partition_error.result mysql-test/suite/ndb/r/ndb_basic.result mysql-test/suite/ndb/t/ndb_basic.test mysql-test/suite/parts/inc/partition_check_drop.inc mysql-test/suite/parts/inc/partition_layout_check1.inc mysql-test/suite/parts/inc/partition_layout_check2.inc mysql-test/suite/parts/r/partition_recover_myisam.result mysql-test/suite/parts/t/partition_debug_sync_innodb.test mysql-test/suite/parts/t/partition_recover_myisam.test mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/rpl/t/disabled.def mysql-test/suite/sys_vars/r/general_log_file_basic.result mysql-test/suite/sys_vars/r/log_output_func.result mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result mysql-test/suite/sys_vars/t/div_precision_increment_func.test mysql-test/suite/sys_vars/t/general_log_file_basic.test mysql-test/suite/sys_vars/t/log_output_func.test mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test mysql-test/t/disabled.def mysql-test/t/partition_error.test sql/item.h sql/item_func.h sql/item_timefunc.h sql/sql_partition.cc sql/table.cc === modified file 'client/mysqltest.cc' --- a/client/mysqltest.cc 2011-01-18 10:03:44 +0000 +++ b/client/mysqltest.cc 2011-01-26 15:34:34 +0000 @@ -7255,8 +7255,12 @@ void run_query_stmt(MYSQL *mysql, struct mysql_free_result(res); /* Free normal result set with meta data */ - /* Clear prepare warnings */ - dynstr_set(&ds_prepare_warnings, NULL); + /* + Clear prepare warnings if there are execute warnings, + since they are probably duplicated. + */ + if (ds_execute_warnings.length || mysql->warning_count) + dynstr_set(&ds_prepare_warnings, NULL); } else { === added file 'mysql-test/include/have_dbi_dbd-mysql.inc' --- a/mysql-test/include/have_dbi_dbd-mysql.inc 1970-01-01 00:00:00 +0000 +++ b/mysql-test/include/have_dbi_dbd-mysql.inc 2011-01-29 11:38:36 +0000 @@ -0,0 +1,78 @@ +# +# Originally created by John Embretsen, 2011-01-26. +# +# Checks for the existence of Perl modules DBI and DBD::mysql as seen from the +# perl installation used by "external" executable perl scripts, i.e. scripts +# that are executed as standalone scripts interpreted by the perl installation +# specified by the "shebang" line in the top of these scripts. +# +# If either module is not found, the test will be skipped. +# +# For use in tests that call perl scripts that require these modules. +# +# This file is intended to work on Unix. Windows may need different treatment. +# Reasoning: +# - "shebangs" are not relevant on Windows, but need to be handled here. +# - Perl scripts cannot be made executable on Windows, interpreter must be +# specified. +# +# Note that if there are multiple perl installations and not all have the +# required modules, this check may fail even if the perl in path does have +# the modules available. This may happen if the perl specified by the script's +# shebang (e.g. #!/usr/bin/perl) does not have these modules, and script is +# called without specifying the perl interpreter. However, this will be +# a correct result in cases where a test calls a script with a similar shebang. +# +################################################################################ + +--source include/not_windows.inc + +# We jump through some hoops since there is no direct way to check if an +# external command went OK or not from a mysql-test file: +# +# - In theory, we could do as simple as "exec perl -MDBI -MDBD::mysql -e 1", +# however we cannot check the result (exit code) from within a test script. +# Also, this may not yield the same result as other uses of perl due to the +# shebang issue mentioned above. +# - Instead we use a separate helper perl script that checks for the modules. +# - If the modules are found, the perl script leaves a file which sets a +# variable that can be read by this file. +# If the modules are not found, the perl script does not set this variable, +# but leaves an empty file instead. +# +# This is done because there is apparently no direct way to transfer +# information from perl to the test script itself. + +--disable_query_log +--disable_result_log +--disable_warnings + +# We do not use embedded perl in this script because that would not have yielded +# correct results for a situation where an external Perl script is called like +# "scriptname" instead of "perl scriptname" and the shebang in the script points +# to a specific perl that may be different than the perl in PATH. +# +# Instead, we call a separate helper script which checks for the modules in its +# own environment. We call it without "perl" in front. + +--let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl +--let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt + +# Make the script executable and execute it. +--chmod 0755 $perlChecker +--exec $perlChecker + +# Source the resulting temporary file and look for a variable being set. +--source $resultFile + +if (!$dbidbd) { + --skip Test needs Perl modules DBI and DBD::mysql +} + +# Clean up +--remove_file $resultFile + +--enable_query_log +--enable_result_log +--enable_warnings + === modified file 'mysql-test/include/mysqlhotcopy.inc' --- a/mysql-test/include/mysqlhotcopy.inc 2010-06-04 08:53:18 +0000 +++ b/mysql-test/include/mysqlhotcopy.inc 2011-01-29 11:38:36 +0000 @@ -4,12 +4,26 @@ --source include/not_windows.inc --source include/not_embedded.inc +--source include/have_dbi_dbd-mysql.inc -if ($MYSQLHOTCOPY) +if (!$MYSQLHOTCOPY) { + # Fail the test if the mysqlhotcopy script is missing. + # If the tool's location changes, mysql-test-run.pl must be updated to + # reflect this (look for "MYSQLHOTCOPY"). die due to missing mysqlhotcopy tool; } +# NOTE (johnemb, 2011-01-26): +# In this test mysqlhotcopy (a perl script) is executed as a standalone +# executable, i.e. not necessarily using the perl interpreter in PATH, +# because that is how the documentation demonstrates it. +# +# We include have_dbi_dbd-mysql.inc above so that the test will +# be skipped if Perl modules required by the mysqlhotcopy tool are not +# found when the script is run this way. + + let $MYSQLD_DATADIR= `SELECT @@datadir`; --disable_warnings DROP DATABASE IF EXISTS hotcopy_test; === modified file 'mysql-test/mysql-test-run.pl' --- a/mysql-test/mysql-test-run.pl 2011-01-21 12:57:21 +0000 +++ b/mysql-test/mysql-test-run.pl 2011-01-27 11:38:13 +0000 @@ -2141,10 +2141,12 @@ sub environment_setup { # mysqlhotcopy # ---------------------------------------------------- my $mysqlhotcopy= - mtr_pl_maybe_exists("$basedir/scripts/mysqlhotcopy"); - # Since mysqltest interprets the real path as "false" in an if, - # use 1 ("true") to indicate "not exists" so it can be tested for - $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy || 1; + mtr_pl_maybe_exists("$basedir/scripts/mysqlhotcopy") || + mtr_pl_maybe_exists("$path_client_bindir/mysqlhotcopy"); + if ($mysqlhotcopy) + { + $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy; + } # ---------------------------------------------------- # perror === modified file 'mysql-test/r/partition_error.result' --- a/mysql-test/r/partition_error.result 2010-12-22 09:50:36 +0000 +++ b/mysql-test/r/partition_error.result 2011-01-26 15:50:21 +0000 @@ -1,5 +1,18 @@ drop table if exists t1; # +# Bug#57924: crash when creating partitioned table with +# multiple columns in the partition key +# +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, a); +ERROR HY000: Field in list of fields for partition function not found in table +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(A, b); +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, A); +ERROR HY000: Field in list of fields for partition function not found in table +# # Bug#54483: valgrind errors when making warnings for multiline inserts # into partition # === added file 'mysql-test/std_data/checkDBI_DBD-mysql.pl' --- a/mysql-test/std_data/checkDBI_DBD-mysql.pl 1970-01-01 00:00:00 +0000 +++ b/mysql-test/std_data/checkDBI_DBD-mysql.pl 2011-01-29 11:38:36 +0000 @@ -0,0 +1,97 @@ +#!/usr/bin/perl + +# Copyright (c) 2011, 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 Library 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 +# Library 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 + + +################################################################################ +# +# This perl script checks for availability of the Perl modules DBI and +# DBD::mysql using the "current" perl interpreter. +# +# Useful for test environment checking before testing executable perl scripts +# in the MySQL Server distribution. +# +# NOTE: The "shebang" on the first line of this script should always point to +# /usr/bin/perl, so that we can use this script to check whether or not we +# support running perl scripts with such a shebang without specifying the +# perl interpreter on the command line. Such a script is mysqlhotcopy. +# +# When run as "checkDBI_DBD-mysql.pl" the shebang line will be evaluated +# and used. When run as "perl checkDBI_DBD-mysql.pl" the shebang line is +# not used. +# +# NOTE: This script will create a temporary file in MTR's tmp dir. +# If modules are found, a mysql-test statement which sets a special +# variable is written to this file. If one of the modules is not found +# (or cannot be loaded), the file will remain empty. +# A test (or include file) which sources that file can then easily do +# an if-check on the special variable to determine success or failure. +# +# Example: +# +# --let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl +# --let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt +# --chmod 0755 $perlChecker +# --exec $perlChecker +# --source $resultFile +# if (!$dbidbd) { +# --skip Test needs Perl modules DBI and DBD::mysql +# } +# +# The calling script is also responsible for cleaning up after use: +# +# --remove_file $resultFile +# +# Windows notes: +# - shebangs may work differently - call this script with "perl " in front. +# +# See mysql-test/include/have_dbi_dbd-mysql.inc for example use of this script. +# This script should be executable for the user running MTR. +# +################################################################################ + +BEGIN { + # By using eval inside BEGIN we can suppress warnings and continue after. + # We need to catch "Can't locate" as well as "Can't load" errors. + eval{ + $FOUND_DBI=0; + $FOUND_DBD_MYSQL=0; + + # Check for DBI module: + $FOUND_DBI=1 if require DBI; + + # Check for DBD::mysql module + $FOUND_DBD_MYSQL=1 if require DBD::mysql; + }; +}; + +# Open a file to be used for transfer of result back to mysql-test. +# The file must be created whether we write to it or not, otherwise mysql-test +# will complain if trying to source it. +# An empty file indicates failure to load modules. +open(FILE, ">", $ENV{'MYSQL_TMP_DIR'}.'/dbidbd-mysql.txt'); + +if ($FOUND_DBI && $FOUND_DBD_MYSQL) { + # write a mysql-test command setting a variable to indicate success + print(FILE 'let $dbidbd= FOUND_DBI_DBD-MYSQL;'."\n"); +} + +# close the file. +close(FILE); + +1; + === modified file 'mysql-test/suite/ndb/r/ndb_basic.result' --- a/mysql-test/suite/ndb/r/ndb_basic.result 2007-10-26 07:06:18 +0000 +++ b/mysql-test/suite/ndb/r/ndb_basic.result 2011-01-10 15:20:28 +0000 @@ -585,6 +585,8 @@ c127 int, c128 int, primary key using hash(c1)) engine=ndb partition by key(c1); drop table t1; +create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`); +ERROR HY000: Field in list of fields for partition function not found in table create table t1 ( a1234567890123456789012345678901234567890 int primary key, a12345678901234567890123456789a1234567890 int, === modified file 'mysql-test/suite/ndb/t/ndb_basic.test' --- a/mysql-test/suite/ndb/t/ndb_basic.test 2007-10-26 06:57:10 +0000 +++ b/mysql-test/suite/ndb/t/ndb_basic.test 2011-01-10 15:20:28 +0000 @@ -548,6 +548,13 @@ primary key using hash(c1)) engine=ndb p drop table t1; # +# test bug#53354 - crash when creating partitioned table with multiple columns in the partition key +# + +--error ER_FIELD_NOT_FOUND_PART_ERROR +create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`); + +# # test max size of attribute name and truncation # === modified file 'mysql-test/suite/parts/inc/partition_check_drop.inc' --- a/mysql-test/suite/parts/inc/partition_check_drop.inc 2008-08-04 05:04:47 +0000 +++ b/mysql-test/suite/parts/inc/partition_check_drop.inc 2011-01-18 22:55:39 +0000 @@ -66,10 +66,10 @@ if ($found_garbage) } # Do a manual cleanup, because the following tests should not suffer from # remaining files - --exec rm -f $MYSQLD_DATADIR/test/t1* || true + --remove_files_wildcard $MYSQLD_DATADIR/test t1* if ($with_directories) { - --exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true + --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1* } } --enable_query_log === modified file 'mysql-test/suite/parts/inc/partition_layout_check1.inc' --- a/mysql-test/suite/parts/inc/partition_layout_check1.inc 2009-02-01 12:00:48 +0000 +++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc 2011-01-18 22:55:39 +0000 @@ -29,14 +29,10 @@ DELETE FROM t0_definition; let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`; #echo MYSQLD_DATADIR: $MYSQLD_DATADIR; -# Dump the current definition of the table t1 to tmp1 -# This complicated method - let another mysqltest collect the output - is used -# because of two reasons +# Save the current definition of the table t1 # - SHOW CREATE TABLE t1 is at least currently most probably more reliable than # the corresponding SELECT on the INFORMATION_SCHEMA -# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT -let $show_file= $MYSQLD_DATADIR/test/tmp1; ---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1 +let $show_create= `SHOW CREATE TABLE t1`; if ($do_file_tests) { # List the files belonging to the table t1 @@ -57,12 +53,13 @@ if (!$do_file_tests) # Insert the current definition of the table t1 into t0_definition eval INSERT INTO t0_definition SET state = 'old', - create_command = load_file('$show_file'), + create_command = "$show_create", file_list = @aux; # Print the create table statement into the protocol +# Added the concat to avoid changing the result files --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR '\r' '' -SELECT create_command FROM t0_definition WHERE state = 'old'; +SELECT concat('SHOW CREATE TABLE t1;\nTable\tCreate Table\n',create_command,'\n') as `create_command` FROM t0_definition WHERE state = 'old'; if ($do_file_tests) { # We stored the list of files, therefore printing the content makes sense === modified file 'mysql-test/suite/parts/inc/partition_layout_check2.inc' --- a/mysql-test/suite/parts/inc/partition_layout_check2.inc 2009-02-01 12:00:48 +0000 +++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc 2011-01-18 22:55:39 +0000 @@ -28,9 +28,8 @@ DELETE FROM t0_definition WHERE state = let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`; #echo MYSQLD_DATADIR: $MYSQLD_DATADIR; -# Dump the current definition of the table t1 to tmp1 -let $show_file= $MYSQLD_DATADIR/test/tmp1; ---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1 +# Save the current definition of the table t1 +let $show_create= `SHOW CREATE TABLE t1`; if ($do_file_tests) { @@ -52,7 +51,7 @@ if (!$do_file_tests) # Insert the current definition of the table t1 into t0_definition eval INSERT INTO t0_definition SET state = 'new', - create_command = load_file('$show_file'), + create_command = "$show_create", file_list = @aux; # Print the old and new table layout, if they differ === modified file 'mysql-test/suite/parts/r/partition_recover_myisam.result' --- a/mysql-test/suite/parts/r/partition_recover_myisam.result 2009-08-29 21:29:47 +0000 +++ b/mysql-test/suite/parts/r/partition_recover_myisam.result 2011-01-18 22:55:39 +0000 @@ -1,4 +1,4 @@ -call mtr.add_suppression("./test/t1_will_crash"); +call mtr.add_suppression("t1_will_crash"); call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc"); CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM; INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); === modified file 'mysql-test/suite/parts/t/partition_debug_sync_innodb.test' --- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test 2010-03-17 14:10:41 +0000 +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test 2011-01-18 22:55:39 +0000 @@ -14,6 +14,7 @@ partition by range (a) insert into t1 values (1), (11), (21), (33); SELECT * FROM t1; SHOW CREATE TABLE t1; +--replace_result #p# #P# --list_files $MYSQLD_DATADIR/test SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; @@ -36,6 +37,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 I disconnect con1; connection default; --reap +--replace_result #p# #P# --list_files $MYSQLD_DATADIR/test SHOW CREATE TABLE t1; SELECT * FROM t1; === modified file 'mysql-test/suite/parts/t/partition_recover_myisam.test' --- a/mysql-test/suite/parts/t/partition_recover_myisam.test 2009-08-29 21:29:47 +0000 +++ b/mysql-test/suite/parts/t/partition_recover_myisam.test 2011-01-18 22:55:39 +0000 @@ -1,6 +1,6 @@ # test the auto-recover (--myisam-recover) of partitioned myisam tables -call mtr.add_suppression("./test/t1_will_crash"); +call mtr.add_suppression("t1_will_crash"); call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc"); --source include/have_partition.inc @@ -20,6 +20,8 @@ FLUSH TABLES; let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI --copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI +--replace_result \\ / +--replace_regex /Table '.*data/Table './ SELECT * FROM t1_will_crash; DROP TABLE t1_will_crash; CREATE TABLE t1_will_crash (a INT, KEY (a)) @@ -33,5 +35,7 @@ FLUSH TABLES; --echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI --remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI --copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI +--replace_result \\ / +--replace_regex /Table '.*data/Table './ SELECT * FROM t1_will_crash; DROP TABLE t1_will_crash; === modified file 'mysql-test/suite/parts/t/partition_special_innodb.test' --- a/mysql-test/suite/parts/t/partition_special_innodb.test 2008-12-04 09:47:25 +0000 +++ b/mysql-test/suite/parts/t/partition_special_innodb.test 2011-01-18 22:55:39 +0000 @@ -58,8 +58,8 @@ ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 2; -connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,); -connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (con1, localhost, root,,); +connect (con2, localhost, root,,); --connection con1 SET autocommit=OFF; === modified file 'mysql-test/suite/rpl/t/disabled.def' --- a/mysql-test/suite/rpl/t/disabled.def 2011-01-05 12:58:05 +0000 +++ b/mysql-test/suite/rpl/t/disabled.def 2011-01-26 12:37:24 +0000 @@ -13,3 +13,5 @@ rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle rpl_get_master_version_and_clock : Bug#59178 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock +rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out +rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out === modified file 'mysql-test/suite/sys_vars/r/general_log_file_basic.result' --- a/mysql-test/suite/sys_vars/r/general_log_file_basic.result 2010-11-08 15:30:26 +0000 +++ b/mysql-test/suite/sys_vars/r/general_log_file_basic.result 2010-11-11 10:25:03 +0000 @@ -16,4 +16,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='general_log_file'; @@global.general_log_file = VARIABLE_VALUE 1 -SET @@global.general_log_file= 'test.log'; +SET @@global.general_log_file= 'start_value'; === modified file 'mysql-test/suite/sys_vars/r/log_output_func.result' --- a/mysql-test/suite/sys_vars/r/log_output_func.result 2010-11-08 15:30:26 +0000 +++ b/mysql-test/suite/sys_vars/r/log_output_func.result 2010-11-11 10:25:03 +0000 @@ -52,7 +52,7 @@ count(*) DROP TABLE t1; connection default; SET @@global.general_log= 'OFF'; -SET @@global.general_log_file= '/home/horst/bzr/5.1-52501/mysql-test/var/mysqld.1/mysqld.log'; +SET @@global.general_log_file= 'start_general_log_file'; SET @@global.log_output= @start_value; SET @@global.general_log= @start_general_log; SET @@global.general_log= 'ON'; === modified file 'mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result' --- a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result 2010-11-08 15:30:26 +0000 +++ b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result 2010-11-11 10:25:03 +0000 @@ -14,4 +14,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slow_query_log_file'; @@global.slow_query_log_file = VARIABLE_VALUE 1 -SET @@global.slow_query_log_file= 'slowtest.log'; +SET @@global.slow_query_log_file= 'start_value'; === modified file 'mysql-test/suite/sys_vars/t/div_precision_increment_func.test' --- a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test 2008-12-19 15:12:15 +0000 +++ b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test 2010-11-11 10:25:03 +0000 @@ -19,7 +19,7 @@ # # ################################################################################ -let $save_div_precision_increment = `SELECT @@global.div_precision_increment` +let $save_div_precision_increment = `SELECT @@global.div_precision_increment`; #SET @save_div_precision_increment = @@global.div_precision_increment; === modified file 'mysql-test/suite/sys_vars/t/general_log_file_basic.test' --- a/mysql-test/suite/sys_vars/t/general_log_file_basic.test 2010-11-08 15:30:26 +0000 +++ b/mysql-test/suite/sys_vars/t/general_log_file_basic.test 2010-11-11 10:25:03 +0000 @@ -70,6 +70,7 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='general_log_file'; #SET @@global.general_log_file= @start_value; +--replace_result $start_value start_value eval SET @@global.general_log_file= '$start_value'; ##################################################### === modified file 'mysql-test/suite/sys_vars/t/log_output_func.test' --- a/mysql-test/suite/sys_vars/t/log_output_func.test 2010-11-08 15:30:26 +0000 +++ b/mysql-test/suite/sys_vars/t/log_output_func.test 2010-11-11 10:25:03 +0000 @@ -115,6 +115,7 @@ file_exists $MYSQLTEST_VARDIR/run/mytest connection default; SET @@global.general_log= 'OFF'; #SET @@global.general_log_file= @start_general_log_file; +--replace_result $start_general_log_file start_general_log_file eval SET @@global.general_log_file= '$start_general_log_file'; SET @@global.log_output= @start_value; SET @@global.general_log= @start_general_log; === modified file 'mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test' --- a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test 2010-11-08 15:30:26 +0000 +++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test 2010-11-11 10:25:03 +0000 @@ -68,6 +68,7 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slow_query_log_file'; #SET @@global.slow_query_log_file= @start_value; +--replace_result $start_value start_value eval SET @@global.slow_query_log_file= '$start_value'; #SELECT @start_value; ##################################################### === modified file 'mysql-test/t/disabled.def' --- a/mysql-test/t/disabled.def 2010-11-18 10:40:57 +0000 +++ b/mysql-test/t/disabled.def 2011-01-29 11:38:36 +0000 @@ -11,7 +11,5 @@ ############################################################################## kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild. query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically -main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails -main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails log_tables-big : Bug#48646 2010-11-15 mattiasj report already exists read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists === modified file 'mysql-test/t/partition_error.test' --- a/mysql-test/t/partition_error.test 2010-12-22 09:50:36 +0000 +++ b/mysql-test/t/partition_error.test 2011-01-26 15:50:21 +0000 @@ -11,6 +11,21 @@ drop table if exists t1; let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # +--echo # Bug#57924: crash when creating partitioned table with +--echo # multiple columns in the partition key +--echo # +--error ER_FIELD_NOT_FOUND_PART_ERROR +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, a); +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(A, b); +DROP TABLE t1; +--error ER_FIELD_NOT_FOUND_PART_ERROR +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, A); + + +--echo # --echo # Bug#54483: valgrind errors when making warnings for multiline inserts --echo # into partition --echo # @@ -673,7 +688,6 @@ PARTITION BY HASH (TIME_TO_SEC(a)); CREATE TABLE t1 (a INT) PARTITION BY HASH (TIME_TO_SEC(a)); - --echo # --echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) --echo # === modified file 'sql/item.h' --- a/sql/item.h 2011-01-04 13:13:20 +0000 +++ b/sql/item.h 2011-01-27 22:47:24 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, 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 === modified file 'sql/item_func.h' --- a/sql/item_func.h 2011-01-04 13:13:20 +0000 +++ b/sql/item_func.h 2011-01-27 22:47:24 +0000 @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, 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 === modified file 'sql/item_timefunc.h' --- a/sql/item_timefunc.h 2010-12-22 14:45:17 +0000 +++ b/sql/item_timefunc.h 2011-01-28 12:37:39 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (c) 2000, 2011, 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 === modified file 'sql/sql_partition.cc' --- a/sql/sql_partition.cc 2010-12-22 14:45:17 +0000 +++ b/sql/sql_partition.cc 2011-01-27 22:47:24 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2005, 2011, 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 @@ -761,6 +761,9 @@ static bool handle_list_of_fields(List_i bool result; char *field_name; bool is_list_empty= TRUE; + int fields_handled = 0; + char* field_name_array[MAX_KEY]; + DBUG_ENTER("handle_list_of_fields"); while ((field_name= it++)) @@ -776,6 +779,25 @@ static bool handle_list_of_fields(List_i result= TRUE; goto end; } + + /* + Check for duplicate fields in the list. + Assuming that there are not many fields in the partition key list. + If there were, it would be better to replace the for-loop + with a more efficient algorithm. + */ + + field_name_array[fields_handled] = field_name; + for (int i = 0; i < fields_handled; ++i) + { + if (my_strcasecmp(system_charset_info, + field_name_array[i], field_name) == 0) + { + my_error(ER_FIELD_NOT_FOUND_PART_ERROR, MYF(0)); + DBUG_RETURN(TRUE); + } + } + fields_handled++; } if (is_list_empty) { === modified file 'sql/table.cc' --- a/sql/table.cc 2010-12-01 11:20:46 +0000 +++ b/sql/table.cc 2011-01-27 22:47:24 +0000 @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright (c) 2000, 2011, 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 No bundle (reason: revision is a merge).