Merge mysql-5.1 -> mysql-5.1-innodb

This commit is contained in:
Vasil Dimov 2011-04-21 11:08:05 +03:00
commit b4a98699be
74 changed files with 581 additions and 655 deletions

View File

@ -85,6 +85,7 @@ enum options_client
OPT_SLAP_POST_SYSTEM, OPT_SLAP_POST_SYSTEM,
OPT_SLAP_COMMIT, OPT_SLAP_COMMIT,
OPT_SLAP_DETACH, OPT_SLAP_DETACH,
OPT_SLAP_NO_DROP,
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT_MODE, OPT_SERVER_ID, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT_MODE, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE, OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,

View File

@ -131,7 +131,7 @@ const char *delimiter= "\n";
const char *create_schema_string= "mysqlslap"; const char *create_schema_string= "mysqlslap";
static my_bool opt_preserve= TRUE; static my_bool opt_preserve= TRUE, opt_no_drop= FALSE;
static my_bool debug_info_flag= 0, debug_check_flag= 0; static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool opt_only_print= FALSE; static my_bool opt_only_print= FALSE;
static my_bool opt_compress= FALSE, tty_password= FALSE, static my_bool opt_compress= FALSE, tty_password= FALSE,
@ -599,6 +599,8 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"iterations", 'i', "Number of times to run the tests.", &iterations, {"iterations", 'i', "Number of times to run the tests.", &iterations,
&iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
{"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.",
&opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"number-char-cols", 'x', {"number-char-cols", 'x',
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.", "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
&num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
@ -1147,8 +1149,11 @@ get_options(int *argc,char ***argv)
if (!user) if (!user)
user= (char *)"root"; user= (char *)"root";
/* If something is created we clean it up, otherwise we leave schemas alone */ /*
if (create_string || auto_generate_sql) If something is created and --no-drop is not specified, we drop the
schema.
*/
if (!opt_no_drop && (create_string || auto_generate_sql))
opt_preserve= FALSE; opt_preserve= FALSE;
if (auto_generate_sql && (create_string || user_supplied_query)) if (auto_generate_sql && (create_string || user_supplied_query))

View File

@ -12,7 +12,7 @@ dnl
dnl When changing the major version number please also check the switch dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb. dnl to update version.c in ndb.
AC_INIT([MySQL Server], [5.1.57], [], [mysql]) AC_INIT([MySQL Server], [5.1.58], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM

View File

@ -2,6 +2,8 @@
# in alphabetical order. This also helps with merge conflict resolution. # in alphabetical order. This also helps with merge conflict resolution.
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
binlog.binlog_bug23533 # skozlov: BUG#12371924
funcs_1.charset_collation_1 # depends on compile-time decisions funcs_1.charset_collation_1 # depends on compile-time decisions
funcs_1.is_cml_ndb # joro : NDB tests marked as experimental as agreed with bochklin funcs_1.is_cml_ndb # joro : NDB tests marked as experimental as agreed with bochklin
@ -22,7 +24,8 @@ main.outfile_loaddata @solaris # joro : Bug #46895
ndb.* # joro : NDB tests marked as experimental as agreed with bochklin ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
rpl.rpl_innodb_bug28430 @solaris # Bug#46029 rpl.rpl_innodb_bug28430 @solaris # Bug#46029
rpl.rpl_row_sp011 @solaris # Joro : Bug #54138 rpl.rpl_row_sp011 @solaris # Joro : Bug #45445
rpl.rpl_stop_slave # Sven : BUG#12345981
rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin
rpl_ndb.rpl_ndb_log # Bug#38998 rpl_ndb.rpl_ndb_log # Bug#38998

View File

@ -122,10 +122,14 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
#connection slave; #connection slave;
--disable_query_log
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091"); call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* Error_code: 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054"); call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* Error_code: 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072"); call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* Error_code: 1072");
call mtr.add_suppression("Slave I/O: Get master clock failed with error:.* Error_code: 2013");
call mtr.add_suppression("Slave I/O: Get master SERVER_ID failed with error:.* Error_code: 2013");
--enable_query_log
sync_slave_with_master; sync_slave_with_master;
--echo --echo

View File

@ -634,6 +634,10 @@ drop table t1;
drop table bug29807; drop table bug29807;
create table bug29807 (a int); create table bug29807 (a int);
drop table bug29807; drop table bug29807;
--disable_query_log
call mtr.add_suppression("InnoDB: Error: table .test...bug29807. does not exist in the InnoDB internal");
call mtr.add_suppression("Cannot find or open table test\/bug29807 from");
--enable_query_log
# #

View File

@ -53,7 +53,7 @@ END
-- Insert patterns that should always be suppressed -- Insert patterns that should always be suppressed
-- --
INSERT INTO global_suppressions VALUES INSERT INTO global_suppressions VALUES
("'SELECT UNIX_TIMESTAMP\\(\\)' failed on master"), (".SELECT UNIX_TIMESTAMP... failed on master"),
("Aborted connection"), ("Aborted connection"),
("Client requested master to start replication from impossible position"), ("Client requested master to start replication from impossible position"),
("Could not find first log file name in binary log"), ("Could not find first log file name in binary log"),
@ -110,7 +110,6 @@ INSERT INTO global_suppressions VALUES
("Sort aborted"), ("Sort aborted"),
("Time-out in NDB"), ("Time-out in NDB"),
("Warning:\s+One can only use the --user.*root"), ("Warning:\s+One can only use the --user.*root"),
("Warning:\s+Setting lower_case_table_names=2"),
("Warning:\s+Table:.* on (delete|rename)"), ("Warning:\s+Table:.* on (delete|rename)"),
("You have an error in your SQL syntax"), ("You have an error in your SQL syntax"),
("deprecated"), ("deprecated"),
@ -123,55 +122,21 @@ INSERT INTO global_suppressions VALUES
("slave SQL thread aborted"), ("slave SQL thread aborted"),
("Slave: .*Duplicate entry"), ("Slave: .*Duplicate entry"),
/*
Special case, made as specific as possible, for:
Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
server coredump
*/
("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
("Statement may not be safe to log in statement format"), ("Statement may not be safe to log in statement format"),
/* test case for Bug#bug29807 copies a stray frm into database */
("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
("Cannot find or open table test\/bug29807 from"),
/* innodb foreign key tests that fail in ALTER or RENAME produce this */ /* innodb foreign key tests that fail in ALTER or RENAME produce this */
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"), ("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"), ("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"), ("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"),
/* Test case for Bug#14233 produces the following warnings: */
("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"),
("Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc"),
("Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc"),
/* /*
BUG#32080 - Excessive warnings on Solaris: setrlimit could not BUG#32080 - Excessive warnings on Solaris: setrlimit could not
change the size of core files change the size of core files
*/ */
("setrlimit could not change the size of core files to 'infinity'"), ("setrlimit could not change the size of core files to 'infinity'"),
/*
rpl_extrColmaster_*.test, the slave thread produces warnings
when it get updates to a table that has more columns on the
master
*/
("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
("Slave: Can't DROP 'c7'.* 1091"),
("Slave: Key column 'c6'.* 1072"),
("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."), ("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
(".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"),
/* Test case for Bug#31590 in order_by.test produces the following error */
("Out of sort memory; increase server sort buffer size"),
/* Special case for Bug #26402 in show_check.test
- Question marks are not valid file name parts on Windows. Ignore
this error message.
*/
("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
("Slave: Unknown table 't1' Error_code: 1051"), ("Slave: Unknown table 't1' Error_code: 1051"),
/* Messages from valgrind */ /* Messages from valgrind */
@ -189,15 +154,6 @@ INSERT INTO global_suppressions VALUES
("==[0-9]*== Warning: invalid file descriptor -1 in syscall write()"), ("==[0-9]*== Warning: invalid file descriptor -1 in syscall write()"),
("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"), ("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"),
/*
Transient network failures that cause warnings on reconnect.
BUG#47743 and BUG#47983.
*/
("Slave I/O: Get master SERVER_ID failed with error:.*"),
("Slave I/O: Get master clock failed with error:.*"),
("Slave I/O: Get master COLLATION_SERVER failed with error:.*"),
("Slave I/O: Get master TIME_ZONE failed with error:.*"),
("THE_LAST_SUPPRESSION")|| ("THE_LAST_SUPPRESSION")||

View File

@ -1,5 +1,5 @@
# -*- cperl -*- # -*- cperl -*-
# Copyright (C) 2008 MySQL AB # Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -28,8 +28,6 @@ use My::Platform;
use base qw(Exporter); use base qw(Exporter);
our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED); our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED);
our $vs_config_dir;
my $bin_extension= ".exe" if IS_WINDOWS; my $bin_extension= ".exe" if IS_WINDOWS;
# Helper function to be used for fourth parameter to find functions # Helper function to be used for fourth parameter to find functions
@ -158,7 +156,7 @@ sub my_find_paths {
# User can select to look in a special build dir # User can select to look in a special build dir
# which is a subdirectory of any of the paths # which is a subdirectory of any of the paths
my @extra_dirs; my @extra_dirs;
my $build_dir= $vs_config_dir || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR}; my $build_dir= $::opt_vs_config || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
push(@extra_dirs, $build_dir) if defined $build_dir; push(@extra_dirs, $build_dir) if defined $build_dir;
if (defined $extension){ if (defined $extension){

View File

@ -1,7 +1,7 @@
#!/usr/bin/perl #!/usr/bin/perl
# -*- cperl -*- # -*- cperl -*-
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public # modify it under the terms of the GNU Library General Public
@ -893,7 +893,7 @@ sub command_line_setup {
'ssl|with-openssl' => \$opt_ssl, 'ssl|with-openssl' => \$opt_ssl,
'skip-ssl' => \$opt_skip_ssl, 'skip-ssl' => \$opt_skip_ssl,
'compress' => \$opt_compress, 'compress' => \$opt_compress,
'vs-config' => \$opt_vs_config, 'vs-config=s' => \$opt_vs_config,
# Max number of parallel threads to use # Max number of parallel threads to use
'parallel=s' => \$opt_parallel, 'parallel=s' => \$opt_parallel,
@ -1123,7 +1123,7 @@ sub command_line_setup {
chomp; chomp;
# remove comments (# foo) at the beginning of the line, or after a # remove comments (# foo) at the beginning of the line, or after a
# blank at the end of the line # blank at the end of the line
s/( +|^)#.*$//; s/(\s+|^)#.*$//;
# If @ platform specifier given, use this entry only if it contains # If @ platform specifier given, use this entry only if it contains
# @<platform> or @!<xxx> where xxx != platform # @<platform> or @!<xxx> where xxx != platform
if (/\@.*/) if (/\@.*/)
@ -1134,8 +1134,8 @@ sub command_line_setup {
s/\@.*$//; s/\@.*$//;
} }
# remove whitespace # remove whitespace
s/^ +//; s/^\s+//;
s/ +$//; s/\s+$//;
# if nothing left, don't need to remember this line # if nothing left, don't need to remember this line
if ( $_ eq "" ) { if ( $_ eq "" ) {
next; next;

View File

@ -135,4 +135,17 @@ SELECT * FROM t1 PROCEDURE ANALYSE();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL
DROP TABLE t1; DROP TABLE t1;
#
# Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
#
CREATE TABLE t1(f1 INT) ENGINE=MYISAM;
CREATE TABLE t2(f2 INT) ENGINE=INNODB;
INSERT INTO t2 VALUES (1);
SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.f1 NULL NULL 0 0 0 1 0.0 0.0 CHAR(0)
SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t2.f2 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL
DROP TABLE t1, t2;
End of 5.1 tests End of 5.1 tests

View File

@ -44,6 +44,7 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('in
master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293 master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293
master-bin.000001 # Query # # use `test`; DROP TABLE t4 master-bin.000001 # Query # # use `test`; DROP TABLE t4
End of 5.0 tests End of 5.0 tests
call mtr.add_suppression("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49");
SHOW BINLOG EVENTS FROM 365; SHOW BINLOG EVENTS FROM 365;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.

View File

@ -1746,4 +1746,15 @@ MAX(LENGTH(a)) LENGTH(MAX(a)) MIN(a) MAX(a) CONCAT(MIN(a)) CONCAT(MAX(a))
20 20 18446668621106209655 18446668621106209655 18446668621106209655 18446668621106209655 20 20 18446668621106209655 18446668621106209655 18446668621106209655 18446668621106209655
DROP TABLE t1; DROP TABLE t1;
# #
# Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION
#
CREATE TABLE t1(f1 YEAR(4));
INSERT INTO t1 VALUES (0000),(2001);
(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1);
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def MAX(f1) MAX(f1) 13 4 4 Y 32864 0 63
MAX(f1)
2001
DROP TABLE t1;
#
End of 5.1 tests End of 5.1 tests

View File

@ -770,4 +770,10 @@ CASE a WHEN a THEN a END
NULL NULL
DROP TABLE t1; DROP TABLE t1;
# #
# Bug #11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS
#
SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1)
1
#
End of 5.1 tests End of 5.1 tests

View File

@ -518,4 +518,26 @@ CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL);
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL);
DROP TABLE t1; DROP TABLE t1;
#
# Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF DECIMAL COLUMN FUNCTION
#
CREATE TABLE t1(f1 DECIMAL(22,1));
INSERT INTO t1 VALUES (0),(1);
SELECT ROUND(f1, f1) FROM t1;
ROUND(f1, f1)
0.0
1.0
SELECT ROUND(f1, f1) FROM t1 GROUP BY 1;
ROUND(f1, f1)
0.0
1.0
DROP TABLE t1;
#
# Bug#11764671 57533: UNINITIALISED VALUES IN COPY_AND_CONVERT (SQL_STRING.CC) WITH CERTAIN CHA
#
SELECT ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'));
ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'))
-4939092.0000
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
End of 5.1 tests End of 5.1 tests

View File

@ -532,4 +532,11 @@ a
0 0
1 1
DROP TABLE t1; DROP TABLE t1;
#
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
#
CREATE TABLE t1(f1 INT);
SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests

View File

@ -175,3 +175,33 @@ TABLE_SCHEMA TABLE_NAME
mysqltest_lc2 myUC mysqltest_lc2 myUC
use test; use test;
drop database mysqltest_LC2; drop database mysqltest_LC2;
#
# Bug #11758687: 50924: object names not resolved correctly
# on lctn2 systems
#
CREATE DATABASE BUP_XPFM_COMPAT_DB2;
CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1;
CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1;
CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1;
CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT
ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW
update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
|
CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT
ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW
update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
|
CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT
ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW
update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
|
SELECT trigger_schema, trigger_name, event_object_table FROM
INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2'
ORDER BY trigger_schema, trigger_name;
trigger_schema trigger_name event_object_table
BUP_XPFM_COMPAT_DB2 trigger1 table1
BUP_XPFM_COMPAT_DB2 TRIGGER2 TABLE2
BUP_XPFM_COMPAT_DB2 TrigGer3 table3
DROP DATABASE BUP_XPFM_COMPAT_DB2;
End of 5.1 tests

View File

@ -225,3 +225,23 @@ DROP SCHEMA IF EXISTS `mysqlslap`;
DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p1;
CREATE PROCEDURE p1() SELECT 1; CREATE PROCEDURE p1() SELECT 1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
#
# Bug #11765157 - 58090: mysqlslap drops schema specified in
# create_schema if auto-generate-sql also set.
#
# 'bug58090' database should not be present.
SHOW DATABASES;
Database
information_schema
mtr
mysql
test
# 'bug58090' database should be present.
SHOW DATABASES;
Database
information_schema
bug58090
mtr
mysql
test
DROP DATABASE bug58090;

View File

@ -1428,6 +1428,7 @@ set session max_sort_length= 2180;
select * from t1 order by b; select * from t1 order by b;
ERROR HY001: Out of sort memory; increase server sort buffer size ERROR HY001: Out of sort memory; increase server sort buffer size
drop table t1; drop table t1;
call mtr.add_suppression("Out of sort memory; increase server sort buffer size");
# #
# Bug #39844: Query Crash Mysql Server 5.0.67 # Bug #39844: Query Crash Mysql Server 5.0.67
# #

View File

@ -1339,6 +1339,7 @@ drop table `été`;
set names latin1; set names latin1;
show columns from `#mysql50#????????`; show columns from `#mysql50#????????`;
Got one of the listed errors Got one of the listed errors
call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'");
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p1;
CREATE TABLE t1(c1 INT); CREATE TABLE t1(c1 INT);

View File

@ -1,4 +1,5 @@
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted"); call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc");
use test; use test;
drop procedure if exists bug14233; drop procedure if exists bug14233;
drop function if exists bug14233; drop function if exists bug14233;

View File

@ -4734,3 +4734,21 @@ SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2; DROP TABLE t1,t2;
End of 5.1 tests End of 5.1 tests
#
# Bug #11765713 58705:
# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
# CREATED BY OPT_SUM_QUERY
#
CREATE TABLE t1(a INT NOT NULL, KEY (a));
INSERT INTO t1 VALUES (0), (1);
SELECT 1 as foo FROM t1 WHERE a < SOME
(SELECT a FROM t1 WHERE a <=>
(SELECT a FROM t1)
);
ERROR 21000: Subquery returns more than 1 row
SELECT 1 as foo FROM t1 WHERE a < SOME
(SELECT a FROM t1 WHERE a <=>
(SELECT a FROM t1 where a is null)
);
foo
DROP TABLE t1;

View File

@ -547,4 +547,67 @@ a
2000-01-01 00:00:01 2000-01-01 00:00:01
2000-01-01 00:00:01 2000-01-01 00:00:01
DROP TABLE t1; DROP TABLE t1;
#
# Bug#50774: failed to get the correct resultset when timestamp values
# are appended with .0
#
CREATE TABLE t1 ( a TIMESTAMP, KEY ( a ) );
INSERT INTO t1 VALUES( '2010-02-01 09:31:01' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:02' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:03' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:04' );
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:02
2010-02-01 09:31:03
2010-02-01 09:31:04
SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' <= a;
a
2010-02-01 09:31:02
2010-02-01 09:31:03
2010-02-01 09:31:04
SELECT * FROM t1 WHERE a <= '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:01
2010-02-01 09:31:02
SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' >= a;
a
2010-02-01 09:31:01
2010-02-01 09:31:02
EXPLAIN
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
id select_type table type possible_keys key key_len ref rows Extra
x x x range x x x x x x
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:02
2010-02-01 09:31:03
2010-02-01 09:31:04
CREATE TABLE t2 ( a TIMESTAMP, KEY ( a DESC ) );
INSERT INTO t2 VALUES( '2010-02-01 09:31:01' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:02' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:03' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:04' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:05' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:06' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:07' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:08' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:09' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:10' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:11' );
# The bug would cause the range optimizer's comparison to use an open
# interval here. This reveals itself only in the number of reads
# performed.
FLUSH STATUS;
EXPLAIN
SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
id select_type table type possible_keys key key_len ref rows Extra
x x x range x x x x x x
SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
a
2010-02-01 09:31:01
SHOW STATUS LIKE 'Handler_read_next';
Variable_name Value
Handler_read_next 1
DROP TABLE t1, t2;
End of 5.1 tests End of 5.1 tests

View File

@ -3897,6 +3897,15 @@ DROP TABLE t1;
# #
CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f;
DROP VIEW v1; DROP VIEW v1;
#
# Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
#
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a;
SELECT * FROM v1;
a
DROP VIEW v1;
DROP TABLE t1;
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- End of 5.1 tests. # -- End of 5.1 tests.
# ----------------------------------------------------------------- # -----------------------------------------------------------------

View File

@ -0,0 +1,19 @@
SET AUTOCOMMIT=0;
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
SELECT COUNT(*) FROM t1;
COUNT(*)
1000
SET @saved_binlog_cache_size=@@binlog_cache_size;
SET @saved_max_binlog_cache_size=@@max_binlog_cache_size;
SET GLOBAL binlog_cache_size=4096;
SET GLOBAL max_binlog_cache_size=4096;
START TRANSACTION;
CREATE TABLE t2 SELECT * FROM t1;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
COMMIT;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
SET GLOBAL max_binlog_cache_size=@saved_max_binlog_cache_size;
SET GLOBAL binlog_cache_size=@saved_binlog_cache_size;
DROP TABLE t1;

View File

@ -0,0 +1,10 @@
CREATE TABLE t1(id INT);
SHOW TABLES;
Tables_in_test
t1
FLUSH LOGS;
DROP TABLE t1;
SHOW TABLES;
Tables_in_test
t1
DROP TABLE t1;

View File

@ -4,33 +4,39 @@
############################################################# #############################################################
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc --source include/have_binlog_format_row.inc
--source include/master-slave.inc
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
SET GLOBAL max_binlog_cache_size=4096;
SHOW VARIABLES LIKE 'max_binlog_cache_size';
# Create 1st table
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
--disable_query_log --disable_query_log
let $i= 1000; let $i= 1000;
while ($i) while ($i)
{ {
BEGIN;
eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096)); eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
COMMIT;
dec $i; dec $i;
} }
--enable_query_log --enable_query_log
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
# Set small value for max_binlog_cache_size
SET @saved_binlog_cache_size=@@binlog_cache_size;
SET @saved_max_binlog_cache_size=@@max_binlog_cache_size;
SET GLOBAL binlog_cache_size=4096;
SET GLOBAL max_binlog_cache_size=4096;
# Copied data from t1 into t2 large than max_binlog_cache_size # Copied data from t1 into t2 large than max_binlog_cache_size
START TRANSACTION; START TRANSACTION;
--error 1534 --error 1197
CREATE TABLE t2 SELECT * FROM t1; CREATE TABLE t2 SELECT * FROM t1;
COMMIT; COMMIT;
SHOW TABLES LIKE 't%'; SHOW TABLES LIKE 't%';
# 5.1 End of Test # 5.1 End of Test
--source include/rpl_end.inc SET GLOBAL max_binlog_cache_size=@saved_max_binlog_cache_size;
SET GLOBAL binlog_cache_size=@saved_binlog_cache_size;
DROP TABLE t1;

View File

@ -13,17 +13,18 @@
# #
# #
--source include/master-slave.inc --source include/have_log_bin.inc
--source include/have_binlog_format_mixed.inc
create table t1(id int); CREATE TABLE t1(id INT);
let $binlog= query_get_value(SHOW MASTER STATUS, File, 1);
let $binlog_path= `SELECT CONCAT(@@DATADIR, '$binlog')`;
SHOW TABLES;
FLUSH LOGS;
DROP TABLE t1;
show tables; --exec $MYSQL_BINLOG $binlog_path | $MYSQL test
SHOW TABLES;
--source include/show_master_status.inc # Clean up
DROP TABLE t1;
flush logs;
--exec $MYSQL_BINLOG $MYSQL_TEST_DIR/var/log/master-bin.000001 | $MYSQL test
drop table t1;
--source include/rpl_end.inc

View File

@ -1,8 +0,0 @@
[row]
binlog-format=row
[stmt]
binlog-format=statement
[mix]
binlog-format=mixed

View File

@ -1,3 +0,0 @@
a
b
c

View File

@ -1,33 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** On Master ****
CREATE TABLE t1 (b CHAR(10));
**** On Slave ****
STOP SLAVE;
**** On Master ****
LOAD DATA INFILE FILENAME
SELECT COUNT(*) FROM t1;
COUNT(*)
3
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (b CHAR(10))
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`b`) ;file_id=#
**** On Slave ****
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
**** On Master ****
DROP TABLE t1;

View File

@ -1,23 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS t1,t2;
SET AUTOCOMMIT=0;
SET GLOBAL max_binlog_cache_size=4096;
SHOW VARIABLES LIKE 'max_binlog_cache_size';
Variable_name Value
max_binlog_cache_size 4096
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
SELECT COUNT(*) FROM t1;
COUNT(*)
1000
START TRANSACTION;
CREATE TABLE t2 SELECT * FROM t1;
ERROR HY000: Writing one row to the row-based binary log failed
COMMIT;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1

View File

@ -1,16 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a');
UPDATE t1 SET a = 'MyISAM';
SELECT * FROM t1 ORDER BY a;
a
MyISAM
SELECT * FROM t1 ORDER BY a;
a
MyISAM
DROP TABLE t1;

View File

@ -1,16 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 ( a INT, b INT DEFAULT -3 );
INSERT INTO t1 VALUES (1, DEFAULT);
UPDATE t1 SET a = 3;
SELECT * FROM t1 ORDER BY a;
a b
3 -3
SELECT * FROM t1 ORDER BY a;
a b
3 -3
DROP TABLE t1;

View File

@ -1,15 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table `t1` (`id` int not null auto_increment primary key);
create trigger `trg` before insert on `t1` for each row begin end;
set @@global.debug="+d,simulate_bug33029";
stop slave;
start slave;
insert into `t1` values ();
select * from t1;
id
1

View File

@ -1,18 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1(id int);
show tables;
Tables_in_test
t1
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
flush logs;
drop table t1;

View File

@ -1,17 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE char128_utf8 (
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
SELECT * FROM char128_utf8;
i1 c i2
1 123 1
SELECT * FROM char128_utf8;
i1 c i2
1 123 1

View File

@ -1,56 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
begin;
insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
begin;
insert into t1i values (5);
begin;
insert into t1i values (4);
insert into t2m values (1);
update t1i set n = 5 where n = 4;
commit;
zero
0
*** kill sql thread ***
rollback;
*** sql thread is *not* running: No ***
*** the prove: the killed slave has not finished the current transaction ***
three
3
one
1
zero
0
delete from t2m;
start slave sql_thread;
delete from t1i;
delete from t2m;
begin;
insert into t1i values (5);
begin;
insert into t1i values (4);
update t1i set n = 5 where n = 4;
commit;
zero
0
stop slave sql_thread;
rollback;
*** sql thread is *not* running: No ***
*** the prove: the stopped slave has rolled back the current transaction ***
zero
0
zero
0
one
1
start slave sql_thread;
drop table t1i, t2m;

View File

@ -1,49 +0,0 @@
# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER
--source include/master-slave.inc
--connection master
--source include/have_binlog_format_mixed_or_statement.inc
--echo
--echo **** On Master ****
CREATE TABLE t1 (b CHAR(10));
--echo
--echo **** On Slave ****
--sync_slave_with_master
STOP SLAVE;
--source include/wait_for_slave_to_stop.inc
--connection master
--echo
--echo **** On Master ****
--exec cp $MYSQL_TEST_DIR/suite/bugs/data/rpl_bug12691.dat $MYSQLTEST_VARDIR/tmp/
--echo LOAD DATA INFILE FILENAME
--disable_query_log
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE t1 FIELDS TERMINATED BY '|'
--enable_query_log
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat
SELECT COUNT(*) FROM t1;
source include/show_binlog_events.inc;
--save_master_pos
--connection slave
--echo
--echo **** On Slave ****
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
--source include/wait_for_slave_to_start.inc
--sync_with_master
SELECT COUNT(*) FROM t1;
# Clean up
--connection master
--echo
--echo **** On Master ****
DROP TABLE t1;
--source include/rpl_end.inc

View File

@ -1,25 +0,0 @@
# BUG#31582: 5.1-telco-6.1 -> 5.1.22. Slave crashes when reading
# UPDATE for VARCHAR
# This is a problem for any update statement replicating from an old
# server to a new server. The bug consisted of a new slave trying to
# read two column bitmaps, but there is only one available in the old
# format.
# This test case should be executed replicating from an old server to
# a new server, so make sure you have one handy.
source include/master-slave.inc;
CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a');
UPDATE t1 SET a = 'MyISAM';
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
DROP TABLE t1;
--source include/rpl_end.inc

View File

@ -1,25 +0,0 @@
#
# BUG#31583: 5.1-telco-6.1 -> 5.1.22. Slave returns Error in unknown event
# This is a problem for any update statement replicating from an old
# server to a new server. The bug consisted of a new slave trying to
# read two column bitmaps, but there is only one available in the old
# format.
# This test case should be executed replicating from an old server to
# a new server, so make sure you have one handy.
source include/master-slave.inc;
CREATE TABLE t1 ( a INT, b INT DEFAULT -3 );
INSERT INTO t1 VALUES (1, DEFAULT);
UPDATE t1 SET a = 3;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
DROP TABLE t1;
--source include/rpl_end.inc

View File

@ -1,26 +0,0 @@
#
# Bug #36443 Server crashes when executing insert when insert trigger on table
#
# Emulating the former bug#33029 situation to see that there is no crash anymore.
#
source include/master-slave.inc;
create table `t1` (`id` int not null auto_increment primary key);
create trigger `trg` before insert on `t1` for each row begin end;
sync_slave_with_master;
set @@global.debug="+d,simulate_bug33029";
stop slave;
start slave;
connection master;
insert into `t1` values ();
sync_slave_with_master;
select * from t1;
--source include/rpl_end.inc

View File

@ -1,166 +0,0 @@
#
# Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY
# Bug#319 if while a non-transactional slave is replicating a transaction possible problem
#
# Verifying the fact that STOP SLAVE in the middle of a group execution waits
# for the end of the group before the slave sql thread will stop.
# The patch refines STOP SLAVE to not interrupt a transaction or other type of
# the replication events group (the part I).
# Killing the sql thread continues to provide a "hard" stop (the part II).
#
# Non-deterministic tests
#
source include/master-slave.inc;
source include/have_innodb.inc;
#
# Part II, killed sql slave leaves instantly
#
# A. multi-statement transaction as the replication group
connection master;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
sync_slave_with_master;
connection master;
begin;
insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
sync_slave_with_master;
#
# todo: first challenge is to find out the SQL thread id
# the following is not fully reliable
#
let $id=`SELECT id from information_schema.processlist where user like 'system user' and state like '%Has read all relay log%' or user like 'system user' and state like '%Reading event from the relay log%'`;
connection slave;
begin;
insert into t1i values (5);
connection master;
let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
begin;
insert into t1i values (4);
insert into t2m values (1); # non-ta update
update t1i set n = 5 where n = 4; # to block at. can't be played with killed
commit;
let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
connection slave;
# slave sql thread must be locked out by the conn `slave' explicit lock
let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--disable_query_log
eval select $pos0_master - $pos0_slave as zero;
--enable_query_log
connection slave1;
let $count= 1;
let $table= t2m;
source include/wait_until_rows_count.inc;
#
# todo: may fail as said above
#
--echo *** kill sql thread ***
--disable_query_log
eval kill connection $id;
--enable_query_log
connection slave;
rollback; # release the sql thread
connection slave1;
source include/wait_for_slave_sql_to_stop.inc;
let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
--echo *** sql thread is *not* running: $sql_status ***
let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
connection slave;
--echo *** the prove: the killed slave has not finished the current transaction ***
--disable_query_log
select count(*) as three from t1i;
eval select $pos1_master > $pos1_slave as one;
eval select $pos1_slave - $pos0_slave as zero;
--enable_query_log
delete from t2m; # remove the row to be able to replay
start slave sql_thread;
#
# Part I: B The homogenous transaction remains interuptable in between
#
connection master;
delete from t1i;
delete from t2m;
sync_slave_with_master;
begin;
insert into t1i values (5);
connection master;
let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
begin;
insert into t1i values (4);
update t1i set n = 5 where n = 4; # to block at. not to be played
commit;
let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
connection slave1;
# slave sql can't advance as must be locked by the conn `slave' trans
let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--disable_query_log
eval select $pos0_master - $pos0_slave as zero;
--enable_query_log
#
# the replicated trans is blocked by the slave's local.
# However, it's not easy to catch the exact moment when it happens.
# The test issues sleep which makes the test either non-deterministic or
# wasting too much time.
#
--sleep 3
send stop slave sql_thread;
connection slave;
rollback; # release the sql thread
connection slave1;
reap;
source include/wait_for_slave_sql_to_stop.inc;
let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
--echo *** sql thread is *not* running: $sql_status ***
let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
--echo *** the prove: the stopped slave has rolled back the current transaction ***
--disable_query_log
select count(*) as zero from t1i;
eval select $pos0_master - $pos0_slave as zero;
eval select $pos1_master > $pos0_slave as one;
--enable_query_log
start slave sql_thread;
# clean-up
connection master;
drop table t1i, t2m;
--source include/rpl_end.inc

View File

@ -0,0 +1,12 @@
include/master-slave.inc
[connection master]
CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
SELECT * FROM char128_utf8;
i1 c i2
1 123 1
SELECT * FROM char128_utf8;
i1 c i2
1 123 1
DROP TABLE char128_utf8;
include/rpl_end.inc

View File

@ -58,10 +58,6 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *
@ -933,10 +929,6 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *
@ -1808,10 +1800,6 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *

View File

@ -58,10 +58,6 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *
@ -933,10 +929,6 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *
@ -1808,10 +1800,6 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave SQL.*Error .Can.t DROP .c7.; check that column.key exists. on query.* 1091");
call mtr.add_suppression("Slave SQL.*Error .Unknown column .c7. in .t15.. on query.* 1054");
call mtr.add_suppression("Slave SQL.*Error .Key column .c6. doesn.t exist in table. on query.* 1072");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *

View File

@ -7,15 +7,16 @@ source include/master-slave.inc;
source include/have_binlog_format_row.inc; source include/have_binlog_format_row.inc;
connection master; connection master;
CREATE TABLE char128_utf8 ( CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
i2 INT NOT NULL);
INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
SELECT * FROM char128_utf8; SELECT * FROM char128_utf8;
sync_slave_with_master; sync_slave_with_master;
SELECT * FROM char128_utf8; SELECT * FROM char128_utf8;
# Clean up
connection master;
DROP TABLE char128_utf8;
sync_slave_with_master;
--source include/rpl_end.inc --source include/rpl_end.inc

View File

@ -1,6 +1,7 @@
# #
# Test of procedure analyse # Test of procedure analyse
# #
-- source include/have_innodb.inc
--disable_warnings --disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
@ -144,4 +145,15 @@ INSERT INTO t1 VALUES ('e'),('e'),('e-');
SELECT * FROM t1 PROCEDURE ANALYSE(); SELECT * FROM t1 PROCEDURE ANALYSE();
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
--echo #
CREATE TABLE t1(f1 INT) ENGINE=MYISAM;
CREATE TABLE t2(f2 INT) ENGINE=INNODB;
INSERT INTO t2 VALUES (1);
SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE();
SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE();
DROP TABLE t1, t2;
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -33,6 +33,8 @@ delimiter ;|
# Note: 364 is a magic position (found experimentally, depends on # Note: 364 is a magic position (found experimentally, depends on
# the log's contents) that caused the server crash. # the log's contents) that caused the server crash.
call mtr.add_suppression("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49");
--error 1220 --error 1220
SHOW BINLOG EVENTS FROM 365; SHOW BINLOG EVENTS FROM 365;

View File

@ -1127,6 +1127,18 @@ INSERT INTO t1 VALUES (18446668621106209655);
SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1; SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION
--echo #
CREATE TABLE t1(f1 YEAR(4));
INSERT INTO t1 VALUES (0000),(2001);
--enable_metadata
(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1);
--disable_metadata
DROP TABLE t1;
--echo # --echo #
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -554,6 +554,12 @@ SELECT CASE a WHEN a THEN a END FROM t1 GROUP BY a WITH ROLLUP;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug #11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS
--echo #
SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
--echo # --echo #
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -333,4 +333,20 @@ DROP TABLE t1;
CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL); CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL);
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF DECIMAL COLUMN FUNCTION
--echo #
CREATE TABLE t1(f1 DECIMAL(22,1));
INSERT INTO t1 VALUES (0),(1);
SELECT ROUND(f1, f1) FROM t1;
SELECT ROUND(f1, f1) FROM t1 GROUP BY 1;
DROP TABLE t1;
--echo #
--echo # Bug#11764671 57533: UNINITIALISED VALUES IN COPY_AND_CONVERT (SQL_STRING.CC) WITH CERTAIN CHA
--echo #
SELECT ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'));
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -611,5 +611,18 @@ DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/tmpp2.txt; remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
--echo #
--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
--echo #
CREATE TABLE t1(f1 INT);
EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
--disable_warnings
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
--enable_warnings
DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.dat;
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -150,3 +150,40 @@ select TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES
where TABLE_SCHEMA ='mysqltest_LC2'; where TABLE_SCHEMA ='mysqltest_LC2';
use test; use test;
drop database mysqltest_LC2; drop database mysqltest_LC2;
--echo #
--echo # Bug #11758687: 50924: object names not resolved correctly
--echo # on lctn2 systems
--echo #
CREATE DATABASE BUP_XPFM_COMPAT_DB2;
CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1;
CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1;
CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1;
delimiter |;
#
CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT
ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW
update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
|
CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT
ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW
update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
|
CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT
ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW
update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
|
delimiter ;|
SELECT trigger_schema, trigger_name, event_object_table FROM
INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2'
ORDER BY trigger_schema, trigger_name;
DROP DATABASE BUP_XPFM_COMPAT_DB2;
--echo End of 5.1 tests

View File

@ -53,3 +53,18 @@ CREATE PROCEDURE p1() SELECT 1;
--exec $MYSQL_SLAP --create-schema=test --delimiter=";" --query="CALL p1; SELECT 1;" --silent 2>&1 --exec $MYSQL_SLAP --create-schema=test --delimiter=";" --query="CALL p1; SELECT 1;" --silent 2>&1
DROP PROCEDURE p1; DROP PROCEDURE p1;
--echo #
--echo # Bug #11765157 - 58090: mysqlslap drops schema specified in
--echo # create_schema if auto-generate-sql also set.
--echo #
--exec $MYSQL_SLAP --silent --create-schema=bug58090 --concurrency=5 --iterations=20 --auto-generate-sql
--echo # 'bug58090' database should not be present.
SHOW DATABASES;
--exec $MYSQL_SLAP --silent --create-schema=bug58090 --no-drop --auto-generate-sql
--echo # 'bug58090' database should be present.
SHOW DATABASES;
DROP DATABASE bug58090;

View File

@ -846,8 +846,7 @@ set session max_sort_length= 2180;
--error 1038 --error 1038
select * from t1 order by b; select * from t1 order by b;
drop table t1; drop table t1;
call mtr.add_suppression("Out of sort memory; increase server sort buffer size");
--echo # --echo #
--echo # Bug #39844: Query Crash Mysql Server 5.0.67 --echo # Bug #39844: Query Crash Mysql Server 5.0.67
--echo # --echo #

View File

@ -1064,6 +1064,7 @@ set names latin1;
# #
--error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND --error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND
show columns from `#mysql50#????????`; show columns from `#mysql50#????????`;
call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'");
# #
# SHOW CREATE TRIGGER test. # SHOW CREATE TRIGGER test.

View File

@ -14,6 +14,7 @@
# Supress warnings written to the log file # Supress warnings written to the log file
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted"); call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc");
# Backup proc table # Backup proc table
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;

View File

@ -3726,3 +3726,25 @@ DROP TABLE t1,t2;
--enable_result_log --enable_result_log
--echo End of 5.1 tests --echo End of 5.1 tests
--echo #
--echo # Bug #11765713 58705:
--echo # OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
--echo # CREATED BY OPT_SUM_QUERY
--echo #
CREATE TABLE t1(a INT NOT NULL, KEY (a));
INSERT INTO t1 VALUES (0), (1);
--error ER_SUBQUERY_NO_1_ROW
SELECT 1 as foo FROM t1 WHERE a < SOME
(SELECT a FROM t1 WHERE a <=>
(SELECT a FROM t1)
);
SELECT 1 as foo FROM t1 WHERE a < SOME
(SELECT a FROM t1 WHERE a <=>
(SELECT a FROM t1 where a is null)
);
DROP TABLE t1;

View File

@ -373,4 +373,51 @@ SELECT a FROM t1 WHERE a >= '20000101000000';
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug#50774: failed to get the correct resultset when timestamp values
--echo # are appended with .0
--echo #
CREATE TABLE t1 ( a TIMESTAMP, KEY ( a ) );
INSERT INTO t1 VALUES( '2010-02-01 09:31:01' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:02' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:03' );
INSERT INTO t1 VALUES( '2010-02-01 09:31:04' );
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' <= a;
SELECT * FROM t1 WHERE a <= '2010-02-01 09:31:02.0';
SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' >= a;
--replace_column 1 x 2 x 3 x 5 x 6 x 7 x 8 x 9 x 10 x
EXPLAIN
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
CREATE TABLE t2 ( a TIMESTAMP, KEY ( a DESC ) );
INSERT INTO t2 VALUES( '2010-02-01 09:31:01' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:02' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:03' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:04' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:05' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:06' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:07' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:08' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:09' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:10' );
INSERT INTO t2 VALUES( '2010-02-01 09:31:11' );
--echo # The bug would cause the range optimizer's comparison to use an open
--echo # interval here. This reveals itself only in the number of reads
--echo # performed.
FLUSH STATUS;
--replace_column 1 x 2 x 3 x 5 x 6 x 7 x 8 x 9 x 10 x
EXPLAIN
SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
SHOW STATUS LIKE 'Handler_read_next';
DROP TABLE t1, t2;
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -3941,6 +3941,18 @@ DROP TABLE t1;
CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f;
DROP VIEW v1; DROP VIEW v1;
--echo #
--echo # Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
--echo #
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a;
SELECT * FROM v1;
DROP VIEW v1;
DROP TABLE t1;
--echo # ----------------------------------------------------------------- --echo # -----------------------------------------------------------------
--echo # -- End of 5.1 tests. --echo # -- End of 5.1 tests.
--echo # ----------------------------------------------------------------- --echo # -----------------------------------------------------------------

View File

@ -111,11 +111,12 @@ extern pthread_mutex_t LOCK_gethostbyname_r;
is finished with the structure. is finished with the structure.
*/ */
struct hostent *my_gethostbyname_r(const char *name, struct hostent *
struct hostent *result __attribute__((unused)), my_gethostbyname_r(const char *name,
char *buffer __attribute__((unused)), struct hostent *result __attribute__((unused)),
int buflen __attribute__((unused)), char *buffer __attribute__((unused)),
int *h_errnop) int buflen __attribute__((unused)),
int *h_errnop)
{ {
struct hostent *hp; struct hostent *hp;
pthread_mutex_lock(&LOCK_gethostbyname_r); pthread_mutex_lock(&LOCK_gethostbyname_r);

View File

@ -5467,6 +5467,7 @@ double Field_year::val_real(void)
longlong Field_year::val_int(void) longlong Field_year::val_int(void)
{ {
ASSERT_COLUMN_MARKED_FOR_READ; ASSERT_COLUMN_MARKED_FOR_READ;
DBUG_ASSERT(field_length == 2 || field_length == 4);
int tmp= (int) ptr[0]; int tmp= (int) ptr[0];
if (field_length != 4) if (field_length != 4)
tmp%=100; // Return last 2 char tmp%=100; // Return last 2 char
@ -5479,6 +5480,7 @@ longlong Field_year::val_int(void)
String *Field_year::val_str(String *val_buffer, String *Field_year::val_str(String *val_buffer,
String *val_ptr __attribute__((unused))) String *val_ptr __attribute__((unused)))
{ {
DBUG_ASSERT(field_length < 5);
val_buffer->alloc(5); val_buffer->alloc(5);
val_buffer->length(field_length); val_buffer->length(field_length);
char *to=(char*) val_buffer->ptr(); char *to=(char*) val_buffer->ptr();

View File

@ -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 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 it under the terms of the GNU General Public License as published by
@ -183,7 +183,7 @@ char * ip_to_hostname(struct in_addr *in, uint *errors)
&tmp_hostent,buff,sizeof(buff),&tmp_errno))) &tmp_hostent,buff,sizeof(buff),&tmp_errno)))
{ {
DBUG_PRINT("error",("gethostbyaddr_r returned %d",tmp_errno)); DBUG_PRINT("error",("gethostbyaddr_r returned %d",tmp_errno));
return 0; DBUG_RETURN(0);
} }
if (!(check=my_gethostbyname_r(hp->h_name,&tmp_hostent2,buff2,sizeof(buff2), if (!(check=my_gethostbyname_r(hp->h_name,&tmp_hostent2,buff2,sizeof(buff2),
&tmp_errno))) &tmp_errno)))

View File

@ -6121,7 +6121,7 @@ void Item_ref::print(String *str, enum_query_type query_type)
{ {
THD *thd= current_thd; THD *thd= current_thd;
append_identifier(thd, str, (*ref)->real_item()->name, append_identifier(thd, str, (*ref)->real_item()->name,
(*ref)->real_item()->name_length); strlen((*ref)->real_item()->name));
} }
else else
(*ref)->print(str, query_type); (*ref)->print(str, query_type);

View File

@ -515,6 +515,10 @@ public:
*/ */
Item *next; Item *next;
uint32 max_length; uint32 max_length;
/*
TODO: convert name and name_length fields into String to keep them in sync
(see bug #11829681/60295 etc).
*/
uint name_length; /* Length of name */ uint name_length; /* Length of name */
int8 marker; int8 marker;
uint8 decimals; uint8 decimals;

View File

@ -4000,13 +4000,11 @@ void Item_func_in::fix_length_and_dec()
uint j=0; uint j=0;
for (uint i=1 ; i < arg_count ; i++) for (uint i=1 ; i < arg_count ; i++)
{ {
if (!args[i]->null_value) // Skip NULL values array->set(j,args[i]);
{ if (!args[i]->null_value) // Skip NULL values
array->set(j,args[i]); j++;
j++; else
} have_null= 1;
else
have_null= 1;
} }
if ((array->used_count= j)) if ((array->used_count= j))
array->sort(); array->sort();

View File

@ -2122,10 +2122,7 @@ my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value)
if (!(null_value= (args[0]->null_value || args[1]->null_value || if (!(null_value= (args[0]->null_value || args[1]->null_value ||
my_decimal_round(E_DEC_FATAL_ERROR, value, (int) dec, my_decimal_round(E_DEC_FATAL_ERROR, value, (int) dec,
truncate, decimal_value) > 1))) truncate, decimal_value) > 1)))
{
decimal_value->frac= decimals;
return decimal_value; return decimal_value;
}
return 0; return 0;
} }

View File

@ -612,17 +612,13 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
switch (hybrid_type= item->result_type()) { switch (hybrid_type= item->result_type()) {
case INT_RESULT: case INT_RESULT:
max_length= 20;
break;
case DECIMAL_RESULT: case DECIMAL_RESULT:
case STRING_RESULT:
max_length= item->max_length; max_length= item->max_length;
break; break;
case REAL_RESULT: case REAL_RESULT:
max_length= float_length(decimals); max_length= float_length(decimals);
break; break;
case STRING_RESULT:
max_length= item->max_length;
break;
case ROW_RESULT: case ROW_RESULT:
default: default:
DBUG_ASSERT(0); DBUG_ASSERT(0);

View File

@ -211,6 +211,7 @@ static int get_index_max_value(TABLE *table, TABLE_REF *ref, uint range_fl)
/** /**
Substitutes constants for some COUNT(), MIN() and MAX() functions. Substitutes constants for some COUNT(), MIN() and MAX() functions.
@param thd thread handler
@param tables list of leaves of join table tree @param tables list of leaves of join table tree
@param all_fields All fields to be returned @param all_fields All fields to be returned
@param conds WHERE clause @param conds WHERE clause
@ -228,9 +229,12 @@ static int get_index_max_value(TABLE *table, TABLE_REF *ref, uint range_fl)
HA_ERR_KEY_NOT_FOUND on impossible conditions HA_ERR_KEY_NOT_FOUND on impossible conditions
@retval @retval
HA_ERR_... if a deadlock or a lock wait timeout happens, for example HA_ERR_... if a deadlock or a lock wait timeout happens, for example
@retval
ER_... e.g. ER_SUBQUERY_NO_1_ROW
*/ */
int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) int opt_sum_query(THD *thd,
TABLE_LIST *tables, List<Item> &all_fields, COND *conds)
{ {
List_iterator_fast<Item> it(all_fields); List_iterator_fast<Item> it(all_fields);
int const_result= 1; int const_result= 1;
@ -242,6 +246,8 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Item *item; Item *item;
int error; int error;
DBUG_ENTER("opt_sum_query");
if (conds) if (conds)
where_tables= conds->used_tables(); where_tables= conds->used_tables();
@ -269,7 +275,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
WHERE t2.field IS NULL; WHERE t2.field IS NULL;
*/ */
if (tl->table->map & where_tables) if (tl->table->map & where_tables)
return 0; DBUG_RETURN(0);
} }
else else
used_tables|= tl->table->map; used_tables|= tl->table->map;
@ -297,7 +303,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
{ {
tl->table->file->print_error(error, MYF(0)); tl->table->file->print_error(error, MYF(0));
tl->table->in_use->fatal_error(); tl->table->in_use->fatal_error();
return error; DBUG_RETURN(error);
} }
count*= tl->table->file->stats.records; count*= tl->table->file->stats.records;
} }
@ -390,10 +396,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if (error) if (error)
{ {
if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE) if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE)
return HA_ERR_KEY_NOT_FOUND; // No rows matching WHERE DBUG_RETURN(HA_ERR_KEY_NOT_FOUND); // No rows matching WHERE
/* HA_ERR_LOCK_DEADLOCK or some other error */ /* HA_ERR_LOCK_DEADLOCK or some other error */
table->file->print_error(error, MYF(0)); table->file->print_error(error, MYF(0));
return(error); DBUG_RETURN(error);
} }
removed_tables|= table->map; removed_tables|= table->map;
} }
@ -437,6 +443,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
const_result= 0; const_result= 0;
} }
} }
if (thd->is_error())
DBUG_RETURN(thd->main_da.sql_errno());
/* /*
If we have a where clause, we can only ignore searching in the If we have a where clause, we can only ignore searching in the
tables if MIN/MAX optimisation replaced all used tables tables if MIN/MAX optimisation replaced all used tables
@ -446,7 +456,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
*/ */
if (removed_tables && used_tables != removed_tables) if (removed_tables && used_tables != removed_tables)
const_result= 0; // We didn't remove all tables const_result= 0; // We didn't remove all tables
return const_result; DBUG_RETURN(const_result);
} }
@ -732,6 +742,12 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
if (is_null || (is_null_safe_eq && args[1]->is_null())) if (is_null || (is_null_safe_eq && args[1]->is_null()))
{ {
/*
If we have a non-nullable index, we cannot use it,
since set_null will be ignored, and we will compare uninitialized data.
*/
if (!part->field->real_maybe_null())
DBUG_RETURN(false);
part->field->set_null(); part->field->set_null();
*key_ptr= (uchar) 1; *key_ptr= (uchar) 1;
} }
@ -802,8 +818,9 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
@param[out] prefix_len Length of prefix for the search range @param[out] prefix_len Length of prefix for the search range
@note @note
This function may set table->key_read to 1, which must be reset after This function may set field->table->key_read to true,
index is used! (This can only happen when function returns 1) which must be reset after index is used!
(This can only happen when function returns 1)
@retval @retval
0 Index can not be used to optimize MIN(field)/MAX(field) 0 Index can not be used to optimize MIN(field)/MAX(field)
@ -818,7 +835,9 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
uint *range_fl, uint *prefix_len) uint *range_fl, uint *prefix_len)
{ {
if (!(field->flags & PART_KEY_FLAG)) if (!(field->flags & PART_KEY_FLAG))
return 0; // Not key field return false; // Not key field
DBUG_ENTER("find_key_for_maxmin");
TABLE *table= field->table; TABLE *table= field->table;
uint idx= 0; uint idx= 0;
@ -843,7 +862,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
part++, jdx++, key_part_to_use= (key_part_to_use << 1) | 1) part++, jdx++, key_part_to_use= (key_part_to_use << 1) | 1)
{ {
if (!(table->file->index_flags(idx, jdx, 0) & HA_READ_ORDER)) if (!(table->file->index_flags(idx, jdx, 0) & HA_READ_ORDER))
return 0; DBUG_RETURN(false);
/* Check whether the index component is partial */ /* Check whether the index component is partial */
Field *part_field= table->field[part->fieldnr-1]; Field *part_field= table->field[part->fieldnr-1];
@ -892,12 +911,12 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
*/ */
if (field->part_of_key.is_set(idx)) if (field->part_of_key.is_set(idx))
table->set_keyread(TRUE); table->set_keyread(TRUE);
return 1; DBUG_RETURN(true);
} }
} }
} }
} }
return 0; DBUG_RETURN(false);
} }

