Merge two patches for bug 56895 into tip of mysql-5.1 branch.

This commit is contained in:
John H. Embretsen 2011-01-27 12:38:13 +01:00
commit 9c2370c25a
148 changed files with 630 additions and 206 deletions

View file

@ -416,6 +416,9 @@ int main(int argc,char *argv[])
if (interval) /* --sleep=interval given */
{
if (opt_count_iterations && --nr_iterations == 0)
break;
/*
If connection was dropped (unintentionally, or due to SHUTDOWN),
re-establish it if --wait ("retry-connect") was given and user

View file

@ -2247,6 +2247,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH];
const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, "
"`COLUMN_TYPE` AS `Type`, "
"`IS_NULLABLE` AS `Null`, "
"`COLUMN_KEY` AS `Key`, "
"`COLUMN_DEFAULT` AS `Default`, "
"`EXTRA` AS `Extra`, "
"`COLUMN_COMMENT` AS `Comment` "
"FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE "
"TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'";
FILE *sql_file= md_result_file;
int len;
MYSQL_RES *result;
@ -2514,8 +2523,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(mysql));
my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table);
if (mysql_query_with_error_report(mysql, &result, query_buff))
DBUG_RETURN(0);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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
@ -11,7 +11,7 @@
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
mysqltest
@ -7255,8 +7255,12 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
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
{

View file

@ -1,4 +1,4 @@
# Copyright (C) 2000-2006 MySQL AB
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@ -10,10 +10,9 @@
# 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 Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# 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
## Process this file with automake to create Makefile.in

View file

@ -0,0 +1,43 @@
# ==== Purpose ====
#
# Provide a earier way to restart SQL thread when you want to stop sql thread
# and then start it immediately.
#
# Sources stop_slave_sql.inc to stop SQL thread on the current connection.
# Then issues START SLAVE SQL_THREAD and then waits until
# the SQL threads have started, or until a timeout is reached.
#
# Please use this instead of 'STOP|START SLAVE SQL_THREAD', to reduce the risk of
# test case bugs.
#
#
# ==== Usage ====
#
# [--let $slave_timeout= NUMBER]
# [--let $rpl_debug= 1]
# --source include/restart_slave_sql.inc
#
# Parameters:
# $slave_timeout
# See include/wait_for_slave_param.inc
#
# $rpl_debug
# See include/rpl_init.inc
--let $include_filename= restart_slave.inc
--source include/begin_include_file.inc
if (!$rpl_debug)
{
--disable_query_log
}
source include/stop_slave_sql.inc;
START SLAVE SQL_THREAD;
source include/wait_for_slave_sql_to_start.inc;
--let $include_filename= restart_slave.inc
--source include/end_include_file.inc

View file

@ -0,0 +1,2 @@
let $rpl_connection_name= master;
source include/rpl_connection.inc;

View file

@ -0,0 +1,2 @@
let $rpl_connection_name= slave;
source include/rpl_connection.inc;

View file

@ -0,0 +1,2 @@
let $rpl_connection_name= slave1;
source include/rpl_connection.inc;

View file

@ -45,15 +45,7 @@ if ($rpl_server_parameters)
--source include/rpl_connection.inc
# Write file to make mysql-test-run.pl start up the server again
--let WRITE_TO_FILE= $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
--let WRITE_TO_VAR= $_rpl_start_server_command
perl;
my $file= $ENV{'WRITE_TO_FILE'};
my $var= $ENV{'WRITE_TO_VAR'};
open WRITE_FILE, ">> $file" or die "Error opening $file: $!";
print WRITE_FILE $var, "\n" or die "Error appending to $file: $!";
close WRITE_FILE or die "Error closing $file: $!";
EOF
--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
--source include/rpl_reconnect.inc

View file

@ -44,9 +44,7 @@ if ($rpl_debug)
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
wait
EOF
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it

View file

@ -1,4 +1,20 @@
# -*- cperl -*-
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU 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
package My::ConfigFactory;
use strict;

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,4 +1,19 @@
# -*- cperl -*-
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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
package My::File::Path;
use strict;

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,14 +1,15 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
# This program is 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 General Public License for more details.
# 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,4 +1,4 @@
# Copyright (C) 2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,4 +1,4 @@
# Copyright (C) 2000-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2004 MySQL AB
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008 MySQL AB
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2004 MySQL AB
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,4 +1,18 @@
# -*- cperl -*-
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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
#

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004, 2006 MySQL AB
# Copyright (C) 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004 MySQL AB
# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc.
#
# 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2004-2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,15 +1,16 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU 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 General Public License for more details.
#
# 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
# Copyright (c) 2004, 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2006 MySQL AB
# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2006 MySQL AB
# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# 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

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl
# Copyright (C) 2005, 2006 MySQL AB
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@ -12,10 +12,9 @@
# 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 Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# 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
# ======================================================================
# MySQL server stress test system

View file

@ -13,10 +13,9 @@
# 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 Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# 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
#
##############################################################################
@ -4096,8 +4095,10 @@ sub check_expected_crash_and_restart {
{
mtr_verbose("Crash was expected, file '$expect_file' exists");
for (my $waits = 0; $waits < 50; $waits++)
for (my $waits = 0; $waits < 50; mtr_milli_sleep(100), $waits++)
{
# Race condition seen on Windows: try again until file not empty
next if -z $expect_file;
# If last line in expect file starts with "wait"
# sleep a little and try again, thus allowing the
# test script to control when the server should start
@ -4106,10 +4107,11 @@ sub check_expected_crash_and_restart {
if ($last_line =~ /^wait/ )
{
mtr_verbose("Test says wait before restart") if $waits == 0;
mtr_milli_sleep(100);
next;
}
# Ignore any partial or unknown command
next unless $last_line =~ /^restart/;
# If last line begins "restart:", the rest of the line is read as
# extra command line options to add to the restarted mysqld.
# Anything other than 'wait' or 'restart:' (with a colon) will
@ -4474,6 +4476,8 @@ sub mysqld_start ($$) {
my @all_opts= @$extra_opts;
if (exists $mysqld->{'restart_opts'}) {
push (@all_opts, @{$mysqld->{'restart_opts'}});
mtr_verbose(My::Options::toStr("mysqld_start restart",
@{$mysqld->{'restart_opts'}}));
}
mysqld_arguments($args,$mysqld,\@all_opts);

View file

@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" />
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>

View file

@ -1683,3 +1683,18 @@ ARMENIAN CAPIT DA 2
ARMENIAN CAPIT ECH 2
ARMENIAN CAPIT ZA 2
DROP TABLE t1;
#
# Start of 5.1 tests
#
#
# Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
#
SET NAMES latin1;
DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
AS BINARY(0)) USING utf8);
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'Zpq'
Warning 1292 Truncated incorrect BINARY(0) value: '1.'
#
# End of 5.1 tests
#

View file

@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3);
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
1
DROP TABLE t1, t2;
#
# Bug#59149 valgrind warnings with "like .. escape .." function
#
SELECT '' LIKE '1' ESCAPE COUNT(1);
ERROR HY000: Incorrect arguments to ESCAPE
End of 5.1 tests

View file

@ -2,3 +2,11 @@ mysqld is alive
mysqladmin: unknown variable 'database=db1'
Warning: mysqladmin: unknown variable 'loose-database=db2'
mysqld is alive
#
# Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
#
# Executing mysqladmin with --sleep=1 and --count=2.
# Done.
# Displaying the output :
mysqld is alive
mysqld is alive

View file

@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" Comment="" />
<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
</table_structure>
<table_data name="t1">
@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="b" Type="text" Null="YES" Key="" Extra="" />
<field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="b" Type="text" Null="YES" Key="" Extra="" Comment="" />
<field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" />
<field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@ -1612,10 +1612,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
</database>
</mysqldump>
@ -1623,10 +1623,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
</database>
</mysqldump>
@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" />
<field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" />
<field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" Comment="" />
<field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@ -4576,5 +4576,20 @@ LENGTH(a)
800
DROP TABLE t1, t2;
#
# Bug #13618 : mysqldump --xml ommit comment on table field
#
CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="comment_table">
<field Field="i" Type="int(11)" Null="YES" Key="" Extra="" Comment="FIELD COMMENT" />
</table_structure>
<table_data name="comment_table">
</table_data>
</database>
</mysqldump>
DROP TABLE `comment_table`;
#
# End of 5.1 tests
#

View file

@ -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
#

View file

@ -637,4 +637,15 @@ CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7))
20080729104251.1234560
Warnings:
Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
#
# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
# Day is ZERO
#
CREATE TABLE t1 (dt1 DATETIME);
INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
# Should be empty
SELECT * FROM t1;
dt1
DROP TABLE t1;
End of 5.1 tests

View file

@ -1113,4 +1113,15 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
#
# Bug #44332 my_xml_scan reads behind the end of buffer
#
SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT unexpected (ident or '/' wanted)'
SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1')
NULL
End of 5.1 tests

View file

@ -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,

View file

@ -547,6 +547,13 @@ c128 int,
primary key using hash(c1)) engine=ndb partition by key(c1);
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
#

View file

@ -128,5 +128,47 @@ START SLAVE SQL_THREAD;
include/wait_for_slave_sql_to_start.inc
# Test end
SET GLOBAL debug= '$debug_save';
include/restart_slave.inc
[connection master]
DROP TABLE t1, t2;
# Bug#58546 test rpl_packet timeout failure sporadically on PB
# ----------------------------------------------------------------------
# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
# possible that IO thread stopped after replicating part of a transaction
# which SQL thread was executing. SQL thread would be hung if the
# transaction could not be rolled back safely.
# It caused some sporadic failures on PB2.
#
# This test verifies that when 'STOP SLAVE' is issued by a user, IO
# thread will continue to fetch the rest events of the transaction which
# is being executed by SQL thread and is not able to be rolled back safely.
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1, 1);
SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
[connection slave]
include/restart_slave.inc
BEGIN;
UPDATE t1 SET c2 = 2 WHERE c1 = 1;
[connection master]
BEGIN;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t2 VALUES(1);
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
COMMIT;
[connection slave1]
STOP SLAVE;
[connection slave]
ROLLBACK;
[connection master]
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'RESET';
[connection slave]
include/wait_for_slave_to_stop.inc
[connection slave1]
include/start_slave.inc
[connection master]
DROP TABLE t1, t2;
SET GLOBAL debug= $debug_save;
include/rpl_end.inc

View file

@ -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

View file

@ -26,8 +26,8 @@ let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
sync_slave_with_master;
# Restart slave for setting to take effect
connection slave;
source include/stop_slave.inc;
source include/start_slave.inc;

View file

@ -54,7 +54,69 @@ source extra/rpl_tests/rpl_stop_slave.test;
--echo # Test end
SET GLOBAL debug= '$debug_save';
source include/restart_slave_sql.inc;
connection master;
--source include/rpl_connection_master.inc
DROP TABLE t1, t2;
--echo
--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
--echo # ----------------------------------------------------------------------
--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
--echo # possible that IO thread stopped after replicating part of a transaction
--echo # which SQL thread was executing. SQL thread would be hung if the
--echo # transaction could not be rolled back safely.
--echo # It caused some sporadic failures on PB2.
--echo #
--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
--echo # thread will continue to fetch the rest events of the transaction which
--echo # is being executed by SQL thread and is not able to be rolled back safely.
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1, 1);
let $debug_save= `SELECT @@GLOBAL.debug`;
SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
sync_slave_with_master;
--source include/rpl_connection_slave.inc
source include/restart_slave_sql.inc;
BEGIN;
UPDATE t1 SET c2 = 2 WHERE c1 = 1;
--source include/rpl_connection_master.inc
BEGIN;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t2 VALUES(1);
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
COMMIT;
--source include/rpl_connection_slave1.inc
let $show_statement= SHOW PROCESSLIST;
let $field= Info;
let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
source include/wait_show_condition.inc;
send STOP SLAVE;
--source include/rpl_connection_slave.inc
ROLLBACK;
--source include/rpl_connection_master.inc
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'RESET';
--source include/rpl_connection_slave.inc
source include/wait_for_slave_to_stop.inc;
--source include/rpl_connection_slave1.inc
reap;
source include/start_slave.inc;
--source include/rpl_connection_master.inc
DROP TABLE t1, t2;
SET GLOBAL debug= $debug_save;
--source include/rpl_end.inc

View file

@ -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';

View file

@ -64,12 +64,12 @@ SET last = pct;
END IF;
END WHILE;
END//
CREATE PROCEDURE check_pct(IN num DECIMAL)
CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN)
BEGIN
IF (dirty_pct() < num) THEN
IF (success_on_wait > 0) THEN
SELECT 'BELOW_MAX' AS PCT_VALUE;
ELSE
SELECT 'ABOVE_MAX' AS PCT_VALUE;
SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE;
END IF;
END//
CREATE TABLE t1(
@ -83,7 +83,7 @@ CALL add_until(10);
FLUSH TABLES;
CALL add_records(500);
'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
CALL check_pct(10);
CALL check_pct(1);
PCT_VALUE
BELOW_MAX
DROP PROCEDURE add_records;

View file

@ -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';

View file

@ -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';

View file

@ -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;

View file

@ -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';
#####################################################

View file

@ -117,12 +117,12 @@ BEGIN
END WHILE;
END//
CREATE PROCEDURE check_pct(IN num DECIMAL)
CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN)
BEGIN
IF (dirty_pct() < num) THEN
IF (success_on_wait > 0) THEN
SELECT 'BELOW_MAX' AS PCT_VALUE;
ELSE
SELECT 'ABOVE_MAX' AS PCT_VALUE;
SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE;
END IF;
END//
@ -155,7 +155,8 @@ let $wait_condition= SELECT (dirty_pct() <= @@global.innodb_max_dirty_pages_pct)
--source include/wait_condition.inc
--echo 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
CALL check_pct(10);
# Value For $sucess will be set from include/wait_condition.inc file. It can have values 1 or 0. It will be 1 if dirty_pct() <= @@global.innodb_max_dirty_pages_pct else it will be 0.
eval CALL check_pct($success);
DROP PROCEDURE add_records;
DROP PROCEDURE add_until;
DROP PROCEDURE check_pct;

View file

@ -115,6 +115,7 @@ file_exists $MYSQLTEST_VARDIR/run/mytest.log ;
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;

View file

@ -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;
#####################################################

View file

@ -211,3 +211,19 @@ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f;
DROP TABLE t1;
# End of 4.1 tests
--echo #
--echo # Start of 5.1 tests
--echo #
--echo #
--echo # Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
--echo #
SET NAMES latin1;
DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
AS BINARY(0)) USING utf8);
--echo #
--echo # End of 5.1 tests
--echo #

View file

@ -126,5 +126,10 @@ INSERT INTO t2 VALUES (1), (2), (3);
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
DROP TABLE t1, t2;
--echo #
--echo # Bug#59149 valgrind warnings with "like .. escape .." function
--echo #
--error ER_WRONG_ARGUMENTS
SELECT '' LIKE '1' ESCAPE COUNT(1);
--echo End of 5.1 tests

View file

@ -358,7 +358,7 @@ t1 where object_id=85998;
# Expected result is 36.3310176346905, but IA64 returns 36.3310176346904
# due to fused multiply-add instructions.
--replace_result 36.3310176346904 36.3310176346905
--replace_result 36.3310176346904 36.3310176346905 -114.87787186923326 -114.87787186923313 36.33101763469053 36.33101763469059 36.33101763469043 36.33101763469059
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;

View file

@ -33,3 +33,15 @@ EOF
--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf;
--echo #
--echo # Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
--echo #
--echo # Executing mysqladmin with --sleep=1 and --count=2.
--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --sleep=1 --count=2 ping > $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp
--echo # Done.
--echo # Displaying the output :
--cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp
--remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp

View file

@ -2164,6 +2164,15 @@ SELECT LENGTH(a) FROM t2;
DROP TABLE t1, t2;
###########################################################################
--echo #
--echo # Bug #13618 : mysqldump --xml ommit comment on table field
--echo #
CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
--exec $MYSQL_DUMP --compact --skip-create --xml test
DROP TABLE `comment_table`;
--echo #
--echo # End of 5.1 tests
--echo #

View file

@ -10,6 +10,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
@ -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 #

View file

@ -445,4 +445,15 @@ SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS
# show we truncate microseconds from the right
SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7));
--echo #
--echo # Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
--echo # Day is ZERO
--echo #
CREATE TABLE t1 (dt1 DATETIME);
INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
--echo # Should be empty
SELECT * FROM t1;
DROP TABLE t1;
--echo End of 5.1 tests

View file

@ -640,5 +640,10 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
--error ER_ILLEGAL_VALUE_FOR_TYPE
SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
--echo #
--echo # Bug #44332 my_xml_scan reads behind the end of buffer
--echo #
SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
--echo End of 5.1 tests

View file

@ -1,4 +1,4 @@
# Copyright (C) 2005, 2008 MySQL AB
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@ -10,10 +10,9 @@
# 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 Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# 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
#
# Suppress some common (not fatal) errors in system libraries found by valgrind

View file

@ -913,7 +913,7 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
cache_converted_constant can't be used here because it can't
correctly convert a DATETIME value from string to int representation.
*/
Item_cache_int *cache= new Item_cache_int();
Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
/* Mark the cache as non-const to prevent re-caching. */
cache->set_used_tables(1);
if (!(*a)->is_datetime())

View file

@ -2761,22 +2761,16 @@ String *Item_func_conv_charset::val_str(String *str)
DBUG_ASSERT(fixed == 1);
if (use_cached_value)
return null_value ? 0 : &str_value;
/*
Here we don't pass 'str' as a parameter to args[0]->val_str()
as 'str' may point to 'str_value' (e.g. see Item::save_in_field()),
which we use below to convert string.
Use argument's 'str_value' instead.
*/
String *arg= args[0]->val_str(&args[0]->str_value);
String *arg= args[0]->val_str(str);
uint dummy_errors;
if (!arg)
{
null_value=1;
return 0;
}
null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(),
null_value= tmp_value.copy(arg->ptr(), arg->length(), arg->charset(),
conv_charset, &dummy_errors);
return null_value ? 0 : check_well_formed_result(&str_value);
return null_value ? 0 : check_well_formed_result(&tmp_value);
}
void Item_func_conv_charset::fix_length_and_dec()

