Merge mysql-5.5 -> mysql-5.5-innodb

This commit is contained in:
Vasil Dimov 2011-04-21 08:39:32 +03:00
commit d861323dfb
124 changed files with 1757 additions and 1139 deletions

View file

@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5 MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=12 MYSQL_VERSION_PATCH=13
MYSQL_VERSION_EXTRA= MYSQL_VERSION_EXTRA=

View file

@ -75,6 +75,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_AUTO_VERTICAL_OUTPUT, OPT_AUTO_VERTICAL_OUTPUT,

View file

@ -128,7 +128,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,
@ -607,6 +607,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,
@ -1149,8 +1151,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

@ -1,4 +1,4 @@
# Copyright (C) 2010 Sun Microsystems, Inc # Copyright (C) 2010, 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
@ -192,3 +192,4 @@ IF(NOT HAVE_SIZE_OF_SSIZE_T)
ENDIF() ENDIF()
SET(FN_NO_CASE_SENSE 1) SET(FN_NO_CASE_SENSE 1)
SET(USE_SYMDIR 1)

View file

@ -76,9 +76,6 @@ SET(HAVE_FTRUNCATE CACHE INTERNAL "")
SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "")
SET(HAVE_GETCWD 1 CACHE INTERNAL "") SET(HAVE_GETCWD 1 CACHE INTERNAL "")
SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "")
SET(HAVE_GETHOSTBYNAME_R CACHE INTERNAL "")
SET(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE CACHE INTERNAL "")
SET(HAVE_GETHOSTBYNAME_R_RETURN_INT CACHE INTERNAL "")
SET(HAVE_GETHRTIME CACHE INTERNAL "") SET(HAVE_GETHRTIME CACHE INTERNAL "")
SET(HAVE_GETLINE CACHE INTERNAL "") SET(HAVE_GETLINE CACHE INTERNAL "")
SET(HAVE_GETNAMEINFO CACHE INTERNAL "") SET(HAVE_GETNAMEINFO CACHE INTERNAL "")

View file

@ -157,7 +157,6 @@
#cmakedefine HAVE_GETADDRINFO 1 #cmakedefine HAVE_GETADDRINFO 1
#cmakedefine HAVE_GETCWD 1 #cmakedefine HAVE_GETCWD 1
#cmakedefine HAVE_GETHOSTBYADDR_R 1 #cmakedefine HAVE_GETHOSTBYADDR_R 1
#cmakedefine HAVE_GETHOSTBYNAME_R 1
#cmakedefine HAVE_GETHRTIME 1 #cmakedefine HAVE_GETHRTIME 1
#cmakedefine HAVE_GETLINE 1 #cmakedefine HAVE_GETLINE 1
#cmakedefine HAVE_GETNAMEINFO 1 #cmakedefine HAVE_GETNAMEINFO 1
@ -448,8 +447,6 @@
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1 #cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1
#cmakedefine HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1
#cmakedefine HAVE_GETHOSTBYNAME_R_RETURN_INT 1
#cmakedefine MY_ATOMIC_MODE_DUMMY 1 #cmakedefine MY_ATOMIC_MODE_DUMMY 1
#cmakedefine MY_ATOMIC_MODE_RWLOCKS 1 #cmakedefine MY_ATOMIC_MODE_RWLOCKS 1
@ -513,6 +510,7 @@
#cmakedefine EXTRA_DEBUG 1 #cmakedefine EXTRA_DEBUG 1
#cmakedefine BACKUP_TEST 1 #cmakedefine BACKUP_TEST 1
#cmakedefine CYBOZU 1 #cmakedefine CYBOZU 1
#cmakedefine USE_SYMDIR 1
/* Character sets and collations */ /* Character sets and collations */
#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@" #cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@"

View file

@ -350,7 +350,6 @@ CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO)
CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC) CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC)
CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD) CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD)
CHECK_FUNCTION_EXISTS (gethostbyaddr_r HAVE_GETHOSTBYADDR_R) CHECK_FUNCTION_EXISTS (gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
CHECK_FUNCTION_EXISTS (gethostbyname_r HAVE_GETHOSTBYNAME_R)
CHECK_FUNCTION_EXISTS (gethrtime HAVE_GETHRTIME) CHECK_FUNCTION_EXISTS (gethrtime HAVE_GETHRTIME)
CHECK_FUNCTION_EXISTS (getnameinfo HAVE_GETNAMEINFO) CHECK_FUNCTION_EXISTS (getnameinfo HAVE_GETNAMEINFO)
CHECK_FUNCTION_EXISTS (getpass HAVE_GETPASS) CHECK_FUNCTION_EXISTS (getpass HAVE_GETPASS)
@ -921,44 +920,6 @@ CHECK_CXX_SOURCE_COMPILES("
" "
HAVE_SOLARIS_STYLE_GETHOST) HAVE_SOLARIS_STYLE_GETHOST)
CHECK_CXX_SOURCE_COMPILES("
#undef inline
#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
#define _REENTRANT
#endif
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
int main()
{
int ret = gethostbyname_r((const char *) 0,
(struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, (int *) 0);
return 0;
}"
HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
CHECK_CXX_SOURCE_COMPILES("
#undef inline
#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
#define _REENTRANT
#endif
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
int main()
{
int ret = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);
return 0;
}"
HAVE_GETHOSTBYNAME_R_RETURN_INT)
# Use of ALARMs to wakeup on timeout on sockets # Use of ALARMs to wakeup on timeout on sockets
# #
# This feature makes use of a mutex and is a scalability hog we # This feature makes use of a mutex and is a scalability hog we

View file

@ -301,9 +301,6 @@ C_MODE_END
#undef HAVE_PWRITE #undef HAVE_PWRITE
#endif #endif
#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */
#undef HAVE_GETHOSTBYNAME_R
#endif
#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ #ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */
#undef HAVE_INITGROUPS #undef HAVE_INITGROUPS
#endif #endif

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 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
@ -93,6 +93,8 @@ ssize_t vio_pending(Vio *vio);
my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length, my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length,
char *ip_string, size_t ip_string_size); char *ip_string, size_t ip_string_size);
my_bool vio_is_no_name_error(int err_code);
int vio_getnameinfo(const struct sockaddr *sa, int vio_getnameinfo(const struct sockaddr *sa,
char *hostname, size_t hostname_size, char *hostname, size_t hostname_size,
char *port, size_t port_size, char *port, size_t port_size,

View file

@ -2,6 +2,7 @@
# 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
@ -18,15 +19,7 @@ rpl.rpl_innodb_bug28430 # Bug#46029
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure
sys_vars.slow_query_log_func @solaris # Bug#54819 2010-06-26 alik sys_vars.slow_query_log_func fails sporadically on Solaris 10
sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails
sys_vars.sys_vars # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
sys_vars.rpl_semi_sync_master_enabled_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
sys_vars.rpl_semi_sync_master_timeout_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
sys_vars.rpl_semi_sync_master_trace_level_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
sys_vars.rpl_semi_sync_master_wait_no_slave_basic # Bug #59148 2011-01-10 joro 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
rpl.rpl_semi_sync_event # Bug #59148 2011-02-02 svoj 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
rpl.rpl_semi_sync # Bug #59148 2011-02-02 svoj 'INSTALL PLUGIN rpl_semi_sync_master' fails in release build with debug binaries
# BUG #59055 : All ndb tests should be removed from the repository # BUG #59055 : All ndb tests should be removed from the repository
# Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests # Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests

View file

@ -122,11 +122,13 @@ 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 SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677"); call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677");
--enable_query_log
sync_slave_with_master; sync_slave_with_master;
--echo --echo

View file

@ -1765,6 +1765,22 @@ SELECT
HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date, HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime; HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
--echo #
--echo # Bug#11926811 / Bug#60625 Illegal mix of collations
--echo #
SELECT @@collation_connection;
DELIMITER //;
CREATE PROCEDURE p1()
BEGIN
DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
SELECT v_LastPaymentDate < NOW();
EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
SHOW WARNINGS;
EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
END//
DELIMITER ;//
CALL p1;
DROP PROCEDURE p1;
--echo # --echo #
--echo # Bug#52159 returning time type from function and empty left join causes debug assertion --echo # Bug#52159 returning time type from function and empty left join causes debug assertion

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

@ -71,7 +71,7 @@ SET @@collation_connection = @collation_connection_saved||
-- 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"),
@ -128,7 +128,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"),
@ -141,53 +140,20 @@ 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"),
/* 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"),
/* Added 2009-08-XX after fixing Bug #42408 */ /* Added 2009-08-XX after fixing Bug #42408 */
@ -215,14 +181,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:.*"),
/* /*
BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB
table cause warnings in errlog table cause warnings in errlog

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
@ -156,8 +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= $::opt_config_dir || $ENV{MTR_VS_CONFIG} my $build_dir= $::opt_vs_config || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
|| $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,5 +1,5 @@
# -*- cperl -*- # -*- cperl -*-
# Copyright (C) 2004, 2006 MySQL AB, 2009 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 # 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
@ -31,7 +31,7 @@ sub gcov_prepare ($) {
# #
# Collect gcov statistics. # Collect gcov statistics.
# Arguments: # Arguments:
# $dir basedir, normally source directory # $dir basedir, normally build directory
# $gcov gcov utility program [path] name # $gcov gcov utility program [path] name
# $gcov_msg message file name # $gcov_msg message file name
# $gcov_err error file name # $gcov_err error file name
@ -43,29 +43,25 @@ sub gcov_collect ($$$) {
my $start_dir= cwd(); my $start_dir= cwd();
print "Collecting source coverage info using '$gcov'...\n"; print "Collecting source coverage info using '$gcov'...\n";
-f "$start_dir/$gcov_msg" and unlink("$start_dir/$gcov_msg"); -f "$dir/$gcov_msg" and unlink("$dir/$gcov_msg");
-f "$start_dir/$gcov_err" and unlink("$start_dir/$gcov_err"); -f "$dir/$gcov_err" and unlink("$dir/$gcov_err");
my @dirs= `find "$dir" -type d -print | sort`; my @dirs= `find "$dir" -type d -print | sort`;
#print "List of directories:\n@dirs\n"; #print "List of directories:\n@dirs\n";
foreach my $d ( @dirs ) { foreach my $d ( @dirs ) {
my $dir_reported= 0;
chomp($d); chomp($d);
chdir($d) or next; chdir($d) or next;
foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) { my @flist= glob("*.*.gcno");
$f =~ /(.*)\.[ch]c?/; print ("Collecting in '$d'...\n") if @flist;
-f "$1.gcno" or next;
if (!$dir_reported) { foreach my $f (@flist) {
print "Collecting in '$d'...\n"; system("$gcov $f 2>>$dir/$gcov_err >>$dir/$gcov_msg");
$dir_reported= 1;
}
system("$gcov $f 2>>$start_dir/$gcov_err >>$start_dir/$gcov_msg");
} }
chdir($start_dir); chdir($start_dir);
} }
print "gcov info in $gcov_msg, errors in $gcov_err\n"; print "gcov info in $dir/$gcov_msg, errors in $dir/$gcov_err\n";
} }

View file

@ -1,5 +1,5 @@
# -*- 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
@ -36,6 +36,7 @@ sub start_timer($);
sub has_expired($); sub has_expired($);
sub init_timers(); sub init_timers();
sub mark_time_used($); sub mark_time_used($);
sub mark_time_idle();
sub add_total_times($); sub add_total_times($);
sub print_times_used($$); sub print_times_used($$);
sub print_total_times($); sub print_total_times($);
@ -224,6 +225,7 @@ my %time_used= (
'ch-warn' => 0, 'ch-warn' => 0,
'test' => 0, 'test' => 0,
'init' => 0, 'init' => 0,
'admin' => 0,
); );
my %time_text= ( my %time_text= (
@ -232,7 +234,8 @@ my %time_text= (
'check' => "Check-testcase", 'check' => "Check-testcase",
'ch-warn' => "Check for warnings", 'ch-warn' => "Check for warnings",
'test' => "Test execution", 'test' => "Test execution",
'init' => "Initialization etc.", 'init' => "Initialization/cleanup",
'admin' => "Test administration",
); );
# Counts number of reports from workers # Counts number of reports from workers
@ -255,6 +258,10 @@ sub mark_time_used($) {
$last_timer_set= $curr_time; $last_timer_set= $curr_time;
} }
sub mark_time_idle() {
$last_timer_set= gettimeofday() if $opt_report_times;
}
sub add_total_times($) { sub add_total_times($) {
my ($dummy, $num, @line)= split (" ", $_[0]); my ($dummy, $num, @line)= split (" ", $_[0]);

View file

@ -210,8 +210,8 @@ our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
our $opt_gcov; our $opt_gcov;
our $opt_gcov_exe= "gcov"; our $opt_gcov_exe= "gcov";
our $opt_gcov_err= "mysql-test-gcov.msg"; our $opt_gcov_err= "mysql-test-gcov.err";
our $opt_gcov_msg= "mysql-test-gcov.err"; our $opt_gcov_msg= "mysql-test-gcov.msg";
our $opt_gprof; our $opt_gprof;
our %gprof_dirs; our %gprof_dirs;
@ -219,9 +219,12 @@ our %gprof_dirs;
our $glob_debugger= 0; our $glob_debugger= 0;
our $opt_gdb; our $opt_gdb;
our $opt_client_gdb; our $opt_client_gdb;
our $opt_dbx;
our $opt_client_dbx;
our $opt_ddd; our $opt_ddd;
our $opt_client_ddd; our $opt_client_ddd;
our $opt_manual_gdb; our $opt_manual_gdb;
our $opt_manual_dbx;
our $opt_manual_ddd; our $opt_manual_ddd;
our $opt_manual_debug; our $opt_manual_debug;
our $opt_debugger; our $opt_debugger;
@ -504,7 +507,7 @@ sub main {
mtr_print_line(); mtr_print_line();
if ( $opt_gcov ) { if ( $opt_gcov ) {
gcov_collect($basedir, $opt_gcov_exe, gcov_collect($bindir, $opt_gcov_exe,
$opt_gcov_msg, $opt_gcov_err); $opt_gcov_msg, $opt_gcov_err);
} }
@ -546,7 +549,9 @@ sub run_test_server ($$$) {
my $s= IO::Select->new(); my $s= IO::Select->new();
$s->add($server); $s->add($server);
while (1) { while (1) {
mark_time_used('admin');
my @ready = $s->can_read(1); # Wake up once every second my @ready = $s->can_read(1); # Wake up once every second
mark_time_idle();
foreach my $sock (@ready) { foreach my $sock (@ready) {
if ($sock == $server) { if ($sock == $server) {
# New client connected # New client connected
@ -888,7 +893,7 @@ sub run_worker ($) {
if ( $opt_gprof ) { if ( $opt_gprof ) {
gprof_collect (find_mysqld($basedir), keys %gprof_dirs); gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
} }
mark_time_used('init'); mark_time_used('admin');
print_times_used($server, $thread_num); print_times_used($server, $thread_num);
exit($valgrind_reports); exit($valgrind_reports);
} }
@ -1001,6 +1006,9 @@ sub command_line_setup {
'ddd' => \$opt_ddd, 'ddd' => \$opt_ddd,
'client-ddd' => \$opt_client_ddd, 'client-ddd' => \$opt_client_ddd,
'manual-ddd' => \$opt_manual_ddd, 'manual-ddd' => \$opt_manual_ddd,
'dbx' => \$opt_dbx,
'client-dbx' => \$opt_client_dbx,
'manual-dbx' => \$opt_manual_dbx,
'debugger=s' => \$opt_debugger, 'debugger=s' => \$opt_debugger,
'client-debugger=s' => \$opt_client_debugger, 'client-debugger=s' => \$opt_client_debugger,
'strace-client:s' => \$opt_strace_client, 'strace-client:s' => \$opt_strace_client,
@ -1190,7 +1198,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 (/\@.*/)
@ -1201,8 +1209,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;
@ -1426,6 +1434,12 @@ sub command_line_setup {
$opt_ddd= undef; $opt_ddd= undef;
} }
if ($opt_dbx) {
mtr_warning("Silently converting --dbx to --client-dbx in embedded mode");
$opt_client_dbx= $opt_dbx;
$opt_dbx= undef;
}
if ($opt_debugger) if ($opt_debugger)
{ {
mtr_warning("Silently converting --debugger to --client-debugger in embedded mode"); mtr_warning("Silently converting --debugger to --client-debugger in embedded mode");
@ -1434,7 +1448,7 @@ sub command_line_setup {
} }
if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd || if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd ||
$opt_manual_debug || $opt_debugger ) $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx)
{ {
mtr_error("You need to use the client debug options for the", mtr_error("You need to use the client debug options for the",
"embedded server. Ex: --client-gdb"); "embedded server. Ex: --client-gdb");
@ -1462,6 +1476,7 @@ sub command_line_setup {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd ||
$opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug ||
$opt_dbx || $opt_client_dbx || $opt_manual_dbx ||
$opt_debugger || $opt_client_debugger ) $opt_debugger || $opt_client_debugger )
{ {
# Indicate that we are using debugger # Indicate that we are using debugger
@ -3762,7 +3777,7 @@ sub run_testcase ($) {
do_before_run_mysqltest($tinfo); do_before_run_mysqltest($tinfo);
mark_time_used('init'); mark_time_used('admin');
if ( $opt_check_testcases and check_testcase($tinfo, "before") ){ if ( $opt_check_testcases and check_testcase($tinfo, "before") ){
# Failed to record state of server or server crashed # Failed to record state of server or server crashed
@ -4704,6 +4719,9 @@ sub mysqld_start ($$) {
{ {
ddd_arguments(\$args, \$exe, $mysqld->name()); ddd_arguments(\$args, \$exe, $mysqld->name());
} }
if ( $opt_dbx || $opt_manual_dbx ) {
dbx_arguments(\$args, \$exe, $mysqld->name());
}
elsif ( $opt_debugger ) elsif ( $opt_debugger )
{ {
debugger_arguments(\$args, \$exe, $mysqld->name()); debugger_arguments(\$args, \$exe, $mysqld->name());
@ -5232,7 +5250,7 @@ sub start_mysqltest ($) {
my $exe= $exe_mysqltest; my $exe= $exe_mysqltest;
my $args; my $args;
mark_time_used('init'); mark_time_used('admin');
mtr_init_args(\$args); mtr_init_args(\$args);
@ -5374,6 +5392,9 @@ sub start_mysqltest ($) {
{ {
ddd_arguments(\$args, \$exe, "client"); ddd_arguments(\$args, \$exe, "client");
} }
if ( $opt_client_dbx ) {
dbx_arguments(\$args, \$exe, "client");
}
elsif ( $opt_client_debugger ) elsif ( $opt_client_debugger )
{ {
debugger_arguments(\$args, \$exe, "client"); debugger_arguments(\$args, \$exe, "client");
@ -5408,23 +5429,11 @@ sub gdb_arguments {
# Remove the old gdbinit file # Remove the old gdbinit file
unlink($gdb_init_file); unlink($gdb_init_file);
if ( $type eq "client" ) # write init file for mysqld or client
{ mtr_tofile($gdb_init_file,
# write init file for client "set args $str\n" .
mtr_tofile($gdb_init_file, "break main\n" .
"set args $str\n" . "run");
"break main\n");
}
else
{
# write init file for mysqld
mtr_tofile($gdb_init_file,
"set args $str\n" .
"break mysql_parse\n" .
"commands 1\n" .
"disable 1\n" .
"end\n");
}
if ( $opt_manual_gdb ) if ( $opt_manual_gdb )
{ {
@ -5471,24 +5480,12 @@ sub ddd_arguments {
# Remove the old gdbinit file # Remove the old gdbinit file
unlink($gdb_init_file); unlink($gdb_init_file);
if ( $type eq "client" ) # write init file for mysqld or client
{ mtr_tofile($gdb_init_file,
# write init file for client "file $$exe\n" .
mtr_tofile($gdb_init_file, "set args $str\n" .
"set args $str\n" . "break main\n" .
"break main\n"); "run");
}
else
{
# write init file for mysqld
mtr_tofile($gdb_init_file,
"file $$exe\n" .
"set args $str\n" .
"break mysql_parse\n" .
"commands 1\n" .
"disable 1\n" .
"end");
}
if ( $opt_manual_ddd ) if ( $opt_manual_ddd )
{ {
@ -5517,6 +5514,46 @@ sub ddd_arguments {
} }
#
# Modify the exe and args so that program is run in dbx in xterm
#
sub dbx_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
# Put $args into a single string
my $str= join " ", @$$args;
if ( $opt_manual_dbx ) {
print "\nTo start dbx for $type, type in another window:\n";
print "cd $glob_mysql_test_dir; dbx -c \"stop in main; " .
"run $str\" $$exe\n";
# Indicate the exe should not be started
$$exe= undef;
return;
}
$$args= [];
mtr_add_arg($$args, "-title");
mtr_add_arg($$args, "$type");
mtr_add_arg($$args, "-e");
if ( $exe_libtool ) {
mtr_add_arg($$args, $exe_libtool);
mtr_add_arg($$args, "--mode=execute");
}
mtr_add_arg($$args, "dbx");
mtr_add_arg($$args, "-c");
mtr_add_arg($$args, "stop in main; run $str");
mtr_add_arg($$args, "$$exe");
$$exe= "xterm";
}
# #
# Modify the exe and args so that program is run in the selected debugger # Modify the exe and args so that program is run in the selected debugger
# #
@ -5547,18 +5584,6 @@ sub debugger_arguments {
# Set exe to debuggername # Set exe to debuggername
$$exe= $debugger; $$exe= $debugger;
}
elsif ( $debugger eq "dbx" )
{
# xterm -e dbx -r exe arg1 .. argn
unshift(@$$args, $$exe);
unshift(@$$args, "-r");
unshift(@$$args, $debugger);
unshift(@$$args, "-e");
$$exe= "xterm";
} }
else else
{ {
@ -5860,6 +5885,7 @@ Options for debugging the product
client-ddd Start mysqltest client in ddd client-ddd Start mysqltest client in ddd
client-debugger=NAME Start mysqltest in the selected debugger client-debugger=NAME Start mysqltest in the selected debugger
client-gdb Start mysqltest client in gdb client-gdb Start mysqltest client in gdb
client-dbx Start mysqltest client in dbx
ddd Start mysqld in ddd ddd Start mysqld in ddd
debug Dump trace output for all servers and client programs debug Dump trace output for all servers and client programs
debug-common Same as debug, but sets 'd' debug flags to debug-common Same as debug, but sets 'd' debug flags to
@ -5868,12 +5894,15 @@ Options for debugging the product
tracing tracing
debugger=NAME Start mysqld in the selected debugger debugger=NAME Start mysqld in the selected debugger
gdb Start the mysqld(s) in gdb gdb Start the mysqld(s) in gdb
dbx Start the mysqld(s) in dbx
manual-debug Let user manually start mysqld in debugger, before manual-debug Let user manually start mysqld in debugger, before
running test(s) running test(s)
manual-gdb Let user manually start mysqld in gdb, before running manual-gdb Let user manually start mysqld in gdb, before running
test(s) test(s)
manual-ddd Let user manually start mysqld in ddd, before running manual-ddd Let user manually start mysqld in ddd, before running
test(s) test(s)
manual-dbx Let user manually start mysqld in dbx, before running
test(s)
strace-client[=path] Create strace output for mysqltest client, optionally strace-client[=path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use. specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace Example: $0 --strace-client=ktrace

View file

@ -1391,3 +1391,16 @@ CREATE DATABASE db1 CHARACTER SET utf8;
CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100))); CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100)));
ALTER TABLE db1.t1 ADD baz INT; ALTER TABLE db1.t1 ADD baz INT;
DROP DATABASE db1; DROP DATABASE db1;
#
# Bug#11938039 RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME
# CLAUSE FAILS OR ABORTS SERVER.
#
drop table if exists t1;
create table t1 (a int);
prepare stmt1 from 'alter table t1 alter column a set default 1, rename to t2';
execute stmt1;
rename table t2 to t1;
# The below statement should succeed and not emit error or abort server.
execute stmt1;
deallocate prepare stmt1;
drop table t2;

View file

@ -2807,6 +2807,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie
field_str1 field1_str2 field_date field_datetime field_str1 field1_str2 field_date field_datetime
323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
# #
# Bug#11926811 / Bug#60625 Illegal mix of collations
#
SELECT @@collation_connection;
@@collation_connection
binary
CREATE PROCEDURE p1()
BEGIN
DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
SELECT v_LastPaymentDate < NOW();
EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
SHOW WARNINGS;
EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
END//
CALL p1;
v_LastPaymentDate < NOW()
NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion # Bug#52159 returning time type from function and empty left join causes debug assertion
# #
CREATE FUNCTION f1() RETURNS TIME RETURN 1; CREATE FUNCTION f1() RETURNS TIME RETURN 1;

View file

@ -3199,6 +3199,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie
field_str1 field1_str2 field_date field_datetime field_str1 field1_str2 field_date field_datetime
323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
# #
# Bug#11926811 / Bug#60625 Illegal mix of collations
#
SELECT @@collation_connection;
@@collation_connection
cp1251_general_ci
CREATE PROCEDURE p1()
BEGIN
DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
SELECT v_LastPaymentDate < NOW();
EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
SHOW WARNINGS;
EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
END//
CALL p1;
v_LastPaymentDate < NOW()
NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(convert(v_LastPaymentDate@0 using cp1251),now()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion # Bug#52159 returning time type from function and empty left join causes debug assertion
# #
CREATE FUNCTION f1() RETURNS TIME RETURN 1; CREATE FUNCTION f1() RETURNS TIME RETURN 1;

View file

@ -3226,6 +3226,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie
field_str1 field1_str2 field_date field_datetime field_str1 field1_str2 field_date field_datetime
323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
# #
# Bug#11926811 / Bug#60625 Illegal mix of collations
#
SELECT @@collation_connection;
@@collation_connection
latin1_swedish_ci
CREATE PROCEDURE p1()
BEGIN
DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
SELECT v_LastPaymentDate < NOW();
EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
SHOW WARNINGS;
EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
END//
CALL p1;
v_LastPaymentDate < NOW()
NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion # Bug#52159 returning time type from function and empty left join causes debug assertion
# #
CREATE FUNCTION f1() RETURNS TIME RETURN 1; CREATE FUNCTION f1() RETURNS TIME RETURN 1;

View file

@ -4060,6 +4060,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie
field_str1 field1_str2 field_date field_datetime field_str1 field1_str2 field_date field_datetime
0032003000300037002D00300038002D00300032002000320033003A00350039003A00300030 0032003000300037002D00300038002D00300033002000310037003A00330032003A00300030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 0032003000300037002D00300038002D00300032002000320033003A00350039003A00300030 0032003000300037002D00300038002D00300033002000310037003A00330032003A00300030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
# #
# Bug#11926811 / Bug#60625 Illegal mix of collations
#
SELECT @@collation_connection;
@@collation_connection
ucs2_general_ci
CREATE PROCEDURE p1()
BEGIN
DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
SELECT v_LastPaymentDate < NOW();
EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
SHOW WARNINGS;
EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
END//
CALL p1;
v_LastPaymentDate < NOW()
NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(convert(v_LastPaymentDate@0 using ucs2),convert(now() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion # Bug#52159 returning time type from function and empty left join causes debug assertion
# #
CREATE FUNCTION f1() RETURNS TIME RETURN 1; CREATE FUNCTION f1() RETURNS TIME RETURN 1;

View file

@ -4938,6 +4938,32 @@ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS fie
field_str1 field1_str2 field_date field_datetime field_str1 field1_str2 field_date field_datetime
323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030 323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
# #
# Bug#11926811 / Bug#60625 Illegal mix of collations
#
SELECT @@collation_connection;
@@collation_connection
utf8_general_ci
CREATE PROCEDURE p1()
BEGIN
DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
SELECT v_LastPaymentDate < NOW();
EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
SHOW WARNINGS;
EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
END//
CALL p1;
v_LastPaymentDate < NOW()
NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(convert(v_LastPaymentDate@0 using utf8),now()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion # Bug#52159 returning time type from function and empty left join causes debug assertion
# #
CREATE FUNCTION f1() RETURNS TIME RETURN 1; CREATE FUNCTION f1() RETURNS TIME RETURN 1;

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

@ -1746,6 +1746,17 @@ 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
# #
# Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(), # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),

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

@ -521,6 +521,28 @@ 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
# #
# Bug #8433: Overflow must be an error # Bug #8433: Overflow must be an error

View file

@ -148,3 +148,25 @@ COMMIT;
# Connection default # Connection default
DROP TABLE t1, t2; DROP TABLE t1, t2;
DROP VIEW v1; DROP VIEW v1;
#
# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY
# KEY NO 0 FOR TABLE IN ERROR LOG
#
DROP TABLE IF EXISTS t1;
# Connection default
CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1, 12345);
START TRANSACTION;
SELECT * FROM t1;
id value
1 12345
# Connection con1
SET lock_wait_timeout=1;
ALTER TABLE t1 ADD INDEX idx(value);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# Connection default
SELECT * FROM t1;
id value
1 12345
COMMIT;
DROP TABLE t1;

View file

@ -94,74 +94,6 @@ SET DEBUG_SYNC= 'RESET';
# Bug#42230 during add index, cannot do queries on storage engines # Bug#42230 during add index, cannot do queries on storage engines
# that implement add_index # that implement add_index
# #
DROP DATABASE IF EXISTS db1; #
DROP TABLE IF EXISTS t1; # DISABLED due to Bug#11815600
# Test 1: Secondary index, should not block reads (original test case). #
# Connection default
CREATE DATABASE db1;
CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
INSERT INTO db1.t1(value) VALUES (1), (2);
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE db1.t1 ADD INDEX(value);
# Connection con1
SET DEBUG_SYNC= "now WAIT_FOR manage";
USE db1;
SELECT * FROM t1;
id value
1 1
2 2
SET DEBUG_SYNC= "now SIGNAL query";
# Connection default
# Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
DROP DATABASE db1;
# Test 2: Primary index (implicit), should block reads.
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD UNIQUE INDEX(a);
# Connection con1
SET DEBUG_SYNC= "now WAIT_FOR manage";
USE test;
# Sending:
SELECT * FROM t1;
# Connection con2
# Waiting for SELECT to be blocked by the metadata lock on t1
SET DEBUG_SYNC= "now SIGNAL query";
# Connection default
# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
# Connection con1
# Reaping: SELECT * FROM t1
a b
# Test 3: Primary index (explicit), should block reads.
# Connection default
ALTER TABLE t1 DROP INDEX a;
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD PRIMARY KEY (a);
# Connection con1
SET DEBUG_SYNC= "now WAIT_FOR manage";
# Sending:
SELECT * FROM t1;
# Connection con2
# Waiting for SELECT to be blocked by the metadata lock on t1
SET DEBUG_SYNC= "now SIGNAL query";
# Connection default
# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
# Connection con1
# Reaping: SELECT * FROM t1
a b
# Test 4: Secondary unique index, should not block reads.
# Connection default
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD UNIQUE (b);
# Connection con1
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
a b
SET DEBUG_SYNC= "now SIGNAL query";
# Connection default
# Reaping: ALTER TABLE t1 ADD UNIQUE (b)
SET DEBUG_SYNC= "RESET";
DROP TABLE t1;

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,6 +175,35 @@ 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 # End of 5.1 tests
# #
# Test for bug #44738 "fill_schema_table_from_frm() opens tables without # Test for bug #44738 "fill_schema_table_from_frm() opens tables without

View file

@ -225,3 +225,25 @@ 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
performance_schema
test
# 'bug58090' database should be present.
SHOW DATABASES;
Database
information_schema
bug58090
mtr
mysql
performance_schema
test
DROP DATABASE bug58090;

View file

@ -1429,6 +1429,7 @@ CALL mtr.add_suppression("Out of sort memory");
select * from t1 order by b; select * from t1 order by b;
ERROR HY001: Out of sort memory, consider increasing server sort buffer size ERROR HY001: Out of sort memory, consider increasing 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

@ -400,4 +400,51 @@ ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME IS_NULLABLE COLUMN_NAME
YES authentication_string YES authentication_string
YES plugin YES plugin
#
# Bug #11936829: diff. between mysql.user (authentication_string)
# in fresh and upgraded 5.5.11
#
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
YES authentication_string
YES plugin
ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL;
ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL;
Run mysql_upgrade on a 5.5.10 external authentication column layout
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
IS_NULLABLE COLUMN_NAME
YES authentication_string
YES plugin
End of 5.5 tests End of 5.5 tests

View file

@ -1338,6 +1338,7 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I
DROP DATABASE `ä`; DROP DATABASE `ä`;
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

@ -5058,6 +5058,24 @@ i
DROP TABLE t1,t1s,t2s; DROP TABLE t1,t1s,t2s;
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;
#
# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
# Assertion `file' failed. # Assertion `file' failed.
# #

View file

@ -523,6 +523,69 @@ 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
Bug#50888 valgrind warnings in Field_timestamp::val_str Bug#50888 valgrind warnings in Field_timestamp::val_str

View file

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

@ -316,3 +316,25 @@ SHOW ERRORS;
Level Code Message Level Code Message
Error 1051 Unknown table 't1' Error 1051 Unknown table 't1'
End of 5.0 tests End of 5.0 tests
-- Bug#55847
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
CREATE TABLE t1(a INT UNIQUE);
CREATE FUNCTION f1(x INT) RETURNS INT
BEGIN
INSERT INTO t1 VALUES(x);
INSERT INTO t1 VALUES(x);
RETURN x;
END|
SHOW TABLES WHERE f1(11) = 11;
ERROR 23000: Duplicate entry '11' for key 'a'
SHOW WARNINGS;
Level Code Message
Error 1062 Duplicate entry '11' for key 'a'
DROP TABLE t1;
DROP FUNCTION f1;

View file

@ -166,3 +166,66 @@ ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was det
XA END 'b'; XA END 'b';
XA ROLLBACK 'b'; XA ROLLBACK 'b';
DROP TABLE t1; DROP TABLE t1;
#
# Bug#11766752 59936: multiple xa assertions - transactional
# statement fuzzer
#
CREATE TABLE t1 (a INT) engine=InnoDB;
XA START 'a';
INSERT INTO t1 VALUES (1);
SAVEPOINT savep;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
XA END 'a';
SELECT * FROM t1;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
INSERT INTO t1 VALUES (2);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
SAVEPOINT savep;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
SET @a=(SELECT * FROM t1);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
XA PREPARE 'a';
SELECT * FROM t1;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
INSERT INTO t1 VALUES (2);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
SAVEPOINT savep;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
SET @a=(SELECT * FROM t1);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
UPDATE t1 SET a=1 WHERE a=2;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
XA COMMIT 'a';
SELECT * FROM t1;
a
1
DROP TABLE t1;
#
# Bug#12352846 - TRANS_XA_START(THD*):
# ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL()
# FAILED
#
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
START TRANSACTION;
INSERT INTO t1 VALUES (1);
# Connection con2
XA START 'xid1';
# Sending:
INSERT INTO t2 SELECT a FROM t1;
# Connection default
# Waiting until INSERT ... is blocked
DELETE FROM t1;
COMMIT;
# Connection con2
# Reaping: INSERT INTO t2 SELECT a FROM t1
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA COMMIT 'xid1';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
XA START 'xid1';
XA END 'xid1';
XA PREPARE 'xid1';
XA ROLLBACK 'xid1';
# Connection default
DROP TABLE t1, t2;

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,5 +0,0 @@
INSTALL PLUGIN example SONAME 'ha_example.so';
SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile;
connect_timeout 4711
local_infile 1
UNINSTALL PLUGIN example;

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,2 +0,0 @@
--defaults-file=std_data/bug57108.cnf
$EXAMPLE_PLUGIN_OPT

View file

@ -1,12 +0,0 @@
--source include/not_windows_embedded.inc
--source include/have_example_plugin.inc
# Test that we can install a plugin despite the fact that we have
# switched directory after starting the server and am using a relative
# --defaults-file.
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN';
--query_vertical SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile
UNINSTALL PLUGIN example;

View file

@ -1,48 +0,0 @@
# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER
--source include/master-slave.inc
--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

@ -57,11 +57,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");
call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677");
* Select count and 20 rows from Slave * * Select count and 20 rows from Slave *

View file

@ -57,11 +57,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");
call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677");
* 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

@ -1159,3 +1159,20 @@ CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100)));
ALTER TABLE db1.t1 ADD baz INT; ALTER TABLE db1.t1 ADD baz INT;
DROP DATABASE db1; DROP DATABASE db1;
--echo #
--echo # Bug#11938039 RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME
--echo # CLAUSE FAILS OR ABORTS SERVER.
--echo #
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int);
prepare stmt1 from 'alter table t1 alter column a set default 1, rename to t2';
execute stmt1;
rename table t2 to t1;
--echo # The below statement should succeed and not emit error or abort server.
execute stmt1;
deallocate prepare stmt1;
drop table t2;

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

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

@ -354,6 +354,22 @@ 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
--echo # --echo #

View file

@ -279,6 +279,38 @@ disconnect con2;
disconnect con3; disconnect con3;
--echo #
--echo # Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY
--echo # KEY NO 0 FOR TABLE IN ERROR LOG
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--connect (con1,localhost,root)
--echo # Connection default
connection default;
CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1, 12345);
START TRANSACTION;
SELECT * FROM t1;
--echo # Connection con1
--connection con1
SET lock_wait_timeout=1;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 ADD INDEX idx(value);
--echo # Connection default
--connection default
SELECT * FROM t1;
COMMIT;
DROP TABLE t1;
disconnect con1;
# Check that all connections opened by test cases in this file are really # Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence. # gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc

View file

@ -152,129 +152,133 @@ disconnect con1;
--echo # that implement add_index --echo # that implement add_index
--echo # --echo #
--disable_warnings --echo #
DROP DATABASE IF EXISTS db1; --echo # DISABLED due to Bug#11815600
DROP TABLE IF EXISTS t1; --echo #
--enable_warnings
connect(con1,localhost,root); #--disable_warnings
connect(con2,localhost,root); #DROP DATABASE IF EXISTS db1;
#DROP TABLE IF EXISTS t1;
--echo # Test 1: Secondary index, should not block reads (original test case). #--enable_warnings
#
--echo # Connection default #connect(con1,localhost,root);
connection default; #connect(con2,localhost,root);
CREATE DATABASE db1; #
CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb; #--echo # Test 1: Secondary index, should not block reads (original test case).
INSERT INTO db1.t1(value) VALUES (1), (2); #
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #--echo # Connection default
--echo # Sending: #connection default;
--send ALTER TABLE db1.t1 ADD INDEX(value) #CREATE DATABASE db1;
#CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
--echo # Connection con1 #INSERT INTO db1.t1(value) VALUES (1), (2);
connection con1; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
SET DEBUG_SYNC= "now WAIT_FOR manage"; #--echo # Sending:
# Neither of these two statements should be blocked #--send ALTER TABLE db1.t1 ADD INDEX(value)
USE db1; #
SELECT * FROM t1; #--echo # Connection con1
SET DEBUG_SYNC= "now SIGNAL query"; #connection con1;
#SET DEBUG_SYNC= "now WAIT_FOR manage";
--echo # Connection default # # Neither of these two statements should be blocked
connection default; #USE db1;
--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value) #SELECT * FROM t1;
--reap #SET DEBUG_SYNC= "now SIGNAL query";
DROP DATABASE db1; #
#--echo # Connection default
--echo # Test 2: Primary index (implicit), should block reads. #connection default;
#--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb; #--reap
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #DROP DATABASE db1;
--echo # Sending: #
--send ALTER TABLE t1 ADD UNIQUE INDEX(a) #--echo # Test 2: Primary index (implicit), should block reads.
#
--echo # Connection con1 #CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
connection con1; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
SET DEBUG_SYNC= "now WAIT_FOR manage"; #--echo # Sending:
USE test; #--send ALTER TABLE t1 ADD UNIQUE INDEX(a)
--echo # Sending: #
--send SELECT * FROM t1 #--echo # Connection con1
#connection con1;
--echo # Connection con2 #SET DEBUG_SYNC= "now WAIT_FOR manage";
connection con2; #USE test;
--echo # Waiting for SELECT to be blocked by the metadata lock on t1 #--echo # Sending:
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist #--send SELECT * FROM t1
WHERE state= 'Waiting for table metadata lock' #
AND info='SELECT * FROM t1'; #--echo # Connection con2
--source include/wait_condition.inc #connection con2;
SET DEBUG_SYNC= "now SIGNAL query"; #--echo # Waiting for SELECT to be blocked by the metadata lock on t1
#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--echo # Connection default # WHERE state= 'Waiting for table metadata lock'
connection default; # AND info='SELECT * FROM t1';
--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a) #--source include/wait_condition.inc
--reap #SET DEBUG_SYNC= "now SIGNAL query";
#
--echo # Connection con1 #--echo # Connection default
connection con1; #connection default;
--echo # Reaping: SELECT * FROM t1 #--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
--reap #--reap
#
--echo # Test 3: Primary index (explicit), should block reads. #--echo # Connection con1
#connection con1;
--echo # Connection default #--echo # Reaping: SELECT * FROM t1
connection default; #--reap
ALTER TABLE t1 DROP INDEX a; #
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #--echo # Test 3: Primary index (explicit), should block reads.
--echo # Sending: #
--send ALTER TABLE t1 ADD PRIMARY KEY (a) #--echo # Connection default
#connection default;
--echo # Connection con1 #ALTER TABLE t1 DROP INDEX a;
connection con1; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
SET DEBUG_SYNC= "now WAIT_FOR manage"; #--echo # Sending:
--echo # Sending: #--send ALTER TABLE t1 ADD PRIMARY KEY (a)
--send SELECT * FROM t1 #
#--echo # Connection con1
--echo # Connection con2 #connection con1;
connection con2; #SET DEBUG_SYNC= "now WAIT_FOR manage";
--echo # Waiting for SELECT to be blocked by the metadata lock on t1 #--echo # Sending:
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist #--send SELECT * FROM t1
WHERE state= 'Waiting for table metadata lock' #
AND info='SELECT * FROM t1'; #--echo # Connection con2
--source include/wait_condition.inc #connection con2;
SET DEBUG_SYNC= "now SIGNAL query"; #--echo # Waiting for SELECT to be blocked by the metadata lock on t1
#let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--echo # Connection default # WHERE state= 'Waiting for table metadata lock'
connection default; # AND info='SELECT * FROM t1';
--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a) #--source include/wait_condition.inc
--reap #SET DEBUG_SYNC= "now SIGNAL query";
#
--echo # Connection con1 #--echo # Connection default
connection con1; #connection default;
--echo # Reaping: SELECT * FROM t1 #--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
--reap #--reap
#
--echo # Test 4: Secondary unique index, should not block reads. #--echo # Connection con1
#connection con1;
--echo # Connection default #--echo # Reaping: SELECT * FROM t1
connection default; #--reap
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; #
--echo # Sending: #--echo # Test 4: Secondary unique index, should not block reads.
--send ALTER TABLE t1 ADD UNIQUE (b) #
#--echo # Connection default
--echo # Connection con1 #connection default;
connection con1; #SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
SET DEBUG_SYNC= "now WAIT_FOR manage"; #--echo # Sending:
SELECT * FROM t1; #--send ALTER TABLE t1 ADD UNIQUE (b)
SET DEBUG_SYNC= "now SIGNAL query"; #
#--echo # Connection con1
--echo # Connection default #connection con1;
connection default; #SET DEBUG_SYNC= "now WAIT_FOR manage";
--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) #SELECT * FROM t1;
--reap #SET DEBUG_SYNC= "now SIGNAL query";
#
disconnect con1; #--echo # Connection default
disconnect con2; #connection default;
SET DEBUG_SYNC= "RESET"; #--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b)
DROP TABLE t1; #--reap
#
#disconnect con1;
#disconnect con2;
#SET DEBUG_SYNC= "RESET";
#DROP TABLE t1;
# Check that all connections opened by test cases in this file are really # Check that all connections opened by test cases in this file are really

View file

@ -601,5 +601,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

@ -151,6 +151,41 @@ 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 --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

@ -847,8 +847,7 @@ CALL mtr.add_suppression("Out of sort memory");
--error ER_OUT_OF_SORTMEMORY --error ER_OUT_OF_SORTMEMORY
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

@ -490,4 +490,26 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
TABLE_SCHEMA='mysql' TABLE_SCHEMA='mysql'
ORDER BY COLUMN_NAME; ORDER BY COLUMN_NAME;
--echo #
--echo # Bug #11936829: diff. between mysql.user (authentication_string)
--echo # in fresh and upgraded 5.5.11
--echo #
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL;
ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL;
--echo Run mysql_upgrade on a 5.5.10 external authentication column layout
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
--echo End of 5.5 tests --echo End of 5.5 tests

View file

@ -1082,6 +1082,7 @@ DROP DATABASE `
# #
--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

@ -3996,6 +3996,28 @@ DROP TABLE t1,t1s,t2s;
--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;
--echo # --echo #
--echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): --echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
--echo # Assertion `file' failed. --echo # Assertion `file' failed.

View file

@ -362,6 +362,53 @@ 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
--echo --echo

View file

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

@ -228,3 +228,43 @@ DROP TABLE t1;
SHOW ERRORS; SHOW ERRORS;
--echo End of 5.0 tests --echo End of 5.0 tests
#
# Bug#55847: SHOW WARNINGS returns empty result set when SQLEXCEPTION is active
#
--echo
--echo -- Bug#55847
--echo
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
--enable_warnings
CREATE TABLE t1(a INT UNIQUE);
delimiter |;
CREATE FUNCTION f1(x INT) RETURNS INT
BEGIN
INSERT INTO t1 VALUES(x);
INSERT INTO t1 VALUES(x);
RETURN x;
END|
delimiter ;|
--echo
--error ER_DUP_ENTRY
SHOW TABLES WHERE f1(11) = 11;
--echo
SHOW WARNINGS;
--echo
DROP TABLE t1;
DROP FUNCTION f1;

View file

@ -3,6 +3,8 @@
# #
-- source include/have_innodb.inc -- source include/have_innodb.inc
--source include/not_embedded.inc
# Save the initial number of concurrent sessions # Save the initial number of concurrent sessions
--source include/count_sessions.inc --source include/count_sessions.inc
@ -287,6 +289,98 @@ DROP TABLE t1;
disconnect con1; disconnect con1;
--echo #
--echo # Bug#11766752 59936: multiple xa assertions - transactional
--echo # statement fuzzer
--echo #
CREATE TABLE t1 (a INT) engine=InnoDB;
XA START 'a';
INSERT INTO t1 VALUES (1);
--error ER_XAER_RMFAIL
SAVEPOINT savep;
XA END 'a';
--error ER_XAER_RMFAIL
SELECT * FROM t1;
--error ER_XAER_RMFAIL
INSERT INTO t1 VALUES (2);
--error ER_XAER_RMFAIL
SAVEPOINT savep;
--error ER_XAER_RMFAIL
SET @a=(SELECT * FROM t1);
XA PREPARE 'a';
--error ER_XAER_RMFAIL
SELECT * FROM t1; # used to cause InnoDB assert
--error ER_XAER_RMFAIL
INSERT INTO t1 VALUES (2); # used to cause InnoDB assert
--error ER_XAER_RMFAIL
SAVEPOINT savep;
--error ER_XAER_RMFAIL
SET @a=(SELECT * FROM t1); # used to cause InnoDB assert
--error ER_XAER_RMFAIL
UPDATE t1 SET a=1 WHERE a=2;
XA COMMIT 'a';
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Bug#12352846 - TRANS_XA_START(THD*):
--echo # ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL()
--echo # FAILED
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
START TRANSACTION;
INSERT INTO t1 VALUES (1);
--echo # Connection con2
--connect (con2,localhost,root)
XA START 'xid1';
--echo # Sending:
--send INSERT INTO t2 SELECT a FROM t1
--echo # Connection default
--connection default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE state = "Sending data"
AND info = "INSERT INTO t2 SELECT a FROM t1";
--echo # Waiting until INSERT ... is blocked
--source include/wait_condition.inc
DELETE FROM t1;
COMMIT;
--echo # Connection con2
--connection con2
--echo # Reaping: INSERT INTO t2 SELECT a FROM t1
--error ER_LOCK_DEADLOCK
--reap
--error ER_XA_RBDEADLOCK
XA COMMIT 'xid1';
# This caused the assert to be triggered
XA START 'xid1';
XA END 'xid1';
XA PREPARE 'xid1';
XA ROLLBACK 'xid1';
--echo # Connection default
connection default;
DROP TABLE t1, t2;
disconnect con2;
# Wait till all disconnects are completed # Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc

View file

@ -467,10 +467,6 @@ PSI_mutex_key key_my_file_info_mutex;
PSI_mutex_key key_LOCK_localtime_r; PSI_mutex_key key_LOCK_localtime_r;
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ #endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
#ifndef HAVE_GETHOSTBYNAME_R
PSI_mutex_key key_LOCK_gethostbyname_r;
#endif /* HAVE_GETHOSTBYNAME_R */
PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm, key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm,
key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap, key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap,
@ -487,9 +483,6 @@ static PSI_mutex_info all_mysys_mutexes[]=
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
{ &key_LOCK_localtime_r, "LOCK_localtime_r", PSI_FLAG_GLOBAL}, { &key_LOCK_localtime_r, "LOCK_localtime_r", PSI_FLAG_GLOBAL},
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ #endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
#ifndef HAVE_GETHOSTBYNAME_R
{ &key_LOCK_gethostbyname_r, "LOCK_gethostbyname_r", PSI_FLAG_GLOBAL},
#endif /* HAVE_GETHOSTBYNAME_R */
{ &key_BITMAP_mutex, "BITMAP::mutex", 0}, { &key_BITMAP_mutex, "BITMAP::mutex", 0},
{ &key_IO_CACHE_append_buffer_lock, "IO_CACHE::append_buffer_lock", 0}, { &key_IO_CACHE_append_buffer_lock, "IO_CACHE::append_buffer_lock", 0},
{ &key_IO_CACHE_SHARE_mutex, "IO_CACHE::SHARE_mutex", 0}, { &key_IO_CACHE_SHARE_mutex, "IO_CACHE::SHARE_mutex", 0},

View file

@ -34,9 +34,6 @@ uint my_thread_end_wait_time= 5;
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
mysql_mutex_t LOCK_localtime_r; mysql_mutex_t LOCK_localtime_r;
#endif #endif
#ifndef HAVE_GETHOSTBYNAME_R
mysql_mutex_t LOCK_gethostbyname_r;
#endif
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
pthread_mutexattr_t my_fast_mutexattr; pthread_mutexattr_t my_fast_mutexattr;
#endif #endif
@ -222,10 +219,6 @@ my_bool my_thread_global_init(void)
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
mysql_mutex_init(key_LOCK_localtime_r, &LOCK_localtime_r, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_localtime_r, &LOCK_localtime_r, MY_MUTEX_INIT_SLOW);
#endif #endif
#ifndef HAVE_GETHOSTBYNAME_R
mysql_mutex_init(key_LOCK_gethostbyname_r,
&LOCK_gethostbyname_r, MY_MUTEX_INIT_SLOW);
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
install_sigabrt_handler(); install_sigabrt_handler();
@ -289,9 +282,6 @@ void my_thread_global_end(void)
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
mysql_mutex_destroy(&LOCK_localtime_r); mysql_mutex_destroy(&LOCK_localtime_r);
#endif #endif
#ifndef HAVE_GETHOSTBYNAME_R
mysql_mutex_destroy(&LOCK_gethostbyname_r);
#endif
my_thread_global_init_done= 0; my_thread_global_init_done= 0;
} }

View file

@ -36,10 +36,6 @@ extern PSI_mutex_key key_my_file_info_mutex;
extern PSI_mutex_key key_LOCK_localtime_r; extern PSI_mutex_key key_LOCK_localtime_r;
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ #endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
#ifndef HAVE_GETHOSTBYNAME_R
extern PSI_mutex_key key_LOCK_gethostbyname_r;
#endif /* HAVE_GETHOSTBYNAME_R */
extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm, key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm,
key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap, key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap,

View file

@ -17,7 +17,7 @@
/** /**
@file @file
socket_peercred authentication plugin. auth_socket authentication plugin.
Authentication is successful if the connection is done via a unix socket and Authentication is successful if the connection is done via a unix socket and
the owner of the client process matches the user name that was used when the owner of the client process matches the user name that was used when

View file

@ -642,6 +642,7 @@ drop procedure mysql.die;
ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT;
ALTER TABLE user MODIFY plugin char(64) DEFAULT ''; ALTER TABLE user MODIFY plugin char(64) DEFAULT '';
ALTER TABLE user MODIFY authentication_string TEXT;
-- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from
-- older versions -- older versions

View file

@ -5382,6 +5382,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
@ -5394,6 +5395,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, 2008-2009 Sun Microsystems, Inc /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify 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
@ -366,41 +366,35 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
err_code= vio_getnameinfo(ip, hostname_buffer, NI_MAXHOST, NULL, 0, err_code= vio_getnameinfo(ip, hostname_buffer, NI_MAXHOST, NULL, 0,
NI_NAMEREQD); NI_NAMEREQD);
if (err_code == EAI_NONAME) if (err_code)
{ {
/* // NOTE: gai_strerror() returns a string ending by a dot.
There is no reverse address mapping for the IP address. A host name
can not be resolved.
*/
DBUG_PRINT("error", ("IP address '%s' could not be resolved: " DBUG_PRINT("error", ("IP address '%s' could not be resolved: %s",
"no reverse address mapping.",
(const char *) ip_key));
sql_print_warning("IP address '%s' could not be resolved: "
"no reverse address mapping.",
(const char *) ip_key);
err_status= add_hostname(ip_key, NULL);
*hostname= NULL;
*connect_errors= 0; /* New IP added to the cache. */
DBUG_RETURN(err_status);
}
else if (err_code)
{
DBUG_PRINT("error", ("IP address '%s' could not be resolved: "
"getnameinfo() returned %d.",
(const char *) ip_key, (const char *) ip_key,
(int) err_code)); (const char *) gai_strerror(err_code)));
sql_print_warning("IP address '%s' could not be resolved: " sql_print_warning("IP address '%s' could not be resolved: %s",
"getnameinfo() returned error (code: %d).",
(const char *) ip_key, (const char *) ip_key,
(int) err_code); (const char *) gai_strerror(err_code));
DBUG_RETURN(TRUE); if (vio_is_no_name_error(err_code))
{
/*
The no-name error means that there is no reverse address mapping
for the IP address. A host name can not be resolved.
If it is not the no-name error, we should not cache the hostname
(or rather its absence), because the failure might be transient.
*/
add_hostname(ip_key, NULL);
*hostname= NULL;
*connect_errors= 0; /* New IP added to the cache. */
}
DBUG_RETURN(FALSE);
} }
DBUG_PRINT("info", ("IP '%s' resolved to '%s'.", DBUG_PRINT("info", ("IP '%s' resolved to '%s'.",

View file

@ -1746,7 +1746,8 @@ bool agg_item_collations(DTCollation &c, const char *fname,
} }
/* If all arguments where numbers, reset to @@collation_connection */ /* If all arguments where numbers, reset to @@collation_connection */
if (c.derivation == DERIVATION_NUMERIC) if (flags & MY_COLL_ALLOW_NUMERIC_CONV &&
c.derivation == DERIVATION_NUMERIC)
c.set(Item::default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_NUMERIC); c.set(Item::default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_NUMERIC);
return FALSE; return FALSE;
@ -6479,7 +6480,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

@ -53,6 +53,8 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg)
(i.e. constant). (i.e. constant).
MY_COLL_ALLOW_CONV - allow any kind of conversion MY_COLL_ALLOW_CONV - allow any kind of conversion
(combination of the above two) (combination of the above two)
MY_COLL_ALLOW_NUMERIC_CONV - if all items were numbers, convert to
@@character_set_connection
MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE
(e.g. when aggregating for comparison) (e.g. when aggregating for comparison)
MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV
@ -62,6 +64,7 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg)
#define MY_COLL_ALLOW_SUPERSET_CONV 1 #define MY_COLL_ALLOW_SUPERSET_CONV 1
#define MY_COLL_ALLOW_COERCIBLE_CONV 2 #define MY_COLL_ALLOW_COERCIBLE_CONV 2
#define MY_COLL_DISALLOW_NONE 4 #define MY_COLL_DISALLOW_NONE 4
#define MY_COLL_ALLOW_NUMERIC_CONV 8
#define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV) #define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV)
#define MY_COLL_CMP_CONV (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE) #define MY_COLL_CMP_CONV (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE)
@ -548,6 +551,10 @@ public:
*/ */
Item *next; Item *next;
uint32 max_length; /* Maximum length, in bytes */ uint32 max_length; /* Maximum length, in bytes */
/*
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;
@ -1557,7 +1564,8 @@ agg_item_charsets_for_string_result(DTCollation &c, const char *name,
int item_sep= 1) int item_sep= 1)
{ {
uint flags= MY_COLL_ALLOW_SUPERSET_CONV | uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
MY_COLL_ALLOW_COERCIBLE_CONV; MY_COLL_ALLOW_COERCIBLE_CONV |
MY_COLL_ALLOW_NUMERIC_CONV;
return agg_item_charsets(c, name, items, nitems, flags, item_sep); return agg_item_charsets(c, name, items, nitems, flags, item_sep);
} }
inline bool inline bool
@ -1570,6 +1578,19 @@ agg_item_charsets_for_comparison(DTCollation &c, const char *name,
MY_COLL_DISALLOW_NONE; MY_COLL_DISALLOW_NONE;
return agg_item_charsets(c, name, items, nitems, flags, item_sep); return agg_item_charsets(c, name, items, nitems, flags, item_sep);
} }
inline bool
agg_item_charsets_for_string_result_with_comparison(DTCollation &c,
const char *name,
Item **items, uint nitems,
int item_sep= 1)
{
uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
MY_COLL_ALLOW_COERCIBLE_CONV |
MY_COLL_ALLOW_NUMERIC_CONV |
MY_COLL_DISALLOW_NONE;
return agg_item_charsets(c, name, items, nitems, flags, item_sep);
}
class Item_num: public Item_basic_constant class Item_num: public Item_basic_constant
{ {

View file

@ -4069,13 +4069,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

@ -2407,10 +2407,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;
} }
@ -2537,7 +2534,8 @@ void Item_func_min_max::fix_length_and_dec()
} }
if (cmp_type == STRING_RESULT) if (cmp_type == STRING_RESULT)
{ {
agg_arg_charsets_for_comparison(collation, args, arg_count); agg_arg_charsets_for_string_result_with_comparison(collation,
args, arg_count);
if (datetime_found) if (datetime_found)
{ {
thd= current_thd; thd= current_thd;

View file

@ -165,6 +165,11 @@ public:
{ {
return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep); return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
} }
/*
Aggregate arguments for string result, e.g: CONCAT(a,b)
- convert to @@character_set_connection if all arguments are numbers
- allow DERIVATION_NONE
*/
bool agg_arg_charsets_for_string_result(DTCollation &c, bool agg_arg_charsets_for_string_result(DTCollation &c,
Item **items, uint nitems, Item **items, uint nitems,
int item_sep= 1) int item_sep= 1)
@ -172,6 +177,11 @@ public:
return agg_item_charsets_for_string_result(c, func_name(), return agg_item_charsets_for_string_result(c, func_name(),
items, nitems, item_sep); items, nitems, item_sep);
} }
/*
Aggregate arguments for comparison, e.g: a=b, a LIKE b, a RLIKE b
- don't convert to @@character_set_connection if all arguments are numbers
- don't allow DERIVATION_NONE
*/
bool agg_arg_charsets_for_comparison(DTCollation &c, bool agg_arg_charsets_for_comparison(DTCollation &c,
Item **items, uint nitems, Item **items, uint nitems,
int item_sep= 1) int item_sep= 1)
@ -179,6 +189,21 @@ public:
return agg_item_charsets_for_comparison(c, func_name(), return agg_item_charsets_for_comparison(c, func_name(),
items, nitems, item_sep); items, nitems, item_sep);
} }
/*
Aggregate arguments for string result, when some comparison
is involved internally, e.g: REPLACE(a,b,c)
- convert to @@character_set_connection if all arguments are numbers
- disallow DERIVATION_NONE
*/
bool agg_arg_charsets_for_string_result_with_comparison(DTCollation &c,
Item **items,
uint nitems,
int item_sep= 1)
{
return agg_item_charsets_for_string_result_with_comparison(c, func_name(),
items, nitems,
item_sep);
}
bool walk(Item_processor processor, bool walk_subquery, uchar *arg); bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
Item *transform(Item_transformer transformer, uchar *arg); Item *transform(Item_transformer transformer, uchar *arg);
Item* compile(Item_analyzer analyzer, uchar **arg_p, Item* compile(Item_analyzer analyzer, uchar **arg_p,

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