View File

@ -1109,7 +1109,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
/* Set of a stack for unget if long terminators */ /* Set of a stack for unget if long terminators */
uint length=max(field_term_length,line_term_length)+1; uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1;
set_if_bigger(length,line_start.length()); set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length); stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);

View File

@ -961,7 +961,7 @@ JOIN::optimize()
If all items were resolved by opt_sum_query, there is no need to If all items were resolved by opt_sum_query, there is no need to
open any tables. open any tables.
*/ */
if ((res=opt_sum_query(select_lex->leaf_tables, all_fields, conds))) if ((res=opt_sum_query(thd, select_lex->leaf_tables, all_fields, conds)))
{ {
if (res == HA_ERR_KEY_NOT_FOUND) if (res == HA_ERR_KEY_NOT_FOUND)
{ {
@ -1929,7 +1929,11 @@ JOIN::exec()
if (!curr_join->sort_and_group && if (!curr_join->sort_and_group &&
curr_join->const_tables != curr_join->tables) curr_join->const_tables != curr_join->tables)
curr_join->join_tab[curr_join->const_tables].sorted= 0; curr_join->join_tab[curr_join->const_tables].sorted= 0;
if ((tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table, 0)))
Procedure *save_proc= curr_join->procedure;
tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table, 0);
curr_join->procedure= save_proc;
if (tmp_error)
{ {
error= tmp_error; error= tmp_error;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
@ -12354,10 +12358,14 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
int error; int error;
if (join->having && join->having->val_int() == 0) if (join->having && join->having->val_int() == 0)
DBUG_RETURN(NESTED_LOOP_OK); // Didn't match having DBUG_RETURN(NESTED_LOOP_OK); // Didn't match having
error=0;
if (join->procedure) if (join->procedure)
error=join->procedure->send_row(join->procedure_fields_list); {
else if (join->do_send_rows) if (join->procedure->send_row(join->procedure_fields_list))
DBUG_RETURN(NESTED_LOOP_ERROR);
DBUG_RETURN(NESTED_LOOP_OK);
}
error=0;
if (join->do_send_rows)
error=join->result->send_data(*join->fields); error=join->result->send_data(*join->fields);
if (error) if (error)
DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */ DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */

View File

@ -612,7 +612,8 @@ Field* create_tmp_field_from_field(THD *thd, Field* org_field,
/* functions from opt_sum.cc */ /* functions from opt_sum.cc */
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order); bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);
int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds); int opt_sum_query(THD* thd,
TABLE_LIST *tables, List<Item> &all_fields, COND *conds);
/* from sql_delete.cc, used by opt_range.cc */ /* from sql_delete.cc, used by opt_range.cc */
extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b); extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b);