View file

@ -713,6 +713,7 @@ public:
class Item_func_conv_charset :public Item_str_func
{
bool use_cached_value;
String tmp_value;
public:
bool safe;
CHARSET_INFO *conv_charset; // keep it public

View file

@ -339,6 +339,7 @@ public:
forced_const= TRUE;
}
virtual bool const_item() const { return forced_const; }
virtual bool const_during_execution() const { return false; }
virtual void print(String *str, enum_query_type query_type);
void fix_num_length_and_dec();

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2003 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
@ -408,17 +408,6 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock)
int error,force_all = (thread_mask & SLAVE_FORCE_ALL);
pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock;
if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL))
{
DBUG_PRINT("info",("Terminating IO thread"));
mi->abort_slave=1;
if ((error=terminate_slave_thread(mi->io_thd, io_lock,
&mi->stop_cond,
&mi->slave_running,
skip_lock)) &&
!force_all)
DBUG_RETURN(error);
}
if (thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL))
{
DBUG_PRINT("info",("Terminating SQL thread"));
@ -430,6 +419,17 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock)
!force_all)
DBUG_RETURN(error);
}
if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL))
{
DBUG_PRINT("info",("Terminating IO thread"));
mi->abort_slave=1;
if ((error=terminate_slave_thread(mi->io_thd, io_lock,
&mi->stop_cond,
&mi->slave_running,
skip_lock)) &&
!force_all)
DBUG_RETURN(error);
}
DBUG_RETURN(0);
}

