mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge from mysql-5.5-bugteam to mysql-5.5-runtime
No conflicts
This commit is contained in:
@@ -6,7 +6,7 @@ INSERT INTO t1 VALUES (1);
|
||||
source include/show_binlog_events.inc;
|
||||
eval $statement;
|
||||
source include/show_binlog_events.inc;
|
||||
if (`select '$cleanup' != ''`) {
|
||||
if ($cleanup) {
|
||||
eval $cleanup;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ INSERT INTO t1 VALUES (3);
|
||||
source include/show_binlog_events.inc;
|
||||
COMMIT;
|
||||
source include/show_binlog_events.inc;
|
||||
if (`select '$cleanup' != ''`) {
|
||||
if ($cleanup) {
|
||||
eval $cleanup;
|
||||
}
|
||||
|
||||
|
||||
@@ -285,10 +285,10 @@ if (`SELECT $CRC_ARG_type = 7`) {
|
||||
}
|
||||
|
||||
######## execute! ########
|
||||
if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
|
||||
if ($CRC_RET_stmt_sidef) {
|
||||
--echo
|
||||
--echo Invoking $CRC_RET_desc.
|
||||
if (`SELECT '$CRC_create' != ''`) {
|
||||
if ($CRC_create) {
|
||||
--eval $CRC_create
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
|
||||
|
||||
# Invoke created object, discarding the return value. This should not
|
||||
# give any warning.
|
||||
if (`SELECT '$CRC_RET_sel_retval' != ''`) {
|
||||
if ($CRC_RET_sel_retval) {
|
||||
--echo * Invoke statement so that return value is dicarded: expect no warning.
|
||||
--disable_result_log
|
||||
--eval $CRC_RET_sel_retval
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#
|
||||
|
||||
connection slave;
|
||||
if (`SELECT $debug_sync_action = ''`)
|
||||
if (!$debug_sync_action)
|
||||
{
|
||||
--die Cannot continue. Please set value for debug_sync_action.
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state
|
||||
# MTR is not case-sensitive.
|
||||
let $lower_stmt_head= load data;
|
||||
let $UPPER_STMT_HEAD= LOAD DATA;
|
||||
if (`SELECT '$lock_option' <> ''`)
|
||||
if ($lock_option)
|
||||
{
|
||||
#if $lock_option is null, an extra blank is added into the statement,
|
||||
#this will change the result of rpl_loaddata test case. so $lock_option
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# Reset DEBUG_SYNC facility for safety.
|
||||
set debug_sync= "RESET";
|
||||
|
||||
if (`SELECT '$restore_table' <> ''`)
|
||||
if ($restore_table)
|
||||
{
|
||||
--eval create temporary table t_backup select * from $restore_table;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ connection default;
|
||||
|
||||
--eval delete from $table where i = 0;
|
||||
|
||||
if (`SELECT '$restore_table' <> ''`)
|
||||
if ($restore_table)
|
||||
{
|
||||
--eval truncate table $restore_table;
|
||||
--eval insert into $restore_table select * from t_backup;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# Reset DEBUG_SYNC facility for safety.
|
||||
set debug_sync= "RESET";
|
||||
|
||||
if (`SELECT '$restore_table' <> ''`)
|
||||
if ($restore_table)
|
||||
{
|
||||
--eval create temporary table t_backup select * from $restore_table;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ if (!$success)
|
||||
|
||||
--eval delete from $table where i = 0;
|
||||
|
||||
if (`SELECT '$restore_table' <> ''`)
|
||||
if ($restore_table)
|
||||
{
|
||||
--eval truncate table $restore_table;
|
||||
--eval insert into $restore_table select * from t_backup;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
# # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position
|
||||
# # in $relay_log_file: $relay_log_pos.
|
||||
|
||||
if (`SELECT '$relay_log_file' = ''`)
|
||||
if (!$relay_log_file)
|
||||
{
|
||||
--die 'variable $relay_log_file is null'
|
||||
}
|
||||
|
||||
if (`SELECT '$master_log_pos' = ''`)
|
||||
if (!$master_log_pos)
|
||||
{
|
||||
--die 'variable $master_log_pos is null'
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ connection master;
|
||||
# kill the query that is waiting
|
||||
eval kill query $connection_id;
|
||||
|
||||
if (`SELECT '$debug_lock' != ''`)
|
||||
if ($debug_lock)
|
||||
{
|
||||
# release the lock to allow binlog continue
|
||||
eval SELECT RELEASE_LOCK($debug_lock);
|
||||
@@ -57,7 +57,7 @@ reap;
|
||||
|
||||
connection master;
|
||||
|
||||
if (`SELECT '$debug_lock' != ''`)
|
||||
if ($debug_lock)
|
||||
{
|
||||
# get lock again to make the next query wait
|
||||
eval SELECT GET_LOCK($debug_lock, 10);
|
||||
|
||||
@@ -25,7 +25,7 @@ source include/kill_query.inc;
|
||||
connection master;
|
||||
disable_query_log;
|
||||
disable_result_log;
|
||||
if (`SELECT '$debug_lock' != ''`)
|
||||
if ($debug_lock)
|
||||
{
|
||||
eval SELECT RELEASE_LOCK($debug_lock);
|
||||
}
|
||||
@@ -36,8 +36,8 @@ source include/diff_master_slave.inc;
|
||||
|
||||
# Acquire the debug lock again if used
|
||||
connection master;
|
||||
disable_query_log; disable_result_log; if (`SELECT '$debug_lock' !=
|
||||
''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log;
|
||||
enable_query_log;
|
||||
disable_query_log; disable_result_log;
|
||||
if ($debug_lock) { eval SELECT GET_LOCK($debug_lock, 10); }
|
||||
enable_result_log; enable_query_log;
|
||||
|
||||
connection $connection_name;
|
||||
|
||||
@@ -56,7 +56,7 @@ if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) {
|
||||
# Read server variables.
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1);
|
||||
if (`SELECT '$_fake_filename' = ''`) {
|
||||
if (!$_fake_filename) {
|
||||
--echo Badly written test case: relay_log variable is empty. Please use the
|
||||
--echo server option --relay-log=FILE.
|
||||
}
|
||||
|
||||
@@ -18,13 +18,15 @@ if ($is_relay_log)
|
||||
--let $_statement=show relaylog events
|
||||
}
|
||||
|
||||
if (`SELECT '$binlog_file' <> ''`)
|
||||
if ($binlog_file)
|
||||
{
|
||||
--let $_statement= $_statement in '$binlog_file'
|
||||
}
|
||||
|
||||
--let $_statement= $_statement from $binlog_start
|
||||
|
||||
# Cannot use if($binlog_limit) since the variable may begin with a 0
|
||||
|
||||
if (`SELECT '$binlog_limit' <> ''`)
|
||||
{
|
||||
--let $_statement= $_statement limit $binlog_limit
|
||||
|
||||
@@ -48,13 +48,13 @@ let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
|
||||
eval SHOW BINLOG EVENTS IN '$binlog_name';
|
||||
|
||||
let $_master_con= $master_connection;
|
||||
if (`SELECT '$_master_con' = ''`)
|
||||
if (!$_master_con)
|
||||
{
|
||||
if (`SELECT '$_con' = 'slave'`)
|
||||
{
|
||||
let $_master_con= master;
|
||||
}
|
||||
if (`SELECT '$_master_con' = ''`)
|
||||
if (!$_master_con)
|
||||
{
|
||||
--echo Unable to determine master connection. No debug info printed for master.
|
||||
--echo Please fix the test case by setting $master_connection before sourcing
|
||||
@@ -62,7 +62,7 @@ if (`SELECT '$_master_con' = ''`)
|
||||
}
|
||||
}
|
||||
|
||||
if (`SELECT '$_master_con' != ''`)
|
||||
if ($_master_con)
|
||||
{
|
||||
|
||||
let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
# $master_connection
|
||||
# See wait_for_slave_param.inc for description.
|
||||
|
||||
if (`SELECT '$slave_io_errno' = ''`) {
|
||||
if (!$slave_io_errno) {
|
||||
--die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ if (!$_slave_timeout_counter)
|
||||
let $slave_tcnt= $_slave_timeout_counter;
|
||||
|
||||
let $_slave_param_comparison= $slave_param_comparison;
|
||||
if (`SELECT '$_slave_param_comparison' = ''`)
|
||||
if (!$_slave_param_comparison)
|
||||
{
|
||||
let $_slave_param_comparison= =;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_
|
||||
if (!$_slave_timeout_counter)
|
||||
{
|
||||
--echo **** ERROR: timeout after $slave_tcnt deci-seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
|
||||
if (`SELECT '$slave_error_message' != ''`)
|
||||
if ($slave_error_message)
|
||||
{
|
||||
--echo Message: $slave_error_message
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
# $master_connection
|
||||
# See wait_for_slave_param.inc for description.
|
||||
|
||||
if (`SELECT '$slave_sql_errno' = ''`) {
|
||||
if (!$slave_sql_errno) {
|
||||
--die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ if (!$_status_timeout_counter)
|
||||
}
|
||||
|
||||
let $_status_var_comparsion= $status_var_comparsion;
|
||||
if (`SELECT '$_status_var_comparsion' = ''`)
|
||||
if (!$_status_var_comparsion)
|
||||
{
|
||||
let $_status_var_comparsion= =;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,13 @@ sub mtr_exe_maybe_exists(@);
|
||||
sub mtr_milli_sleep($);
|
||||
sub start_timer($);
|
||||
sub has_expired($);
|
||||
sub init_timers();
|
||||
sub mark_time_used($);
|
||||
sub add_total_times($);
|
||||
sub print_times_used($$);
|
||||
sub print_total_times($);
|
||||
|
||||
our $opt_report_times;
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -205,4 +212,81 @@ sub start_timer ($) { return time + $_[0]; }
|
||||
|
||||
sub has_expired ($) { return $_[0] && time gt $_[0]; }
|
||||
|
||||
# Below code is for time usage reporting
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
my %time_used= (
|
||||
'collect' => 0,
|
||||
'restart' => 0,
|
||||
'check' => 0,
|
||||
'ch-warn' => 0,
|
||||
'test' => 0,
|
||||
'init' => 0,
|
||||
);
|
||||
|
||||
my %time_text= (
|
||||
'collect' => "Collecting test cases",
|
||||
'restart' => "Server stop/start",
|
||||
'check' => "Check-testcase",
|
||||
'ch-warn' => "Check for warnings",
|
||||
'test' => "Test execution",
|
||||
'init' => "Initialization etc.",
|
||||
);
|
||||
|
||||
# Counts number of reports from workers
|
||||
|
||||
my $time_totals= 0;
|
||||
|
||||
my $last_timer_set;
|
||||
|
||||
sub init_timers() {
|
||||
$last_timer_set= gettimeofday();
|
||||
}
|
||||
|
||||
sub mark_time_used($) {
|
||||
my ($name)= @_;
|
||||
return unless $opt_report_times;
|
||||
die "Unknown timer $name" unless exists $time_used{$name};
|
||||
|
||||
my $curr_time= gettimeofday();
|
||||
$time_used{$name}+= int (($curr_time - $last_timer_set) * 1000 + .5);
|
||||
$last_timer_set= $curr_time;
|
||||
}
|
||||
|
||||
sub add_total_times($) {
|
||||
my ($dummy, $num, @line)= split (" ", $_[0]);
|
||||
|
||||
$time_totals++;
|
||||
foreach my $elem (@line) {
|
||||
my ($name, $spent)= split (":", $elem);
|
||||
$time_used{$name}+= $spent;
|
||||
}
|
||||
}
|
||||
|
||||
sub print_times_used($$) {
|
||||
my ($server, $num)= @_;
|
||||
return unless $opt_report_times;
|
||||
|
||||
my $output= "SPENT $num";
|
||||
foreach my $name (keys %time_used) {
|
||||
my $spent= $time_used{$name};
|
||||
$output.= " $name:$spent";
|
||||
}
|
||||
print $server $output . "\n";
|
||||
}
|
||||
|
||||
sub print_total_times($) {
|
||||
# Don't print if we haven't received all worker data
|
||||
return if $time_totals != $_[0];
|
||||
|
||||
foreach my $name (keys %time_used)
|
||||
{
|
||||
my $spent= $time_used{$name}/1000;
|
||||
my $text= $time_text{$name};
|
||||
print ("Spent $spent seconds on $text\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
@@ -116,18 +116,20 @@ sub sleep_until_file_created ($$$) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
my $seconds= ($loop * $sleeptime) / 1000;
|
||||
|
||||
# Check if it died after the fork() was successful
|
||||
if ( defined $proc and ! $proc->wait_one(0) )
|
||||
{
|
||||
mtr_warning("Process $proc died");
|
||||
mtr_warning("Process $proc died after mysql-test-run waited $seconds " .
|
||||
"seconds for $pidfile to be created.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
mtr_debug("Sleep $sleeptime milliseconds waiting for $pidfile");
|
||||
|
||||
# Print extra message every 60 seconds
|
||||
my $seconds= ($loop * $sleeptime) / 1000;
|
||||
if ( $seconds > 1 and int($seconds * 10) % 600 == 0 )
|
||||
if ( $seconds > 1 && int($seconds * 10) % 600 == 0 && $seconds < $timeout )
|
||||
{
|
||||
my $left= $timeout - $seconds;
|
||||
mtr_warning("Waited $seconds seconds for $pidfile to be created, " .
|
||||
@@ -138,6 +140,8 @@ sub sleep_until_file_created ($$$) {
|
||||
|
||||
}
|
||||
|
||||
mtr_warning("Timeout after mysql-test-run waited $timeout seconds " .
|
||||
"for the process $proc to create a pid file.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -201,6 +201,7 @@ sub using_extern { return (keys %opts_extern > 0);};
|
||||
our $opt_fast= 0;
|
||||
our $opt_force;
|
||||
our $opt_mem= $ENV{'MTR_MEM'};
|
||||
our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
|
||||
|
||||
our $opt_gcov;
|
||||
our $opt_gcov_exe= "gcov";
|
||||
@@ -241,6 +242,7 @@ my $opt_skip_core;
|
||||
our $opt_check_testcases= 1;
|
||||
my $opt_mark_progress;
|
||||
my $opt_max_connections;
|
||||
our $opt_report_times= 0;
|
||||
|
||||
my $opt_sleep;
|
||||
|
||||
@@ -354,8 +356,11 @@ sub main {
|
||||
}
|
||||
}
|
||||
|
||||
init_timers();
|
||||
|
||||
mtr_report("Collecting tests...");
|
||||
my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list);
|
||||
mark_time_used('collect');
|
||||
|
||||
if ( $opt_report_features ) {
|
||||
# Put "report features" as the first test to run
|
||||
@@ -424,6 +429,7 @@ sub main {
|
||||
$opt_tmpdir= "$opt_tmpdir/$child_num";
|
||||
}
|
||||
|
||||
init_timers();
|
||||
run_worker($server_port, $child_num);
|
||||
exit(1);
|
||||
}
|
||||
@@ -436,6 +442,8 @@ sub main {
|
||||
mtr_print_thick_line();
|
||||
mtr_print_header();
|
||||
|
||||
mark_time_used('init');
|
||||
|
||||
my $completed= run_test_server($server, $tests, $opt_parallel);
|
||||
|
||||
exit(0) if $opt_start_exit;
|
||||
@@ -481,8 +489,12 @@ sub main {
|
||||
$opt_gcov_msg, $opt_gcov_err);
|
||||
}
|
||||
|
||||
print_total_times($opt_parallel) if $opt_report_times;
|
||||
|
||||
mtr_report_stats("Completed", $completed);
|
||||
|
||||
remove_vardir_subs() if $opt_clean_vardir;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -613,13 +625,15 @@ sub run_test_server ($$$) {
|
||||
if ($test_has_failed and $retries <= $opt_retry){
|
||||
# Test should be run one more time unless it has failed
|
||||
# too many times already
|
||||
my $tname= $result->{name};
|
||||
my $failures= $result->{failures};
|
||||
if ($opt_retry > 1 and $failures >= $opt_retry_failure){
|
||||
mtr_report("\nTest has failed $failures times,",
|
||||
mtr_report("\nTest $tname has failed $failures times,",
|
||||
"no more retries!\n");
|
||||
}
|
||||
else {
|
||||
mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
|
||||
mtr_report("\nRetrying test $tname, ".
|
||||
"attempt($retries/$opt_retry)...\n");
|
||||
delete($result->{result});
|
||||
$result->{retries}= $retries+1;
|
||||
$result->write_test($sock, 'TESTCASE');
|
||||
@@ -655,6 +669,9 @@ sub run_test_server ($$$) {
|
||||
elsif ($line eq 'START'){
|
||||
; # Send first test
|
||||
}
|
||||
elsif ($line =~ /^SPENT/) {
|
||||
add_total_times($line);
|
||||
}
|
||||
else {
|
||||
mtr_error("Unknown response: '$line' from client");
|
||||
}
|
||||
@@ -786,7 +803,9 @@ sub run_worker ($) {
|
||||
# Ask server for first test
|
||||
print $server "START\n";
|
||||
|
||||
while(my $line= <$server>){
|
||||
mark_time_used('init');
|
||||
|
||||
while (my $line= <$server>){
|
||||
chomp($line);
|
||||
if ($line eq 'TESTCASE'){
|
||||
my $test= My::Test::read_test($server);
|
||||
@@ -804,16 +823,20 @@ sub run_worker ($) {
|
||||
# Send it back, now with results set
|
||||
#$test->print_test();
|
||||
$test->write_test($server, 'TESTRESULT');
|
||||
mark_time_used('restart');
|
||||
}
|
||||
elsif ($line eq 'BYE'){
|
||||
mtr_report("Server said BYE");
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
mark_time_used('restart');
|
||||
if ($opt_valgrind_mysqld) {
|
||||
valgrind_exit_reports();
|
||||
}
|
||||
if ( $opt_gprof ) {
|
||||
gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
|
||||
}
|
||||
mark_time_used('init');
|
||||
print_times_used($server, $thread_num);
|
||||
exit(0);
|
||||
}
|
||||
else {
|
||||
@@ -954,6 +977,7 @@ sub command_line_setup {
|
||||
'tmpdir=s' => \$opt_tmpdir,
|
||||
'vardir=s' => \$opt_vardir,
|
||||
'mem' => \$opt_mem,
|
||||
'clean-vardir' => \$opt_clean_vardir,
|
||||
'client-bindir=s' => \$path_client_bindir,
|
||||
'client-libdir=s' => \$path_client_libdir,
|
||||
|
||||
@@ -986,6 +1010,7 @@ sub command_line_setup {
|
||||
'timediff' => \&report_option,
|
||||
'max-connections=i' => \$opt_max_connections,
|
||||
'default-myisam!' => \&collect_option,
|
||||
'report-times' => \$opt_report_times,
|
||||
|
||||
'help|h' => \$opt_usage,
|
||||
'list-options' => \$opt_list_options,
|
||||
@@ -2256,6 +2281,12 @@ sub environment_setup {
|
||||
}
|
||||
|
||||
|
||||
sub remove_vardir_subs() {
|
||||
foreach my $sdir ( glob("$opt_vardir/*") ) {
|
||||
mtr_verbose("Removing subdir $sdir");
|
||||
rmtree($sdir);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove var and any directories in var/ created by previous
|
||||
@@ -2300,11 +2331,7 @@ sub remove_stale_vardir () {
|
||||
mtr_error("The destination for symlink $opt_vardir does not exist")
|
||||
if ! -d readlink($opt_vardir);
|
||||
|
||||
foreach my $bin ( glob("$opt_vardir/*") )
|
||||
{
|
||||
mtr_verbose("Removing bin $bin");
|
||||
rmtree($bin);
|
||||
}
|
||||
remove_vardir_subs();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3222,6 +3249,7 @@ sub check_testcase($$)
|
||||
|
||||
if ( keys(%started) == 0){
|
||||
# All checks completed
|
||||
mark_time_used('check');
|
||||
return 0;
|
||||
}
|
||||
# Wait for next process to exit
|
||||
@@ -3237,7 +3265,8 @@ sub check_testcase($$)
|
||||
"\nMTR's internal check of the test case '$tname' failed.
|
||||
This means that the test case does not preserve the state that existed
|
||||
before the test case was executed. Most likely the test case did not
|
||||
do a proper clean-up.
|
||||
do a proper clean-up. It could also be caused by the previous test run
|
||||
by this thread, if the server wasn't restarted.
|
||||
This is the diff of the states of the servers before and after the
|
||||
test case was executed:\n";
|
||||
$tinfo->{check}.= $report;
|
||||
@@ -3279,6 +3308,11 @@ test case was executed:\n";
|
||||
# Kill any check processes still running
|
||||
map($_->kill(), values(%started));
|
||||
|
||||
mtr_warning("Check-testcase failed, this could also be caused by the" .
|
||||
" previous test run by this worker thread")
|
||||
if $result > 1 && $mode eq "before";
|
||||
mark_time_used('check');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -3588,6 +3622,7 @@ sub run_testcase ($) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
mark_time_used('restart');
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# If --start or --start-dirty given, stop here to let user manually
|
||||
@@ -3640,6 +3675,8 @@ sub run_testcase ($) {
|
||||
|
||||
do_before_run_mysqltest($tinfo);
|
||||
|
||||
mark_time_used('init');
|
||||
|
||||
if ( $opt_check_testcases and check_testcase($tinfo, "before") ){
|
||||
# Failed to record state of server or server crashed
|
||||
report_failure_and_restart($tinfo);
|
||||
@@ -3686,6 +3723,7 @@ sub run_testcase ($) {
|
||||
}
|
||||
mtr_verbose("Got $proc");
|
||||
|
||||
mark_time_used('test');
|
||||
# ----------------------------------------------------
|
||||
# Was it the test program that exited
|
||||
# ----------------------------------------------------
|
||||
@@ -3912,7 +3950,9 @@ sub get_log_from_proc ($$) {
|
||||
foreach my $mysqld (mysqlds()) {
|
||||
if ($mysqld->{proc} eq $proc) {
|
||||
my @srv_lines= extract_server_log($mysqld->value('#log-error'), $name);
|
||||
$srv_log= "\nServer log from this test:\n" . join ("", @srv_lines);
|
||||
$srv_log= "\nServer log from this test:\n" .
|
||||
"----------SERVER LOG START-----------\n". join ("", @srv_lines) .
|
||||
"----------SERVER LOG END-------------\n";
|
||||
last;
|
||||
}
|
||||
}
|
||||
@@ -4089,6 +4129,7 @@ sub check_warnings ($) {
|
||||
|
||||
if ( keys(%started) == 0){
|
||||
# All checks completed
|
||||
mark_time_used('ch-warn');
|
||||
return $result;
|
||||
}
|
||||
# Wait for next process to exit
|
||||
@@ -4121,6 +4162,7 @@ sub check_warnings ($) {
|
||||
# Kill any check processes still running
|
||||
map($_->kill(), values(%started));
|
||||
|
||||
mark_time_used('ch-warn');
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -5084,6 +5126,8 @@ sub start_mysqltest ($) {
|
||||
my $exe= $exe_mysqltest;
|
||||
my $args;
|
||||
|
||||
mark_time_used('init');
|
||||
|
||||
mtr_init_args(\$args);
|
||||
|
||||
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
|
||||
@@ -5565,6 +5609,8 @@ Options to control directories to use
|
||||
for tmpfs (/dev/shm)
|
||||
The option can also be set using environment
|
||||
variable MTR_MEM=[DIR]
|
||||
clean-vardir Clean vardir if tests were successful and if
|
||||
running in "memory". Otherwise this option is ignored
|
||||
client-bindir=PATH Path to the directory where client binaries are located
|
||||
client-libdir=PATH Path to the directory where client libraries are located
|
||||
|
||||
@@ -5724,6 +5770,8 @@ Misc options
|
||||
default-myisam Set default storage engine to MyISAM for non-innodb
|
||||
tests. This is needed after switching default storage
|
||||
engine to InnoDB.
|
||||
report-times Report how much time has been spent on different
|
||||
phases of test execution.
|
||||
HERE
|
||||
exit(1);
|
||||
|
||||
|
||||
@@ -3005,6 +3005,44 @@ EXECUTE stmt;
|
||||
1
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#54494 crash with explain extended and prepared statements
|
||||
#
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
|
||||
EXECUTE stmt;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
|
||||
EXECUTE stmt;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#54488 crash when using explain and prepared statements with subqueries
|
||||
#
|
||||
CREATE TABLE t1(f1 INT);
|
||||
INSERT INTO t1 VALUES (1),(1);
|
||||
PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
|
||||
EXECUTE stmt;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
|
||||
EXECUTE stmt;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
End of 5.1 tests.
|
||||
|
||||
|
||||
@@ -1379,9 +1379,6 @@ MESSAGE_TEXT = msg,
|
||||
MYSQL_ERRNO = 1012;
|
||||
end $$
|
||||
insert into t1 values (1), (2) $$
|
||||
Warnings:
|
||||
Warning 1012 This trigger SIGNAL a warning, a=1
|
||||
Warning 1012 This trigger SIGNAL a warning, a=2
|
||||
drop trigger t1_ai $$
|
||||
create trigger t1_ai after insert on t1 for each row
|
||||
begin
|
||||
@@ -1416,11 +1413,7 @@ MESSAGE_TEXT = NEW.msg,
|
||||
MYSQL_ERRNO = NEW.errno;
|
||||
end $$
|
||||
insert into t1 set errno=1012, msg='Warning message 1 in trigger' $$
|
||||
Warnings:
|
||||
Warning 1012 Warning message 1 in trigger
|
||||
insert into t1 set errno=1013, msg='Warning message 2 in trigger' $$
|
||||
Warnings:
|
||||
Warning 1013 Warning message 2 in trigger
|
||||
drop table t1 $$
|
||||
drop table if exists t1 $$
|
||||
drop procedure if exists p1 $$
|
||||
|
||||
@@ -1877,9 +1877,6 @@ DROP PROCEDURE p1;
|
||||
#
|
||||
# Bug#5889: Exit handler for a warning doesn't hide the warning in trigger
|
||||
#
|
||||
|
||||
# - Case 1
|
||||
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1, 2);
|
||||
CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
|
||||
@@ -1889,40 +1886,13 @@ SET NEW.a = 10;
|
||||
SET NEW.a = 99999999999;
|
||||
END|
|
||||
UPDATE t1 SET b = 20;
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
10 20
|
||||
DROP TRIGGER t1_bu;
|
||||
DROP TABLE t1;
|
||||
|
||||
# - Case 2
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(b CHAR(1));
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t2 VALUES('ab'); # Produces a warning.
|
||||
INSERT INTO t2 VALUES('b'); # Does not produce a warning,
|
||||
# previous warning should be cleared.
|
||||
END|
|
||||
INSERT INTO t1 VALUES(0);
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
SELECT * FROM t2;
|
||||
b
|
||||
a
|
||||
b
|
||||
DROP TRIGGER t1_bi;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
#
|
||||
# Bug#9857: Stored procedures: handler for sqlwarning ignored
|
||||
#
|
||||
@@ -1961,3 +1931,64 @@ Warning 1365 Division by 0
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
SET sql_mode = @sql_mode_saved;
|
||||
#
|
||||
# Bug#55850: Trigger warnings not cleared.
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
|
||||
CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT,
|
||||
d SMALLINT, e SMALLINT, f SMALLINT);
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2(a, b, c) VALUES(99999, 99999, 99999);
|
||||
CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2(d, e, f) VALUES(99999, 99999, 99999);
|
||||
CREATE PROCEDURE p1()
|
||||
INSERT INTO t1 VALUES(99999, 99999, 99999);
|
||||
|
||||
CALL p1();
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'x' at row 1
|
||||
Warning 1264 Out of range value for column 'y' at row 1
|
||||
Warning 1264 Out of range value for column 'z' at row 1
|
||||
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1264 Out of range value for column 'x' at row 1
|
||||
Warning 1264 Out of range value for column 'y' at row 1
|
||||
Warning 1264 Out of range value for column 'z' at row 1
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
# ----------------------------------------------------------------------
|
||||
CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
|
||||
CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT NOT NULL);
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t2 VALUES(
|
||||
CAST('111111 ' AS SIGNED),
|
||||
CAST('222222 ' AS SIGNED),
|
||||
NULL);
|
||||
END|
|
||||
CREATE PROCEDURE p1()
|
||||
INSERT INTO t1 VALUES(99999, 99999, 99999);
|
||||
|
||||
CALL p1();
|
||||
ERROR 23000: Column 'c' cannot be null
|
||||
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1264 Out of range value for column 'x' at row 1
|
||||
Warning 1264 Out of range value for column 'y' at row 1
|
||||
Warning 1264 Out of range value for column 'z' at row 1
|
||||
Warning 1292 Truncated incorrect INTEGER value: '111111 '
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
Warning 1292 Truncated incorrect INTEGER value: '222222 '
|
||||
Warning 1264 Out of range value for column 'b' at row 1
|
||||
Error 1048 Column 'c' cannot be null
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
@@ -1072,8 +1072,6 @@ SELECT @x;
|
||||
NULL
|
||||
SET @x=2;
|
||||
UPDATE t1 SET i1 = @x;
|
||||
Warnings:
|
||||
Warning 1365 Division by 0
|
||||
SELECT @x;
|
||||
@x
|
||||
NULL
|
||||
@@ -1085,9 +1083,6 @@ SELECT @x;
|
||||
NULL
|
||||
SET @x=4;
|
||||
UPDATE t1 SET i1 = @x;
|
||||
Warnings:
|
||||
Warning 1365 Division by 0
|
||||
Warning 1365 Division by 0
|
||||
SELECT @x;
|
||||
@x
|
||||
NULL
|
||||
@@ -1198,8 +1193,6 @@ Warnings:
|
||||
Warning 1365 Division by 0
|
||||
create trigger t1_bi before insert on t1 for each row set @a:=1/0|
|
||||
insert into t1 values(20, 20)|
|
||||
Warnings:
|
||||
Warning 1365 Division by 0
|
||||
drop trigger t1_bi|
|
||||
create trigger t1_bi before insert on t1 for each row
|
||||
begin
|
||||
@@ -1218,8 +1211,6 @@ set @a:=1/0;
|
||||
end|
|
||||
set @check=0, @t4_bi_called=0, @t4_bu_called=0|
|
||||
insert into t1 values(30, 30)|
|
||||
Warnings:
|
||||
Warning 1365 Division by 0
|
||||
select @check, @t4_bi_called, @t4_bu_called|
|
||||
@check @t4_bi_called @t4_bu_called
|
||||
2 1 1
|
||||
@@ -2090,12 +2081,8 @@ SELECT 1 FROM t1 c WHERE
|
||||
END//
|
||||
SET @bug51650 = 1;
|
||||
INSERT IGNORE INTO t2 VALUES();
|
||||
Warnings:
|
||||
Warning 1329 No data - zero rows fetched, selected, or processed
|
||||
INSERT IGNORE INTO t1 SET b = '777';
|
||||
INSERT IGNORE INTO t2 SET a = '111';
|
||||
Warnings:
|
||||
Warning 1329 No data - zero rows fetched, selected, or processed
|
||||
SET @bug51650 = 1;
|
||||
INSERT IGNORE INTO t2 SET a = '777';
|
||||
DROP TRIGGER trg1;
|
||||
@@ -2177,8 +2164,6 @@ SELECT 'ab' INTO a;
|
||||
SELECT 'a' INTO a;
|
||||
END|
|
||||
INSERT INTO t1 VALUES (1);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
DROP TRIGGER trg1;
|
||||
DROP TABLE t1;
|
||||
DROP TRIGGER IF EXISTS trg1;
|
||||
@@ -2196,20 +2181,12 @@ DECLARE trg2 CHAR;
|
||||
SELECT 'ab' INTO trg2;
|
||||
END|
|
||||
INSERT INTO t1 VALUES (0);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'trg1' at row 1
|
||||
Warning 1265 Data truncated for column 'trg2' at row 1
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'trg1' at row 1
|
||||
Warning 1265 Data truncated for column 'trg2' at row 1
|
||||
Warning 1265 Data truncated for column 'trg1' at row 1
|
||||
Warning 1265 Data truncated for column 'trg2' at row 1
|
||||
DROP TRIGGER trg1;
|
||||
DROP TRIGGER trg2;
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -321,7 +321,7 @@ while (`SELECT $unsafe_type < 9`) {
|
||||
--source extra/rpl_tests/create_recursive_construct.inc
|
||||
|
||||
# Drop created object.
|
||||
if (`SELECT '$drop_3' != ''`) {
|
||||
if ($drop_3) {
|
||||
--eval $drop_3
|
||||
}
|
||||
--inc $call_type_3
|
||||
@@ -330,7 +330,7 @@ while (`SELECT $unsafe_type < 9`) {
|
||||
} # if (!is_toplevel_2)
|
||||
|
||||
# Drop created object.
|
||||
if (`SELECT '$drop_2' != ''`) {
|
||||
if ($drop_2) {
|
||||
--eval $drop_2
|
||||
}
|
||||
--inc $call_type_2
|
||||
@@ -338,7 +338,7 @@ while (`SELECT $unsafe_type < 9`) {
|
||||
} # if (!is_toplevel_1)
|
||||
|
||||
# Drop created object.
|
||||
if (`SELECT '$drop_1' != ''`) {
|
||||
if ($drop_1) {
|
||||
--eval $drop_1
|
||||
}
|
||||
--inc $call_type_1
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763
|
||||
binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
|
||||
binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
|
||||
|
||||
@@ -353,8 +353,6 @@ B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
C Test 3.5.8.5-case 00200 0000000001 C=one
|
||||
Insert into tb3 (f120, f122, f136)
|
||||
values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
|
||||
f120 f122 f136 f144 @test_var
|
||||
@@ -364,8 +362,6 @@ B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
|
||||
f120 f122 f136 f144 @test_var
|
||||
|
||||
@@ -354,8 +354,6 @@ B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
C Test 3.5.8.5-case 00200 0000000001 C=one
|
||||
Insert into tb3 (f120, f122, f136)
|
||||
values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
|
||||
f120 f122 f136 f144 @test_var
|
||||
@@ -365,8 +363,6 @@ B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
|
||||
f120 f122 f136 f144 @test_var
|
||||
|
||||
@@ -354,8 +354,6 @@ B Test 3.5.8.5-case 00191 0000000016 C=one
|
||||
C Test 3.5.8.5-case 00200 0000000001 C=one
|
||||
Insert into tb3 (f120, f122, f136)
|
||||
values ('d', 'Test 3.5.8.5-case', 152);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
|
||||
f120 f122 f136 f144 @test_var
|
||||
@@ -365,8 +363,6 @@ B Test 3.5.8.5-case 00191 0000000016 1*0000099999
|
||||
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
|
||||
Insert into tb3 (f120, f122, f136, f144)
|
||||
values ('e', 'Test 3.5.8.5-case', 200, 8);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f120' at row 1
|
||||
select f120, f122, f136, f144, @test_var
|
||||
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
|
||||
f120 f122 f136 f144 @test_var
|
||||
|
||||
10
mysql-test/suite/innodb/r/innodb_bug57255.result
Normal file
10
mysql-test/suite/innodb/r/innodb_bug57255.result
Normal file
@@ -0,0 +1,10 @@
|
||||
create table A(id int not null primary key) engine=innodb;
|
||||
create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
|
||||
create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
|
||||
insert into A values(1), (2);
|
||||
DELETE FROM A where id = 1;
|
||||
DELETE FROM C where f1 = 2;
|
||||
DELETE FROM A where id = 1;
|
||||
DROP TABLE C;
|
||||
DROP TABLE B;
|
||||
DROP TABLE A;
|
||||
36
mysql-test/suite/innodb/t/innodb_bug57255.test
Normal file
36
mysql-test/suite/innodb/t/innodb_bug57255.test
Normal file
@@ -0,0 +1,36 @@
|
||||
# Test Bug #57255. Cascade deletes that affect different rows should not
|
||||
# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
create table A(id int not null primary key) engine=innodb;
|
||||
|
||||
create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
|
||||
|
||||
create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
|
||||
|
||||
insert into A values(1), (2);
|
||||
|
||||
--disable_query_log
|
||||
let $i=257;
|
||||
while ($i)
|
||||
{
|
||||
insert into B(f1) values(1);
|
||||
dec $i;
|
||||
}
|
||||
let $i=486;
|
||||
while ($i)
|
||||
{
|
||||
insert into C(f1) values(2);
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
# Following Deletes should not report error
|
||||
DELETE FROM A where id = 1;
|
||||
DELETE FROM C where f1 = 2;
|
||||
DELETE FROM A where id = 1;
|
||||
|
||||
DROP TABLE C;
|
||||
DROP TABLE B;
|
||||
DROP TABLE A;
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -10,8 +10,8 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
||||
|
||||
# Tests for PERFORMANCE_SCHEMA
|
||||
|
||||
@@ -26,17 +26,17 @@ update performance_schema.SETUP_CONSUMERS set enabled='YES';
|
||||
connect (con1, localhost, root, , );
|
||||
|
||||
let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID in (select connection_id())`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connect (con2, localhost, root, , );
|
||||
|
||||
let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID in (select connection_id())`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connect (con3, localhost, root, , );
|
||||
|
||||
let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID in (select connection_id())`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connection default;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
select * from performance_schema.THREADS
|
||||
where name like 'Thread/%' limit 1;
|
||||
THREAD_ID ID NAME
|
||||
THREAD_ID PROCESSLIST_ID NAME
|
||||
# # #
|
||||
select * from performance_schema.THREADS
|
||||
where name='FOO';
|
||||
THREAD_ID ID NAME
|
||||
THREAD_ID PROCESSLIST_ID NAME
|
||||
insert into performance_schema.THREADS
|
||||
set name='FOO', thread_id=1, id=2;
|
||||
set name='FOO', thread_id=1, processlist_id=2;
|
||||
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'THREADS'
|
||||
update performance_schema.THREADS
|
||||
set thread_id=12;
|
||||
|
||||
@@ -94,24 +94,9 @@ FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
|
||||
WHERE COUNT_STAR > 0
|
||||
ORDER BY SUM_TIMER_WAIT DESC
|
||||
LIMIT 10;
|
||||
SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
|
||||
# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
|
||||
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
|
||||
GROUP BY i.user
|
||||
ORDER BY SUM_WAIT DESC
|
||||
LIMIT 20;
|
||||
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
|
||||
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
WHERE p.ID = 1
|
||||
WHERE p.PROCESSLIST_ID = 1
|
||||
GROUP BY h.EVENT_NAME
|
||||
HAVING TOTAL_WAIT > 0;
|
||||
SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
|
||||
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
|
||||
GROUP BY i.user, h.operation
|
||||
HAVING BYTES > 0
|
||||
ORDER BY i.user, h.operation;
|
||||
|
||||
@@ -195,6 +195,6 @@ show create table THREADS;
|
||||
Table Create Table
|
||||
THREADS CREATE TABLE `THREADS` (
|
||||
`THREAD_ID` int(11) NOT NULL,
|
||||
`ID` int(11) NOT NULL,
|
||||
`NAME` varchar(64) NOT NULL
|
||||
`PROCESSLIST_ID` int(11) DEFAULT NULL,
|
||||
`NAME` varchar(128) NOT NULL
|
||||
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
|
||||
|
||||
@@ -84,22 +84,22 @@ id c
|
||||
13 [EVENT_ID]
|
||||
DROP TRIGGER t_ps_trigger;
|
||||
DROP PROCEDURE IF EXISTS t_ps_proc;
|
||||
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
|
||||
CREATE PROCEDURE t_ps_proc(IN conid INT, OUT pid INT)
|
||||
BEGIN
|
||||
SELECT id FROM performance_schema.THREADS
|
||||
WHERE THREAD_ID = tid INTO pid;
|
||||
SELECT thread_id FROM performance_schema.THREADS
|
||||
WHERE PROCESSLIST_ID = conid INTO pid;
|
||||
END;
|
||||
|
|
||||
CALL t_ps_proc(0, @p_id);
|
||||
CALL t_ps_proc(connection_id(), @p_id);
|
||||
DROP FUNCTION IF EXISTS t_ps_proc;
|
||||
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
|
||||
CREATE FUNCTION t_ps_func(conid INT) RETURNS int
|
||||
BEGIN
|
||||
return (SELECT id FROM performance_schema.THREADS
|
||||
WHERE THREAD_ID = tid);
|
||||
return (SELECT thread_id FROM performance_schema.THREADS
|
||||
WHERE PROCESSLIST_ID = conid);
|
||||
END;
|
||||
|
|
||||
SELECT t_ps_func(0) = @p_id;
|
||||
t_ps_func(0) = @p_id
|
||||
SELECT t_ps_func(connection_id()) = @p_id;
|
||||
t_ps_func(connection_id()) = @p_id
|
||||
1
|
||||
SELECT * FROM t_event;
|
||||
EVENT_ID
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -10,8 +10,8 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
||||
|
||||
# Tests for PERFORMANCE_SCHEMA
|
||||
|
||||
@@ -28,7 +28,7 @@ select * from performance_schema.THREADS
|
||||
--replace_result '\'threads' '\'THREADS'
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
insert into performance_schema.THREADS
|
||||
set name='FOO', thread_id=1, id=2;
|
||||
set name='FOO', thread_id=1, processlist_id=2;
|
||||
|
||||
--replace_result '\'threads' '\'THREADS'
|
||||
--error ER_TABLEACCESS_DENIED_ERROR
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2008-2009 Sun Microsystems, Inc
|
||||
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -10,8 +10,8 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
||||
|
||||
##
|
||||
## WL#4814, 4.1.4 FILE IO
|
||||
@@ -154,16 +154,16 @@ LIMIT 10;
|
||||
# Total and average wait time for different users
|
||||
#
|
||||
|
||||
--disable_result_log
|
||||
SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
|
||||
# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
|
||||
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
|
||||
GROUP BY i.user
|
||||
ORDER BY SUM_WAIT DESC
|
||||
LIMIT 20;
|
||||
--enable_result_log
|
||||
## --disable_result_log
|
||||
## SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
|
||||
## # ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
|
||||
## FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
## INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
## LEFT JOIN information_schema.PROCESSLIST i USING (ID)
|
||||
## GROUP BY i.user
|
||||
## ORDER BY SUM_WAIT DESC
|
||||
## LIMIT 20;
|
||||
## --enable_result_log
|
||||
|
||||
#
|
||||
# Total and average wait times for different events for a session
|
||||
@@ -172,7 +172,7 @@ LIMIT 20;
|
||||
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
|
||||
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
WHERE p.ID = 1
|
||||
WHERE p.PROCESSLIST_ID = 1
|
||||
GROUP BY h.EVENT_NAME
|
||||
HAVING TOTAL_WAIT > 0;
|
||||
--enable_result_log
|
||||
@@ -181,12 +181,12 @@ HAVING TOTAL_WAIT > 0;
|
||||
# Which user reads and writes data
|
||||
#
|
||||
|
||||
--disable_result_log
|
||||
SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
|
||||
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
|
||||
GROUP BY i.user, h.operation
|
||||
HAVING BYTES > 0
|
||||
ORDER BY i.user, h.operation;
|
||||
--enable_result_log
|
||||
## --disable_result_log
|
||||
## SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
|
||||
## FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
|
||||
## INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
|
||||
## LEFT JOIN information_schema.PROCESSLIST i USING (ID)
|
||||
## GROUP BY i.user, h.operation
|
||||
## HAVING BYTES > 0
|
||||
## ORDER BY i.user, h.operation;
|
||||
## --enable_result_log
|
||||
|
||||
@@ -136,17 +136,17 @@ DROP PROCEDURE IF EXISTS t_ps_proc;
|
||||
--enable_warnings
|
||||
delimiter |;
|
||||
|
||||
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
|
||||
CREATE PROCEDURE t_ps_proc(IN conid INT, OUT pid INT)
|
||||
BEGIN
|
||||
SELECT id FROM performance_schema.THREADS
|
||||
WHERE THREAD_ID = tid INTO pid;
|
||||
SELECT thread_id FROM performance_schema.THREADS
|
||||
WHERE PROCESSLIST_ID = conid INTO pid;
|
||||
END;
|
||||
|
||||
|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
CALL t_ps_proc(0, @p_id);
|
||||
CALL t_ps_proc(connection_id(), @p_id);
|
||||
|
||||
# FUNCTION
|
||||
|
||||
@@ -155,17 +155,17 @@ DROP FUNCTION IF EXISTS t_ps_proc;
|
||||
--enable_warnings
|
||||
delimiter |;
|
||||
|
||||
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
|
||||
CREATE FUNCTION t_ps_func(conid INT) RETURNS int
|
||||
BEGIN
|
||||
return (SELECT id FROM performance_schema.THREADS
|
||||
WHERE THREAD_ID = tid);
|
||||
return (SELECT thread_id FROM performance_schema.THREADS
|
||||
WHERE PROCESSLIST_ID = conid);
|
||||
END;
|
||||
|
||||
|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
SELECT t_ps_func(0) = @p_id;
|
||||
SELECT t_ps_func(connection_id()) = @p_id;
|
||||
|
||||
# We might reach this point too early which means the event scheduler has not
|
||||
# execute our "t_ps_event". Therefore we poll till the record was inserted
|
||||
|
||||
@@ -31,14 +31,14 @@ connect (con1, localhost, root, , );
|
||||
let $con1_ID=`select connection_id()`;
|
||||
|
||||
let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID = connection_id()`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connect (con2, localhost, root, , );
|
||||
|
||||
let $con2_ID=`select connection_id()`;
|
||||
|
||||
let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID = connection_id()`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connection default;
|
||||
|
||||
@@ -59,7 +59,7 @@ connect (con3, localhost, root, , );
|
||||
let $con3_ID=`select connection_id()`;
|
||||
|
||||
let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID = connection_id()`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
disconnect con3;
|
||||
disconnect con1;
|
||||
@@ -83,14 +83,14 @@ connect (con1, localhost, root, , );
|
||||
let $con1_ID=`select connection_id()`;
|
||||
|
||||
let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID = connection_id()`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connect (con2, localhost, root, , );
|
||||
|
||||
let $con2_ID=`select connection_id()`;
|
||||
|
||||
let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID = connection_id()`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
connection default;
|
||||
|
||||
@@ -109,7 +109,7 @@ connect (con3, localhost, root, , );
|
||||
let $con3_ID=`select connection_id()`;
|
||||
|
||||
let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
|
||||
where ID = connection_id()`;
|
||||
where PROCESSLIST_ID = connection_id()`;
|
||||
|
||||
disconnect con3;
|
||||
disconnect con1;
|
||||
|
||||
@@ -69,15 +69,9 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C
|
||||
UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
|
||||
INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
|
||||
UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
|
||||
Warnings:
|
||||
Error 1329 No data - zero rows fetched, selected, or processed
|
||||
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
|
||||
DELETE FROM test.t1 WHERE id = 1;
|
||||
Warnings:
|
||||
Error 1329 No data - zero rows fetched, selected, or processed
|
||||
DELETE FROM test.t2 WHERE id = 1;
|
||||
Warnings:
|
||||
Error 1329 No data - zero rows fetched, selected, or processed
|
||||
DROP TRIGGER test.t1_bi;
|
||||
DROP TRIGGER test.t2_ai;
|
||||
DROP TRIGGER test.t1_bu;
|
||||
|
||||
@@ -119,7 +119,7 @@ echo [on master];
|
||||
|
||||
# This will block the execution of a statement at the DBUG_SYNC_POINT
|
||||
# with given lock name
|
||||
if (`SELECT '$debug_lock' != ''`)
|
||||
if ($debug_lock)
|
||||
{
|
||||
disable_query_log;
|
||||
disable_result_log;
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX
|
||||
mysqlhotcopy_myisam : Bug#54129 2010-08-31 alik mysqlhotcopy* fails
|
||||
mysqlhotcopy_archive : Bug#54129 2010-08-31 alik mysqlhotcopy* fails
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
|
||||
sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution
|
||||
ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
|
||||
main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
|
||||
main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
|
||||
|
||||
@@ -331,7 +331,7 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
|
||||
--exec illegal_command
|
||||
--cat_file does_not_exist
|
||||
--perl
|
||||
exit(1);
|
||||
exit(2);
|
||||
EOF
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
@@ -3079,7 +3079,27 @@ EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
###########################################################################
|
||||
--echo #
|
||||
--echo # Bug#54494 crash with explain extended and prepared statements
|
||||
--echo #
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
|
||||
EXECUTE stmt;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#54488 crash when using explain and prepared statements with subqueries
|
||||
--echo #
|
||||
CREATE TABLE t1(f1 INT);
|
||||
INSERT INTO t1 VALUES (1),(1);
|
||||
PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
|
||||
EXECUTE stmt;
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo End of 5.1 tests.
|
||||
|
||||
@@ -2719,10 +2719,6 @@ DROP PROCEDURE p1;
|
||||
--echo # Bug#5889: Exit handler for a warning doesn't hide the warning in trigger
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo # - Case 1
|
||||
--echo
|
||||
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1, 2);
|
||||
|
||||
@@ -2747,36 +2743,6 @@ SELECT * FROM t1;
|
||||
DROP TRIGGER t1_bu;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # - Case 2
|
||||
--echo
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(b CHAR(1));
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t2 VALUES('ab'); # Produces a warning.
|
||||
|
||||
INSERT INTO t2 VALUES('b'); # Does not produce a warning,
|
||||
# previous warning should be cleared.
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
INSERT INTO t1 VALUES(0);
|
||||
|
||||
SHOW WARNINGS;
|
||||
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TRIGGER t1_bi;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#9857: Stored procedures: handler for sqlwarning ignored
|
||||
--echo #
|
||||
@@ -2813,3 +2779,83 @@ SHOW WARNINGS;
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
SET sql_mode = @sql_mode_saved;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55850: Trigger warnings not cleared.
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
|
||||
CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT,
|
||||
d SMALLINT, e SMALLINT, f SMALLINT);
|
||||
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2(a, b, c) VALUES(99999, 99999, 99999);
|
||||
|
||||
CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
|
||||
INSERT INTO t2(d, e, f) VALUES(99999, 99999, 99999);
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
INSERT INTO t1 VALUES(99999, 99999, 99999);
|
||||
|
||||
# What happened before the patch was:
|
||||
# - INSERT INTO t1 added 3 warnings about overflow in 'x', 'y' and 'z' columns;
|
||||
# - t1_bi run and added 3 warnings about overflow in 'a', 'b' and 'c' columns;
|
||||
# - t1_ai run and added 3 warnings about overflow in 'd', 'e' and 'f' columns;
|
||||
# => we had 9 warnings.
|
||||
#
|
||||
# Now what happens is:
|
||||
# - INSERT INTO t1 adds 3 warnings about overflow in 'x', 'y' and 'z' columns;
|
||||
# - t1_bi adds 3 warnings about overflow in 'a', 'b' and 'c' columns;
|
||||
# - The warnings added by triggers are cleared;
|
||||
# - t1_ai run and added 3 warnings about overflow in 'd', 'e' and 'f' columns;
|
||||
# - The warnings added by triggers are cleared;
|
||||
# => we have 3 warnings.
|
||||
|
||||
--echo
|
||||
CALL p1();
|
||||
|
||||
--echo
|
||||
SHOW WARNINGS;
|
||||
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo # ----------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
|
||||
CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT NOT NULL);
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t2 VALUES(
|
||||
CAST('111111 ' AS SIGNED),
|
||||
CAST('222222 ' AS SIGNED),
|
||||
NULL);
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
INSERT INTO t1 VALUES(99999, 99999, 99999);
|
||||
|
||||
--echo
|
||||
--error ER_BAD_NULL_ERROR
|
||||
CALL p1();
|
||||
|
||||
--echo
|
||||
SHOW WARNINGS;
|
||||
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
@@ -53,7 +53,7 @@ while (!`select @aborted_clients`)
|
||||
dec $retries;
|
||||
if (!$retries)
|
||||
{
|
||||
Failed to detect that client has been aborted;
|
||||
die Failed to detect that client has been aborted;
|
||||
}
|
||||
}
|
||||
--enable_query_log
|
||||
@@ -108,7 +108,7 @@ while (!`select @aborted_clients`)
|
||||
dec $retries;
|
||||
if (!$retries)
|
||||
{
|
||||
Failed to detect that client has been aborted;
|
||||
die Failed to detect that client has been aborted;
|
||||
}
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
Reference in New Issue
Block a user