From 845afae61e8edad52b9d985109852c914337efd1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Mar 2011 15:19:25 +0200 Subject: [PATCH 1/2] Allow -Wuninitialized without -O only for gcc 4.4 and upper --- BUILD/SETUP.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 0f97f265a52..c65955dd466 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -134,7 +134,6 @@ valgrind_configs="--with-valgrind" # # Used in -debug builds debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG" -debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized" debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC" error_inject="--with-error-inject " # @@ -209,6 +208,23 @@ if test -z "$CXX" ; then CXX=gcc fi + +# +# Set -Wuninitialized to debug flags for gcc 4.4 and above +# because it is allowed there without -O +# +if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then + GCCVERSION=`cc -v 2>&1 | tail -1 | sed 's/^\w\w* \w\w* //' | sed 's/ .*$//'` + GCCV1=`echo $GCCVERSION | sed 's/\..*$//'` + GCCV2=`echo $GCCVERSION | sed 's/[0-9][0-9]*\.//'|sed 's/\..*$//'` + if test '(' "$GCCV1" -gt '4' ')' -o \ + '(' '(' "$GCCV1" -eq '4' ')' -a '(' "$GCCV2" -ge '4' ')' ')' + then + debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized" + fi +fi + + # If ccache (a compiler cache which reduces build time) # (http://samba.org/ccache) is installed, use it. # We use 'grep' and hope 'grep' will work as expected From 97d46a0cd341dfce56c0a94a669e1832f51116f2 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Tue, 1 Mar 2011 15:31:24 +0200 Subject: [PATCH 2/2] Revoked changes from MySQL 5.1.55 merge as Sergei's code is more general --- mysql-test/lib/My/ConfigFactory.pm | 47 +++++++++++------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index 03be110f59d..b22e8bfb4b5 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -64,16 +64,12 @@ sub fix_pidfile { sub fix_port { my ($self, $config, $group_name, $group)= @_; - my $hostname= $group->value('#host'); - return $self->{HOSTS}->{$hostname}++; + return $self->{PORT}++; } sub fix_host { my ($self)= @_; - # Get next host from HOSTS array - my @hosts= keys(%{$self->{HOSTS}});; - my $host_no= $self->{NEXT_HOST}++ % @hosts; - return $hosts[$host_no]; + 'localhost' } sub is_unique { @@ -237,7 +233,7 @@ if (IS_WINDOWS) sub fix_ndb_mgmd_port { my ($self, $config, $group_name, $group)= @_; my $hostname= $group->value('HostName'); - return $self->{HOSTS}->{$hostname}++; + return $self->{PORT}++; } @@ -436,20 +432,24 @@ sub post_check_embedded_group { sub resolve_at_variable { my ($self, $config, $group, $option)= @_; + local $_ = $option->value(); + my ($res, $after); - # Split the options value on last . - my @parts= split(/\./, $option->value()); - my $option_name= pop(@parts); - my $group_name= join('.', @parts); - - $group_name =~ s/^\@//; # Remove at + while (m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g) { + my ($before, $group_name, $option_name)= ($1, $2, $3); + $after = $'; + chop($group_name); my $from_group= $config->group($group_name) or croak "There is no group named '$group_name' that ", "can be used to resolve '$option_name' for test '$self->{testname}'"; - my $from= $from_group->value($option_name); - $config->insert($group->name(), $option->name(), $from) + my $value= $from_group->value($option_name); + $res .= $before.$value; + } + $res .= $after; + + $config->insert($group->name(), $option->name(), $res) } @@ -461,7 +461,7 @@ sub post_fix_resolve_at_variables { next unless defined $option->value(); $self->resolve_at_variable($config, $group, $option) - if ($option->value() =~ /^\@/); + if ($option->value() =~ /\@/); } } } @@ -603,25 +603,12 @@ sub new_config { croak "you must pass '$required'" unless defined $args->{$required}; } - # Fill in hosts/port hash - my $hosts= {}; - my $baseport= $args->{baseport}; - $args->{hosts}= [ 'localhost' ] unless exists($args->{hosts}); - foreach my $host ( @{$args->{hosts}} ) { - $hosts->{$host}= $baseport; - } - # Open the config template my $config= My::Config->new($args->{'template_path'}); - my $extra_template_path= $args->{'extra_template_path'}; - if ($extra_template_path){ - $config->append(My::Config->new($extra_template_path)); - } my $self= bless { CONFIG => $config, ARGS => $args, - HOSTS => $hosts, - NEXT_HOST => 0, + PORT => $args->{baseport}, SERVER_ID => 1, testname => $args->{testname}, }, $class;