View file

@ -761,6 +761,9 @@ static bool handle_list_of_fields(List_iterator<char> it,
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_iterator<char> it,
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)
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2006 MySQL AB & Sasha
/* 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
@ -21,6 +21,7 @@
#include "log_event.h"
#include "rpl_filter.h"
#include <my_dir.h>
#include "debug_sync.h"
int max_binlog_dump_events = 0; // unlimited
my_bool opt_sporadic_binlog_dump_fail = 0;
@ -556,6 +557,20 @@ impossible position";
}
#endif
DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
{
if ((*packet)[EVENT_TYPE_OFFSET+1] == XID_EVENT)
{
net_flush(net);
const char act[]=
"now "
"wait_for signal.continue";
DBUG_ASSERT(opt_debug_sync_timeout > 0);
DBUG_ASSERT(!debug_sync_set_action(current_thd,
STRING_WITH_LEN(act)));
}
});
if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
{
binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
@ -572,6 +587,14 @@ impossible position";
goto err;
}
DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
{
if ((*packet)[EVENT_TYPE_OFFSET+1] == XID_EVENT)
{
net_flush(net);
}
});
DBUG_PRINT("info", ("log event code %d",
(*packet)[LOG_EVENT_OFFSET+1] ));
if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002 MySQL AB
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002 MySQL AB
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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
@ -249,7 +249,7 @@ static void
fprint_copyright(FILE *file)
{
fprintf(file,
"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n"
"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\n"
"\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -6,7 +6,7 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
/* Copyright (C) 2000-2007 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002 MySQL AB
/* Copyright (c) 2002, 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2003 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

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2004 MySQL AB
/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2003 MySQL AB
/* Copyright (c) 2003, 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

Some files were not shown because too many files have changed in this diff Show more