Re: Mysqld 3.23.56 crash on concurrent ALTER TABLE and FLUSH TABLE

Fred van Engen <[email protected]>
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Sergei,

On Thu, Jan 15, 2004 at 02:42:20PM +0100, Fred van Engen wrote:
> On Wed, Jan 14, 2004 at 05:39:09PM +0100, Sergei Golubchik wrote:
> > I failed to repeat this. I had two processes constantly doing
> > FLUSH+ALTER on two diffeent merge tables. Nothing crashed.
> >  
> 
> I reproduced it on 3.23.56 with this script:
> 
> #!/usr/local/bin/perl -w
> 
> my $basetable = shift @ARGV or die 'Need base table name';
> 
> print <<_EOT_;
> CREATE DATABASE IF NOT EXISTS test;
> use test;
> CREATE TABLE IF NOT EXISTS ${basetable}(id INT NOT NULL PRIMARY KEY) TYPE=MERGE;
> _EOT_
> 
> my @union;
> 
> for (my $n=1; $n; $n++) {
>         my $table = "$basetable$n";
> 
>         push @union, $table;
> 
>         my $drop = @union > 4 ? shift @union : undef;
> 
>         my $union = join(',', @union);
> 
>         print <<_EOT_;
> CREATE TABLE IF NOT EXISTS $table(id INT NOT NULL PRIMARY KEY);
> FLUSH TABLES;
> ALTER TABLE a UNION=($union);
> FLUSH TABLES;
> INSERT INTO $table(id) VALUES($n);
> SELECT * FROM $basetable;
> _EOT_

I put the INSERT and SELECT here because you couldn't reproduce the
crash with just FLUSH and ALTER TABLE and the above exactly reflects
the queries performed by the operational scripts.

My minimal test case has just these two queries (and the DROP below)
to let mysqld dump core:

        print <<_EOT_;
CREATE TABLE IF NOT EXISTS $table(id INT NOT NULL PRIMARY KEY);
ALTER TABLE a UNION=($union);
_EOT_


>         print <<_EOT_ if $drop;
> DROP TABLE $drop;
> _EOT_
> }
> 
> The commands that I ran were these:
> 
> ./test.pl a | /opt/mysql/bin/mysql --defaults-file=/tmp/fen/my.cnf  -u root -p
> ./test.pl b | /opt/mysql/bin/mysql --defaults-file=/tmp/fen/my.cnf  -u root -p
> 
> The server dumped core within less than 10 seconds.
> 


Regards,

Fred.

-- 
Fred van Engen                              XB Networks B.V.
email: [email protected]                Televisieweg 2
tel: +31 36 5462400                         1322 AC  Almere
fax: +31 36 5462424                         The Netherlands

-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.