View File

@ -3399,6 +3399,12 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
it.rewind(); /* To get access to new elements in basis list */ it.rewind(); /* To get access to new elements in basis list */
while ((db_name= it++)) while ((db_name= it++))
{ {
LEX_STRING orig_db_name;
/* db_name can be changed in make_table_list() func */
if (!thd->make_lex_string(&orig_db_name, db_name->str,
db_name->length, FALSE))
goto err;
#ifndef NO_EMBEDDED_ACCESS_CHECKS #ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!(check_access(thd,SELECT_ACL, db_name->str, if (!(check_access(thd,SELECT_ACL, db_name->str,
&thd->col_access, 0, 1, with_i_schema) || &thd->col_access, 0, 1, with_i_schema) ||
@ -3461,17 +3467,13 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
} }
int res; int res;
LEX_STRING tmp_lex_string, orig_db_name; LEX_STRING tmp_lex_string;
/* /*
Set the parent lex of 'sel' because it is needed by Set the parent lex of 'sel' because it is needed by
sel.init_query() which is called inside make_table_list. sel.init_query() which is called inside make_table_list.
*/ */
thd->no_warnings_for_error= 1; thd->no_warnings_for_error= 1;
sel.parent_lex= lex; sel.parent_lex= lex;
/* db_name can be changed in make_table_list() func */
if (!thd->make_lex_string(&orig_db_name, db_name->str,
db_name->length, FALSE))
goto err;
if (make_table_list(thd, &sel, db_name, table_name)) if (make_table_list(thd, &sel, db_name, table_name))
goto err; goto err;
TABLE_LIST *show_table_list= sel.table_list.first; TABLE_LIST *show_table_list= sel.table_list.first;