Bug #58095 "create table like" fails with errno 9 (EBADF)
Submitted: 9 Nov 2010 20:08 Modified: 29 May 2015 9:29
Reporter: Joerg Bruehe Email Updates:
Status: Duplicate Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:5.1.50 and up, cluster OS:Other (FreeBSD + OS X)
Assigned to: Assigned Account CPU Architecture:Any

[9 Nov 2010 20:08] Joerg Bruehe
Description:
Test "rpl.rpl_switch_stm_row_mixed" fails with this message:

=====
rpl.rpl_switch_stm_row_mixed 'row'       [ retry-fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: rpl.rpl_switch_stm_row_mixed
mysqltest: At line NNN: query 'create table t16 like t15' failed: 1004: Can't create file './mysqltest1/t16.frm' (errno: 9)

The result from queries just before the failure was:
< snip >
drop function f2;
create function f2 (x varchar(100)) returns int deterministic
begin
declare y int;
insert into t1 values(null,x);
set y = (select count(*) from t2);
return y;
end|
select f1("try_53_"),f2("try_54_");
f1("try_53_")   f2("try_54_")
1       3
drop function f2;
create trigger t1_bi before insert on t1 for each row
begin
insert into t2 values(null,"try_55_");
end|
insert into t1 values(null,"try_56_");
alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
CREATE TEMPORARY TABLE t15 SELECT UUID();

More results from queries before failure can be found in /PATH/mysql-test/var/log/rpl_switch_stm_row_mixed.log

 - saving '/PATH/mysql-test/var/log/rpl.rpl_switch_stm_row_mixed-row/' to '/PATH/mysql-test/var/log/rpl.rpl_switch_stm_row_mixed-row/'
=====

Errno 9 is "EBADF" (checked on FreeBSD).

This happens for all three log modes: "row", "stmt", "mix".

I see it in the archived test logs of 5.1.50, 5.1.51, and 5.1.52, even though it hasn't
been reported back then,
and I now get it in the build of cluster-7.1.9 which is based on 5.1.51.

It is specific to FreeBSD 7 (server only) and OS X 10.5 and 10.6,
whereas OS X 10.4 and all other platforms pass the test.

--

Note that platforms (and versions) are the same as in bug#58092, so there might be some connection.

How to repeat:
Found by running the full test suite in a release build.
[10 Nov 2010 12:48] Joerg Bruehe
Same issue in test "binlog_row_binlog", same platforms,
again in 5.1.50 to 52 as well as in Cluster 7.1.9:

=====
binlog.binlog_row_binlog 'row'           [ retry-fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: binlog.binlog_row_binlog
mysqltest: In included file "./extra/binlog_tests/binlog.test": At line 219: query 'create table if not exists t3 like tt1' failed: 1004: Can't create file './test/t3.frm' (errno: 9)

The result from queries just before the failure was:
< snip >
CALL p3(0);
CALL p4(0);
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
DROP PROCEDURE p4;
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
set insert_id=128;
insert into t1 values(null);
Warnings:
Warning 1264    Out of range value for column 'id' at row 1
select * from t1;
id
127
drop table t1;
create table t1 (a int);
create table if not exists t2 select * from t1;
create temporary table tt1 (a int);

More results from queries before failure can be found in /PATH/mysql-test/var/log/binlog_row_binlog.log

=====
[18 Aug 2011 20:49] Joerg Bruehe
For the record:

This very same problem is also found in newer builds of MySQL 5.1, up to 5.1.58 (the highest version I checked).
[2 Feb 2012 22:28] Joerg Bruehe
The test failure still occurs in all 5.1 release builds up to 5.1.61
(the latest build we have done).
It remains specific to FreeBSD 7.0, OS X 10.5 and 10.6,
for both x86 (32 bit) and x86_64.
[29 May 2015 9:28] Andrii Nikitin
Posted by developer:
 
Closing as duplicate of bug #63304