Bug #28488 Incorrect information in file: './test/t1_test#.frm'
Submitted: 17 May 2007 5:19 Modified: 15 Jun 2007 9:27
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version:5.1.19 OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: partition

[17 May 2007 5:19] Shane Bester
Description:
During some ALTER TABLE .. ADD PARTITION operations and other queries concurrently, I get this in my error log:

070517  6:51:26 [Note] /home/sbester/server/5.1/mysql-5.1.19-beta-linux-i686/bin/mysqld: ready for connections.
Version: '5.1.19-beta-debug'  socket: '/tmp/mysql.sock'  port: 3306  yes
070517  6:53:13 [ERROR] Invalid (old?) table or database name 't1_test#'
070517  6:53:13 [ERROR] /home/sbester/server/5.1/mysql-5.1.19-beta-linux-i686/bin/mysqld: Incorrect information in file: './test/t1_test#.frm'
070517  6:59:31 [ERROR] Invalid (old?) table or database name 't1_test#'
070517  6:59:31 [ERROR] /home/sbester/server/5.1/mysql-5.1.19-beta-linux-i686/bin/mysqld: Incorrect information in file: './test/t1_test#.frm'

How to repeat:
will upload a testcase soon

Suggested fix:
fix the general locking problems with partition operations
[17 May 2007 5:40] Shane Bester
TESTCASE:
---------------------------

in connection 1:
-------------------

delimiter ;
drop table if exists t1;
create table t1_test(id int not null,name varchar(25),data tinyblob,key(name),key(id)) engine=innodb partition by range(id) ( partition p00 values less than (5000));
drop procedure if exists p1;
delimiter //
create procedure p1()
begin
        declare counter int default 0;
        declare continue handler for sqlexception begin end;
        repeat
                insert into t1_test values (floor(10000*rand()),'aaaaaaa','bbbbbbb');
                alter table t1_test add partition (partition `p08` values less than (200000));
                alter table t1_test drop partition p08;
                set counter=counter+1;
        until counter > 1000000
        end repeat;

end //

delimiter ;

call p1();

in connection 2:
----------------------
SHOW TABLE STATUS;
SHOW TABLE STATUS;
SHOW TABLE STATUS;
SHOW TABLE STATUS;
SHOW TABLE STATUS;
SHOW TABLE STATUS;
SHOW TABLE STATUS;

now look in error log.
[17 May 2007 5:49] Shane Bester
This testcase crashes on windows.
[17 May 2007 5:54] Shane Bester
debug build asserts on windows, 5.1.19, with this stack trace.

Attachment: bug28488_windows_crash_info.txt (text/plain), 4.93 KiB.

[4 Jun 2007 15:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/28062

ChangeSet@1.2520, 2007-06-04 18:56:29+03:00, gkodinov@macbook.gmz +5 -0
  Bug #28488: Incorrect information in file: './test/t1_test#.frm'
  While executing ALTER TABLE ... PARTITION the server uses 
  a temporary "shadow" table to create the updated table.
  This shadow table then gets renamed as the original table.
  The shadow table was not prefixed with the special prefix that
  marks temporary tables so it was picked up by SHOW TABLE STATUS.
  Fixed by isolating the code to create the shadow table name in a
  separate function and prefixing the shadow table name with the
  special prefix to exclude it from the list of user tables.
  See bug 18775 and WL1324 for details.
[5 Jun 2007 11:09] Sergey Vojtovich
BUG#28487 was marked as a duplicate.
Note that Bar is working on assertion failure - see BUG#26402.
[14 Jun 2007 19:00] Bugs System
Pushed into 5.1.20-beta
[15 Jun 2007 9:27] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.20 changelog.