Commit 600d4062 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.1-maint2

into  shellback.(none):/home/msvensson/mysql/mysql-5.1-mtr


mysql-test/lib/My/SafeProcess.pm:
  Auto merged
mysql-test/lib/mtr_cases.pm:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
parents 02a784ef 551a899c
......@@ -1313,12 +1313,26 @@ void show_diff(DYNAMIC_STRING* ds,
const char* filename1, const char* filename2)
{
const char* diff_failed= 0;
DYNAMIC_STRING ds_tmp;
if (init_dynamic_string(&ds_tmp, "", 256, 256))
die("Out of memory");
/* First try with diff --help to see if the command exists at all */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
"--help",
"2>&1",
NULL) != 0) /* Most "diff --help" tools return 0 */
{
diff_failed= "You don't appear to have diff installed";
}
else
{
dynstr_set(&ds_tmp, "");
/* First try with unified diff */
if (run_tool("diff",
&ds_tmp, /* Get output from diff in ds_tmp */
"-u",
......@@ -1337,18 +1351,26 @@ void show_diff(DYNAMIC_STRING* ds,
filename2,
"2>&1",
NULL) > 1) /* Most "diff" tools return >1 if error */
{
dynstr_set(&ds_tmp, "");
diff_failed= "Could not execute 'diff -u' or 'diff -c'";
}
}
}
if (diff_failed)
{
/*
Fallback to dump both files to result file and inform
about installing "diff"
*/
dynstr_set(&ds_tmp, "");
dynstr_append(&ds_tmp, "\n");
dynstr_append(&ds_tmp, diff_failed);
dynstr_append(&ds_tmp,
"\n"
"The two files differ but it was not possible to execute 'diff' in\n"
"order to show only the difference, tried both 'diff -u' or 'diff -c'.\n"
"Instead the whole content of the two files was shown for you to diff manually. ;)\n\n"
"order to show only the difference. Instead the whole content of the\n"
"two files was shown for you to diff manually.\n\n"
"To get a better report you should install 'diff' on your system, which you\n"
"for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n"
#ifdef __WIN__
......@@ -1366,7 +1388,6 @@ void show_diff(DYNAMIC_STRING* ds,
cat_file(&ds_tmp, filename2);
dynstr_append(&ds_tmp, "<<<<\n");
}
}
if (ds)
{
......@@ -7385,6 +7406,9 @@ void do_get_replace(struct st_command *command)
if (!*from)
die("Wrong number of arguments to replace_result in '%s'",
command->query);
#ifdef __WIN__
fix_win_paths(to, from - to);
#endif
insert_pointer_name(&from_array,to);
to= get_string(&buff, &from, command);
insert_pointer_name(&to_array,to);
......
......@@ -17,7 +17,7 @@ while ($mysql_errno)
{
if (!$counter)
{
die("Failed while waiting for mysqld to come out of readonly mode");
die Failed while waiting for mysqld to come out of readonly mode;
}
dec $counter;
--sleep 0.1
......
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
package My::Options;
#
# Utility functions to work with list of options
#
use strict;
sub same($$) {
my $l1= shift;
my $l2= shift;
return compare($l1,$l2) == 0;
}
sub compare ($$) {
my $l1= shift;
my $l2= shift;
my @l1= @$l1;
my @l2= @$l2;
return -1 if @l1 < @l2;
return 1 if @l1 > @l2;
while ( @l1 ) # Same length
{
my $e1= shift @l1;
my $e2= shift @l2;
my $cmp= ($e1 cmp $e2);
return $cmp if $cmp != 0;
}
return 0; # They are the same
}
sub _split_option {
my ($option)= @_;
if ($option=~ /^--(.*)=(.*)$/){
return ($1, $2);
}
elsif ($option=~ /^--(.*)$/){
return ($1, undef)
}
elsif ($option=~ /^(.*)=(.*)$/){
return ($1, $2)
}
elsif ($option=~ /^-O$/){
return (undef, undef);
}
die "Unknown option format '$option'";
}
sub _build_option {
my ($name, $value)= @_;
if ($name =~ /^O, /){
return "-".$name."=".$value;
}
elsif ($value){
return "--".$name."=".$value;
}
return "--".$name;
}
#
# Compare two list of options and return what would need
# to be done to get the server running with the new settings
#
sub diff {
my ($from_opts, $to_opts)= @_;
my %from;
foreach my $from (@$from_opts)
{
my ($opt, $value)= _split_option($from);
next unless defined($opt);
$from{$opt}= $value;
}
#print "from: ", %from, "\n";
my %to;
foreach my $to (@$to_opts)
{
my ($opt, $value)= _split_option($to);
next unless defined($opt);
$to{$opt}= $value;
}
#print "to: ", %to, "\n";
# Remove the ones that are in both lists
foreach my $name (keys %from){
if (exists $to{$name} and $to{$name} eq $from{$name}){
#print "removing '$name' from both lists\n";
delete $to{$name};
delete $from{$name};
}
}
#print "from: ", %from, "\n";
#print "to: ", %to, "\n";
# Add all keys in "to" to result
my @result;
foreach my $name (keys %to){
push(@result, _build_option($name, $to{$name}));
}
# Add all keys in "from" that are not in "to"
# to result as "set to default"
foreach my $name (keys %from){
if (not exists $to{$name}) {
push(@result, _build_option($name, "default"));
}
}
return @result;
}
sub is_set {
my ($opts, $set_opts)= @_;
foreach my $opt (@$opts){
my ($opt_name1, $value1)= _split_option($opt);
foreach my $set_opt (@$set_opts){
my ($opt_name2, $value2)= _split_option($set_opt);
if ($opt_name1 eq $opt_name2){
# Option already set
return 1;
}
}
}
return 0;
}
sub toSQL {
my (@options)= @_;
my @sql;
foreach my $option (@options) {
my ($name, $value)= _split_option($option);
#print "name: $name\n";
#print "value: $value\n";
if ($name =~ /^O, (.*)/){
push(@sql, "SET GLOBAL $1=$value");
}
elsif ($name =~ /^set-variable=(.*)/){
push(@sql, "SET GLOBAL $1=$value");
}
else {
my $sql_name= $name;
$sql_name=~ s/-/_/g;
push(@sql, "SET GLOBAL $sql_name=$value");
}
}
return join("; ", @sql);
}
sub toStr {
my $name= shift;
return "$name: ",
"['", join("', '", @_), "']\n";
}
1;
......@@ -85,6 +85,24 @@ BEGIN {
}
}
END {
# Kill any children still running
for my $proc (values %running){
if ( $proc->is_child($$) ){
print "Killing: $proc\n";
$proc->kill();
}
}
}
sub is_child {
my ($self, $parent_pid)= @_;
die "usage: \$safe_proc->is_child()" unless (@_ == 2 and ref $self);
return ($self->{PARENT} == $parent_pid);
}
# Find the safe process binary or script
my @safe_process_cmd;
my $safe_kill;
......@@ -96,7 +114,7 @@ if (IS_WIN32PERL or IS_CYGWIN){
push(@safe_process_cmd, $exe);
# Use my_safe_kill.exe
my $safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
$safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
die "Could not find my_safe_kill" unless $safe_kill;
}
else
......@@ -185,6 +203,7 @@ sub new {
SAFE_WINPID => $winpid,
SAFE_NAME => $name,
SAFE_SHUTDOWN => $shutdown,
PARENT => $$,
}, $class);
# Put the new process in list of running
......@@ -216,6 +235,7 @@ sub timer {
({
SAFE_PID => $pid,
SAFE_NAME => "timer",
PARENT => $$,
}, $class);
# Put the new process in list of running
......
......@@ -31,12 +31,13 @@ our $skip_rpl;
our $do_test;
our $skip_test;
our $opt_skip_combination;
our $binlog_format;;
our $binlog_format;
our $enable_disabled;
our $default_storage_engine;
our $opt_with_ndbcluster_only;
our $defaults_file;
our $defaults_extra_file;
our $reorder;
sub collect_option {
my ($opt, $value)= @_;
......@@ -83,8 +84,9 @@ sub init_pattern {
#
##############################################################################
sub collect_test_cases ($) {
sub collect_test_cases ($$) {
my $suites= shift; # Semicolon separated list of test suites
my $opt_cases= shift;
my $cases= []; # Array of hash(one hash for each testcase)
$do_test_reg= init_pattern($do_test, "--do-test");
......@@ -92,15 +94,15 @@ sub collect_test_cases ($) {
foreach my $suite (split(",", $suites))
{
push(@$cases, collect_one_suite($suite));
push(@$cases, collect_one_suite($suite, $opt_cases));
}
if ( @::opt_cases )
if ( @$opt_cases )
{
# A list of tests was specified on the command line
# Check that the tests specified was found
# in at least one suite
foreach my $test_name_spec ( @::opt_cases )
foreach my $test_name_spec ( @$opt_cases )
{
my $found= 0;
my ($sname, $tname, $extension)= split_testname($test_name_spec);
......@@ -119,7 +121,7 @@ sub collect_test_cases ($) {
}
}
if ( $::opt_reorder )
if ( $reorder )
{
# Reorder the test cases in an order that will make them faster to run
my %sort_criteria;
......@@ -172,7 +174,8 @@ sub collect_test_cases ($) {
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
push(@criteria, join("!", sort @{$opts}) . "~");
$sort_criteria{$test_name} = join(" ", @criteria);
}
......@@ -236,6 +239,7 @@ sub split_testname {
sub collect_one_suite($)
{
my $suite= shift; # Test suite name
my $opt_cases= shift;
my @cases; # Array of hash
mtr_verbose("Collecting: $suite");
......@@ -304,10 +308,10 @@ sub collect_one_suite($)
$suite_opts= opts_from_file($suite_opt_file);
}
if ( @::opt_cases )
if ( @$opt_cases )
{
# Collect in specified order
foreach my $test_name_spec ( @::opt_cases )
foreach my $test_name_spec ( @$opt_cases )
{
my ($sname, $tname, $extension)= split_testname($test_name_spec);
......@@ -428,9 +432,18 @@ sub collect_one_suite($)
{
foreach my $test (@cases)
{
#print $test->{name}, " ", $comb, "\n";
my $new_test= {};
next if ( $test->{'skip'} );
# Skip this combination if the values it provides
# already are set in master_opt or slave_opt
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
next;
}
# Copy test options
my $new_test= {};
while (my ($key, $value) = each(%$test)) {
if (ref $value eq "ARRAY") {
push(@{$new_test->{$key}}, @$value);
......@@ -450,6 +463,18 @@ sub collect_one_suite($)
push(@new_cases, $new_test);
}
}
# Add the plain test if it was not already added
# as part of a combination
my %added;
foreach my $new_test (@new_cases){
$added{$new_test->{name}}= 1;
}
foreach my $test (@cases){
push(@new_cases, $test) unless $added{$test->{name}};
}
#print_testcases(@new_cases);
@cases= @new_cases;
#print_testcases(@cases);
......@@ -481,6 +506,7 @@ sub optimize_cases {
# --mysqld=--binlog-format=x, skip all test that does not
# support it
# =======================================================
#print "binlog_format: $binlog_format\n";
if (defined $binlog_format )
{
# =======================================================
......@@ -488,6 +514,8 @@ sub optimize_cases {
# =======================================================
if ( defined $tinfo->{'binlog_formats'} )
{
#print "binlog_formats: ". join(", ", @{$tinfo->{binlog_formats}})."\n";
# The test supports different binlog formats
# check if the selected one is ok
my $supported=
......@@ -513,9 +541,8 @@ sub optimize_cases {
mtr_match_prefix($opt, "--binlog-format=") || $test_binlog_format;
}
if (defined $test_binlog_format)
{
if ( defined $tinfo->{binlog_formats} )
if (defined $test_binlog_format and
defined $tinfo->{binlog_formats} )
{
my $supported=
grep { $_ eq $test_binlog_format } @{$tinfo->{'binlog_formats'}};
......@@ -527,10 +554,6 @@ sub optimize_cases {
next;
}
}
# Save binlog format for dynamic switching
$tinfo->{binlog_format_switch}= $test_binlog_format;
}
}
}
}
......@@ -630,18 +653,26 @@ sub collect_one_test_case {
#print " filename: $filename\n";
# ----------------------------------------------------------------------
# Skip some tests silently
# Check --start-from
# ----------------------------------------------------------------------
if ( $start_from and $tname lt $start_from )
if ( $start_from )
{
return;
# start_from can be specified as [suite.].testname_prefix
my ($suite, $test, $ext)= split_testname($start_from);
if ( $suite and $suitename lt $suite){
return; # Skip silently
}
if ( $tname lt $test ){
return; # Skip silently
}
}
# ----------------------------------------------------------------------
# Set defaults
# ----------------------------------------------------------------------
my $tinfo= {};
$tinfo->{'name'}= basename($suitename) . ".$tname";
$tinfo->{'name'}= $suitename . ".$tname";
$tinfo->{'path'}= "$testdir/$filename";
# TODO allow nonexistsing result file
......@@ -871,8 +902,19 @@ sub collect_one_test_case {
my $config= "$suitedir/my.cnf";
if (! -f $config )
{
# Suite has no config, use default.cnf
# assume default.cnf will be used
$config= "include/default_my.cnf";
# Suite has no config, autodetect which one to use
if ( $tinfo->{rpl_test} ){
$config= "suite/rpl/my.cnf";
if ( $tinfo->{ndb_test} ){
$config= "suite/rpl_ndb/my.cnf";
}
}
elsif ( $tinfo->{ndb_test} ){
$config= "suite/ndb/my.cnf";
}
}
$tinfo->{template_path}= $config;
}
......@@ -882,6 +924,12 @@ sub collect_one_test_case {
$tinfo->{extra_template_path}= $defaults_extra_file;
}
# ----------------------------------------------------------------------
# Append mysqld extra options to both master and slave
# ----------------------------------------------------------------------
push(@{$tinfo->{'master_opt'}}, @::opt_extra_mysqld_opt);
push(@{$tinfo->{'slave_opt'}}, @::opt_extra_mysqld_opt);
return $tinfo;
}
......
......@@ -29,8 +29,6 @@ sub mtr_script_exists(@);
sub mtr_file_exists(@);
sub mtr_exe_exists(@);
sub mtr_exe_maybe_exists(@);
sub mtr_same_opts($$);
sub mtr_cmp_opts($$);
##############################################################################
#
......@@ -189,35 +187,6 @@ sub mtr_exe_exists (@) {
}
sub mtr_same_opts ($$) {
my $l1= shift;
my $l2= shift;
return mtr_cmp_opts($l1,$l2) == 0;
}
sub mtr_cmp_opts ($$) {
my $l1= shift;
my $l2= shift;
my @l1= @$l1;
my @l2= @$l2;
return -1 if @l1 < @l2;
return 1 if @l1 > @l2;
while ( @l1 ) # Same length
{
my $e1= shift @l1;
my $e2= shift @l2;
my $cmp= ($e1 cmp $e2);
return $cmp if $cmp != 0;
}
return 0; # They are the same
}
sub mtr_milli_sleep {
die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1;
my ($millis)= @_;
......@@ -225,33 +194,4 @@ sub mtr_milli_sleep {
select(undef, undef, undef, ($millis/1000));
}
#
# Compare two arrays and put all unequal elements into a new one
#
sub mtr_diff_opts ($$) {
my $l1= shift;
my $l2= shift;
my $found;
my @result;
foreach my $e1 (@$l1)
{
$found= undef;
foreach my $e2 (@$l2)
{
$found= 1 unless ($e1 ne $e2);
}
push(@result, $e1) unless (defined $found);
}
foreach my $e2 (@$l2)
{
$found= undef;
foreach my $e1 (@$l1)
{
$found= 1 unless ($e1 ne $e2);
}
push(@result, $e2) unless (defined $found);
}
return @result;
}
1;
......@@ -68,7 +68,9 @@ sub mtr_report_test_skipped ($) {
if ( $tinfo->{skip_detected_by_test} )
{
mtr_report("[ skip.] $tinfo->{'comment'}");
} else {
}
else
{
mtr_report("[ skip ] $tinfo->{'comment'}");
}
}
......@@ -90,7 +92,10 @@ sub mtr_report_test_passed ($$) {
$tot_real_time += ($timer/1000);
$timer= sprintf "%12s", $timer;
}
# Set as passed unless already set
if ( not defined $tinfo->{'result'} ){
$tinfo->{'result'}= 'MTR_RES_PASSED';
}
mtr_report("[ pass ] $timer");
}
......@@ -100,6 +105,8 @@ sub mtr_report_test_failed ($$) {
mtr_report_test_name($tinfo);
$tinfo->{'result'}= 'MTR_RES_FAILED';
my $test_failures= $tinfo->{'failures'} || 0;
$tinfo->{'failures'}= $test_failures + 1;
if ( defined $tinfo->{'timeout'} )
{
mtr_report("[ fail ] timeout");
......
# -*- cperl -*-
use Test::More qw(no_plan);
use strict;
use_ok("My::Options");
my @tests=
(
[
['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=ms'],
['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=statement'],
['--binlog-format=statement']
],
[
['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=statement'],
['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=mixed'],
['--binlog-format=mixed']
],
[
['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=mixed'],
['--binlog-format=row', '--loose-skip-innodb', '--binlog-format=statement'],
['--binlog-format=statement']
],
[
['--binlog-format=mixed', '--loose-skip-innodb', '--binlog-format=row'],
['--binlog-format=statement', '--loose-skip-innodb', '--binlog-format=row'],
[ ]
],
[
['--binlog-format=row'],
[ ],
['--binlog-format=default']
],
[
[ ],
['--binlog-format=row'],
['--binlog-format=row']
],
[
[ ],
['-O', 'max_binlog_size=1' ],
['--max_binlog_size=1' ]
],
[
['-O', 'max_binlog_size=1' ],
['-O', 'max_binlog_size=1' ],
[ ],
],
[
['-O', 'max_binlog_size=1' ],
[ ],
['--max_binlog_size=default' ]
],
[
[ ],
['-O', 'max_binlog_size=1', '--binlog-format=row' ],
['--max_binlog_size=1', '--binlog-format=row' ]
],
[
['--binlog-format=statement' ],
['-O', 'max_binlog_size=1', '--binlog-format=row' ],
['--max_binlog_size=1', '--binlog-format=row']
],
[
[ '--binlog-format=statement' ],
['-O', 'max_binlog_size=1', '--binlog-format=statement' ],
['--max_binlog_size=1' ]
],
[
[ '--binlog-format=statement' ],
['-O', 'max_binlog_size=1', '--binlog-format=statement' ],
['--max_binlog_size=1' ]
],
[
[ '--binlog-format=statement' ],
['--relay-log=/path/to/a/relay-log', '--binlog-format=row'],
['--relay-log=/path/to/a/relay-log', '--binlog-format=row' ]
],
[
[ '--binlog-format=statement' ],
['--relay-log=/path/to/a/relay-log', '-O', 'max_binlog_size=1'],
['--max_binlog_size=1', '--relay-log=/path/to/a/relay-log', '--binlog-format=default' ]
],
);
my $test_no= 0;
foreach my $test (@tests){
print "test", $test_no++, "\n";
foreach my $opts (@$test){
print My::Options::toStr("", @$opts);
}
my $from= $test->[0];
my $to= $test->[1];
my @result= My::Options::diff($from, $to);
ok(My::Options::same(\@result, $test->[2]));
if (!My::Options::same(\@result, $test->[2])){
print "failed\n";
print My::Options::toStr("result", @result);
print My::Options::toStr("expect", @{$test->[2]});
}
print My::Options::toSQL(@result), "\n";
print "\n";
}
This diff is collapsed.
reset master;
set timestamp=1000000000;
drop table if exists t1,t2,t3,t4,t5,t03,t04;
create table t1 (word varchar(20));
......
......@@ -17,22 +17,22 @@ TRUNCATE t1b;
TRUNCATE t1n;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
master-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; TRUNCATE t1m
master-bin.000001 # Query # # use `test`; TRUNCATE t1b
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1n)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; TRUNCATE t1n
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
mysqld-bin.000001 # Query # # use `test`; BEGIN
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c
mysqld-bin.000001 # Query # # use `test`; COMMIT
mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m
mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b
mysqld-bin.000001 # Query # # BEGIN
mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Query # # COMMIT
mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n
RESET MASTER;
SET SESSION BINLOG_FORMAT=MIXED;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
......@@ -48,18 +48,18 @@ TRUNCATE t1b;
TRUNCATE t1n;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
master-bin.000001 # Query # # use `test`; TRUNCATE t1m
master-bin.000001 # Query # # use `test`; TRUNCATE t1b
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1n)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; TRUNCATE t1n
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m
mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b
mysqld-bin.000001 # Query # # BEGIN
mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
mysqld-bin.000001 # Write_rows # # table_id: #
mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Query # # COMMIT
mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n
RESET MASTER;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
......@@ -74,13 +74,13 @@ UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t1m)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1n)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
mysqld-bin.000001 # Table_map # # table_id: # (test.t1m)
mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Query # # BEGIN
mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
mysqld-bin.000001 # Write_rows # # table_id: #
mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
mysqld-bin.000001 # Query # # COMMIT
RESET MASTER;
DROP TABLE t1m, t1b, t1n;
......@@ -246,7 +246,7 @@ if (0)
# Option, for displaying files:
# $ls= 1 (default)
# --> Display the table related directory content via
# "ls $MYSQLTEST_VARDIR/master-data/test/t1*"
# "ls $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*"
# if these informations were collected.
# This is probably not portable to some OS.
# $ls= 0
......@@ -410,7 +410,7 @@ if (0)
# 3. How to analyze a partitioning bug revealed with these tests/ How to build
# a small replay script from the monstrous protocols ?
#------------------------------------------------------------------------------#
# a) crash -- use the file var/master-data/mysql/general_log.CSV
# a) crash -- use the file var/mysqld.1/data/mysql/general_log.CSV
# b) no crash, but unexpected server response (there is no "reject file)
# -- use the file r/<testcase>.log
# Please be aware that the option $debug= 0 suppresses the
......
......@@ -35,16 +35,16 @@ let $unique= ;
--disable_query_log
# DATA DIRECTORY
# Make directory for partition data
--exec mkdir $MYSQLTEST_VARDIR/master-data/test/data || true
--exec mkdir $MYSQLTEST_VARDIR/mysqld.1/data/test/data || true
eval SET @data_dir = 'DATA DIRECTORY =
''''$MYSQLTEST_VARDIR/master-data/test/data''''';
''''$MYSQLTEST_VARDIR/mysqld.1/data/test/data''''';
let $data_directory = `select @data_dir`;
#INDEX DIRECTORY
# Make directory for partition index
--exec mkdir $MYSQLTEST_VARDIR/master-data/test/index || true
--exec mkdir $MYSQLTEST_VARDIR/mysqld.1/data/test/index || true
eval SET @indx_dir = 'INDEX DIRECTORY =
''''$MYSQLTEST_VARDIR/master-data/test/index''''';
''''$MYSQLTEST_VARDIR/mysqld.1/data/test/index''''';
let $index_directory = `select @indx_dir`;
let $with_directories= 1;
......@@ -78,16 +78,16 @@ if ($more_pk_ui_tests)
--disable_query_log
# DATA DIRECTORY
# Make directory for partition data
--exec mkdir $MYSQLTEST_VARDIR/master-data/test/data || true
--exec mkdir $MYSQLTEST_VARDIR/mysqld.1/data/test/data || true
eval SET @data_dir = 'DATA DIRECTORY =
''''$MYSQLTEST_VARDIR/master-data/test/data''''';
''''$MYSQLTEST_VARDIR/mysqld.1/data/test/data''''';
let $data_directory = `select @data_dir`;
#INDEX DIRECTORY
# Make directory for partition index
--exec mkdir $MYSQLTEST_VARDIR/master-data/test/index || true
--exec mkdir $MYSQLTEST_VARDIR/mysqld.1/data/test/index || true
eval SET @indx_dir = 'INDEX DIRECTORY =
''''$MYSQLTEST_VARDIR/master-data/test/index''''';
''''$MYSQLTEST_VARDIR/mysqld.1/data/test/index''''';
let $index_directory = `select @indx_dir`;
let $with_directories= TRUE;
......
......@@ -24,13 +24,13 @@ if ($no_debug)
if ($do_file_tests)
{
# List the files belonging to the table t1
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 || true
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/t1* > $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 || true
if ($with_directories)
{
--exec ls $MYSQLTEST_VARDIR/master-data/test/data/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 || true
--exec ls $MYSQLTEST_VARDIR/master-data/test/index/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 || true
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/data/t1* >> $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 || true
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/index/t1* >> $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 || true
}
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2'')');
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/mysqld.1/data/test/tmp2'')');
let $file_list= `SELECT @aux`;
}
if (!$do_file_tests)
......@@ -62,11 +62,11 @@ if ($found_garbage)
}
# Do a manual cleanup, because the following tests should not suffer from
# remaining files
--exec rm -f $MYSQLTEST_VARDIR/master-data/test/t1* || true
--exec rm -f $MYSQLTEST_VARDIR/mysqld.1/data/test/t1* || true
if ($with_directories)
{
--exec rm -f $MYSQLTEST_VARDIR/master-data/test/data/t1* || true
--exec rm -f $MYSQLTEST_VARDIR/master-data/test/index/t1* || true
--exec rm -f $MYSQLTEST_VARDIR/mysqld.1/data/test/data/t1* || true
--exec rm -f $MYSQLTEST_VARDIR/mysqld.1/data/test/index/t1* || true
}
}
--enable_query_log
......@@ -10,5 +10,5 @@ eval SHOW CREATE TABLE t1;
if ($ls)
{
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1*
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/t1*
}
......@@ -31,17 +31,17 @@ DELETE FROM t0_definition;
# - SHOW CREATE TABLE t1 is at least currently most probably more reliable than
# the corresponding SELECT on the INFORMATION_SCHEMA
# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/master-data/test/tmp1 2>&1 || true
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp1 2>&1 || true
if ($do_file_tests)
{
# List the files belonging to the table t1
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/t1* > $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 2>&1 || true
if ($with_directories)
{
--exec ls $MYSQLTEST_VARDIR/master-data/test/data/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
--exec ls $MYSQLTEST_VARDIR/master-data/test/index/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/data/t1* >> $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 2>&1 || true
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/index/t1* >> $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 2>&1 || true
}
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2''
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/mysqld.1/data/test/tmp2''
)');
let $file_list= `SELECT @aux`;
}
......@@ -52,7 +52,7 @@ let $file_list= '--- not determined ---';
# Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'old',
create_command = load_file('$MYSQLTEST_VARDIR/master-data/test/tmp1'),
create_command = load_file('$MYSQLTEST_VARDIR/mysqld.1/data/test/tmp1'),
file_list = $file_list;
# Print the create table statement into the protocol
......
......@@ -27,12 +27,12 @@ if ($no_debug)
DELETE FROM t0_definition WHERE state = 'new';
# Dump the current definition of the table t1 to tmp1
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/master-data/test/tmp1 2>&1 || true
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp1 2>&1 || true
if ($do_file_tests)
{
# List the files belonging to the table t1
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2'')');
--exec ls $MYSQLTEST_VARDIR/mysqld.1/data/test/t1* > $MYSQLTEST_VARDIR/mysqld.1/data/test/tmp2 2>&1 || true
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/mysqld.1/data/test/tmp2'')');
let $file_list= `SELECT @aux`;
}
if (!$do_file_tests)
......@@ -42,7 +42,7 @@ let $file_list= '--- not determined ---';
# Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'new',
create_command = load_file('$MYSQLTEST_VARDIR/master-data/test/tmp1'),
create_command = load_file('$MYSQLTEST_VARDIR/mysqld.1/data/test/tmp1'),
file_list = $file_list;
# Print the old and new table layout, if they differ
......
......@@ -83,9 +83,12 @@ eval insert into t3 values ($val1);
eval insert into t3 values ($val2);
eval insert into t3 values ($val3);
eval load data infile '../std_data_ln/parts/$infile' into table t4;
eval load data infile '../std_data_ln/parts/$infile' into table t5;
eval load data infile '../std_data_ln/parts/$infile' into table t6;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t4;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t5;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data infile '$MYSQLTEST_VARDIR/std_data/parts/$infile' into table t6;
eval select $sqlfunc from t1 order by col1;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,65 +4,65 @@ t55 CREATE TABLE `t55` (
`colint` int(11) DEFAULT NULL,
`col1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */
27 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp0.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp0.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp1.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp1.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp2.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp2.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp3.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp3.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp4.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p0#SP#p0sp4.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp0.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp0.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp1.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp1.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp2.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp2.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp3.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp3.MYI
36 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp4.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p1#SP#p1sp4.MYI
36 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp0.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp0.MYI
0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp1.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp1.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp2.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp2.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp3.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp3.MYI
27 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp4.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p2#SP#p2sp4.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp0.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp0.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp1.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp1.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp2.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp2.MYI
18 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp3.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp3.MYI
45 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp4.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p3#SP#p3sp4.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp0.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp0.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp1.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp1.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp2.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp2.MYI
0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp3.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp3.MYI
0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp4.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p4#SP#p4sp4.MYI
0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp0.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp0.MYI
0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp1.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp1.MYI
0 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp2.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp2.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp3.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp3.MYI
9 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp4.MYD
1024 MYSQL_TEST_DIR/var/master-data/test/t55#P#p5#SP#p5sp4.MYI
8594 MYSQL_TEST_DIR/var/master-data/test/t55.frm
408 MYSQL_TEST_DIR/var/master-data/test/t55.par
27 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp0.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp3.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p0#SP#p0sp4.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp0.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp1.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp3.MYI
36 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p1#SP#p1sp4.MYI
36 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp0.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp3.MYI
27 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p2#SP#p2sp4.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp0.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp2.MYI
18 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp3.MYI
45 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p3#SP#p3sp4.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp0.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp1.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp2.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp3.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p4#SP#p4sp4.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp0.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp0.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp1.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp1.MYI
0 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp2.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp2.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp3.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp3.MYI
9 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp4.MYD
1024 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55#P#p5#SP#p5sp4.MYI
8594 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55.frm
408 MYSQL_TEST_DIR/var/mysqld.1/data/test/t55.par
......@@ -34,16 +34,16 @@ let $col_new_list = new.f1,new.f2,new.f3 new.f4 ;
--disable_query_log
# DATA DIRECTORY
# Make directory for partition data
--exec mkdir $MYSQLTEST_VARDIR/master-data/tmpdata || true
--exec mkdir $MYSQLTEST_VARDIR/mysqld.1/data/tmpdata || true
eval SET @data_dir = 'DATA DIRECTORY =
''$MYSQLTEST_VARDIR/master-data/tmpdata''';
''$MYSQLTEST_VARDIR/mysqld.1/data/tmpdata''';
let $data_directory = `select @data_dir`;
#INDEX DIRECTORY
# Make directory for partition index
--exec mkdir $MYSQLTEST_VARDIR/master-data/tmpindex || true
--exec mkdir $MYSQLTEST_VARDIR/mysqld.1/data/tmpindex || true
eval SET @indx_dir = 'INDEX DIRECTORY =
''$MYSQLTEST_VARDIR/master-data/tmpindex''';
''$MYSQLTEST_VARDIR/mysqld.1/data/tmpindex''';
let $index_directory = `select @indx_dir`;
--enable_query_log
......
......@@ -52,7 +52,7 @@ report-host= 127.0.0.1
report-port= @mysqld.1.slave.port
report-user= root
skip-innodb
loose-skip-innodb
skip-slave-start
# Directory where slaves find the dumps generated by "load data"
......
--event-scheduler=on
--event-scheduler=on --force-restart
......@@ -4,6 +4,9 @@
-- source include/have_log_bin.inc
# Deletes all the binary logs
reset master;
# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
......
......@@ -30,7 +30,6 @@
#endif
my_bool have_tcpip=0;
static void my_win_init(void);
static my_bool win32_have_tcpip(void);
static my_bool win32_init_tcp_ip();
#else
#define my_win_init()
......@@ -233,29 +232,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
#ifdef __WIN__
/*
This code is specially for running MySQL, but it should work in
other cases too.
Inizializzazione delle variabili d'ambiente per Win a 32 bit.
Vengono inserite nelle variabili d'ambiente (utilizzando cosi'
le funzioni getenv e putenv) i valori presenti nelle chiavi
del file di registro:
HKEY_LOCAL_MACHINE\software\MySQL
Se la kiave non esiste nonn inserisce nessun valore
*/
/* Crea la stringa d'ambiente */
void setEnvString(char *ret, const char *name, const char *value)
{
DBUG_ENTER("setEnvString");
strxmov(ret, name,"=",value,NullS);
DBUG_VOID_RETURN ;
}
/*
my_parameter_handler
......@@ -305,17 +281,6 @@ int handle_rtc_failure(int err_type, const char *file, int line,
static void my_win_init(void)
{
HKEY hSoftMysql ;
DWORD dimName = 256 ;
DWORD dimData = 1024 ;
DWORD dimNameValueBuffer = 256 ;
DWORD dimDataValueBuffer = 1024 ;
DWORD indexValue = 0 ;
long retCodeEnumValue ;
char NameValueBuffer[256] ;
char DataValueBuffer[1024] ;
char EnvString[1271] ;
const char *targetKey = "Software\\MySQL" ;
DBUG_ENTER("my_win_init");
setlocale(LC_CTYPE, ""); /* To get right sortorder */
......@@ -343,42 +308,57 @@ static void my_win_init(void)
_tzset();
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,(LPCTSTR)targetKey,0,
KEY_READ,&hSoftMysql) != ERROR_SUCCESS)
DBUG_VOID_RETURN;
{
/*
** Ne legge i valori e li inserisce nell'ambiente
** suppone che tutti i valori letti siano di tipo stringa + '\0'
** Legge il valore con indice 0 e lo scarta
Open HKEY_LOCAL_MACHINE\SOFTWARE\MySQL and set any strings found
there as environment variables
*/
retCodeEnumValue = RegEnumValue(hSoftMysql, indexValue++,
(LPTSTR)NameValueBuffer, &dimNameValueBuffer,
NULL, NULL, (LPBYTE)DataValueBuffer,
&dimDataValueBuffer) ;
while (retCodeEnumValue != ERROR_NO_MORE_ITEMS)
HKEY key_handle;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCTSTR)"SOFTWARE\\MySQL",
0, KEY_READ, &key_handle) == ERROR_SUCCESS)
{
LONG ret;
DWORD index= 0;
DWORD type;
char key_name[256], key_data[1024];
size_t key_name_len= sizeof(key_name) - 1;
size_t key_data_len= sizeof(key_data) - 1;
while ((ret= RegEnumValue(key_handle, index++,
key_name, &key_name_len,
NULL, &type, (LPBYTE)&key_data,
&key_data_len)) != ERROR_NO_MORE_ITEMS)
{
char *my_env;
/* Crea la stringa d'ambiente */
setEnvString(EnvString, NameValueBuffer, DataValueBuffer) ;
char env_string[sizeof(key_name) + sizeof(key_data) + 2];
/* Inserisce i dati come variabili d'ambiente */
my_env=strdup(EnvString); /* variable for putenv must be allocated ! */
putenv(my_env) ;
if (ret == ERROR_MORE_DATA)
{
/* Registry value larger than 'key_data', skip it */
DBUG_PRINT("error", ("Skipped registry value that was too large"));
}
else if (ret == ERROR_SUCCESS)
{
if (type == REG_SZ)
{
strxmov(env_string, key_name, "=", key_data, NullS);
dimNameValueBuffer = dimName ;
dimDataValueBuffer = dimData ;
/* variable for putenv must be allocated ! */
putenv(strdup(env_string)) ;
}
}
else
{
/* Unhandled error, break out of loop */
break;
}
retCodeEnumValue = RegEnumValue(hSoftMysql, indexValue++,
NameValueBuffer, &dimNameValueBuffer,
NULL, NULL, (LPBYTE)DataValueBuffer,
&dimDataValueBuffer) ;
key_name_len= sizeof(key_name) - 1;
key_data_len= sizeof(key_data) - 1;
}
/* chiude la chiave */
RegCloseKey(hSoftMysql) ;
RegCloseKey(key_handle) ;
}
}
/* The following is used by time functions */
#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10)
......@@ -387,7 +367,8 @@ static void my_win_init(void)
FILETIME ft;
LARGE_INTEGER li, t_cnt;
DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency));
if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency))
if (QueryPerformanceFrequency((LARGE_INTEGER *)
&query_performance_frequency) == 0)
query_performance_frequency= 0;
else
{
......
......@@ -5138,6 +5138,7 @@ int ha_ndbcluster::create(const char *name,
strcmp(m_tabname, NDB_SCHEMA_TABLE) == 0))
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
single_user_mode = NdbDictionary::Table::SingleUserModeReadWrite;
......@@ -5963,6 +5964,7 @@ ha_ndbcluster::delete_table(ha_ndbcluster *h, Ndb *ndb,
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
/* ndb_share reference temporary */
......@@ -6144,6 +6146,7 @@ int ha_ndbcluster::delete_table(const char *name)
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
DBUG_ASSERT(ndb_schema_share);
DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
#endif
......@@ -6424,8 +6427,11 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(res);
}
#ifdef HAVE_NDB_BINLOG
if (!ndb_binlog_tables_inited && ndb_binlog_running)
if (!ndb_binlog_tables_inited)
{
table->db_stat|= HA_READ_ONLY;
sql_print_information("table '%s' opened read only", name);
}
#endif
DBUG_RETURN(0);
}
......@@ -6784,8 +6790,8 @@ static void ndbcluster_drop_database(handlerton *hton, char *path)
if (!ndb_schema_share)
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
DBUG_ASSERT(ndb_schema_share);
DBUG_VOID_RETURN;
//DBUG_RETURN(HA_ERR_NO_CONNECTION);
}
#endif
ndbcluster_drop_database_impl(path);
......
......@@ -879,12 +879,9 @@ int ndbcluster_setup_binlog_table_shares(THD *thd)
{
pthread_mutex_lock(&LOCK_open);
ndb_binlog_tables_inited= TRUE;
if (ndb_binlog_running)
{
if (ndb_extra_logging)
sql_print_information("NDB Binlog: ndb tables writable");
close_cached_tables((THD*) 0, 0, (TABLE_LIST*) 0, TRUE);
}
pthread_mutex_unlock(&LOCK_open);
/* Signal injector thread that all is setup */
pthread_cond_signal(&injector_cond);
......@@ -2029,6 +2026,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
ndb_schema_share->use_count));
free_share(&ndb_schema_share);
ndb_schema_share= 0;
ndb_binlog_tables_inited= 0;
pthread_mutex_unlock(&ndb_schema_share_mutex);
/* end protect ndb_schema_share */
......@@ -3226,6 +3224,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
share->key, share->use_count));
free_share(&ndb_apply_status_share);
ndb_apply_status_share= 0;
ndb_binlog_tables_inited= 0;
}
DBUG_PRINT("error", ("CLUSTER FAILURE EVENT: "
"%s received share: 0x%lx op: 0x%lx share op: 0x%lx "
......@@ -3245,6 +3244,7 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
share->key, share->use_count));
free_share(&ndb_apply_status_share);
ndb_apply_status_share= 0;
ndb_binlog_tables_inited= 0;
}
/* ToDo: remove printout */
if (ndb_extra_logging)
......@@ -4220,6 +4220,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
ndb_schema_share->use_count));
free_share(&ndb_schema_share);
ndb_schema_share= 0;
ndb_binlog_tables_inited= 0;
pthread_mutex_unlock(&ndb_schema_share_mutex);
/* end protect ndb_schema_share */
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment