Bug #48952 Test "drop-no_root" fails on i5os, because an expected error doesn't occur
Submitted: 20 Nov 2009 20:40 Modified: 2 Dec 2010 16:14
Reporter: Joerg Bruehe Email Updates:
Status: Won't fix Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.5.0-beta OS:IBM i
Assigned to: CPU Architecture:Any

[20 Nov 2009 20:40] Joerg Bruehe
Description:
New test failure in the build of 5.5.0-beta,
specific to IBM i5os.

Symptom:
=====
main.drop-no_root                        [ retry-fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: main.drop-no_root
mysqltest: At line 52: query 'DROP DATABASE mysql_test' succeeded - should have failed with errno 1010...

The result from queries just before the failure was:

# --
# -- Bug#26704: Failing DROP DATABASE brings mysql-client out of sync.
# --

DROP DATABASE IF EXISTS mysql_test;

CREATE DATABASE mysql_test;
CREATE TABLE mysql_test.t1(c INT);
use mysql_test;

chmod 000 mysql_test/t1.frm

 - saving '/PATH/mysql-test/var/log/main.drop-no_root/' to '/PATH/mysql-test/var/log/main.drop-no_root/'
=====

How to repeat:
Found during release build.

Suggested fix:
From looking at the test and its comments, I guess this is just annoying but not important.
I haven't checked the semantics of the i5os file system, but could it be that changing a file mode doesn't prevent the server from dropping the database (directory) containing that file?
If that should be so, the whole approach of this test wouldn't work on that platform.

In that case, I see 3 possible actions:
1) Prevent that test from being taken on i5os.
2) Change the test so that a successful "DROP DATABASE" doesn't
   make the test fail.
3) Find a new approach that makes the "DROP DATABASE" fail even on i5os.
[20 Nov 2009 21:19] Joerg Bruehe
Could this failure have the same cause?

=====
mysqltest: At line 1152: query 'rename table t1 to t2' succeeded - should have failed with errno 1...

The result from queries just before the failure was:
< snip >
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop trigger test.t1_bi;
ERROR HY000: Trigger does not exist
drop trigger t1_bi;
drop table t1;
drop database mysqltest;
use test;
create table t1 (id int);
create trigger t1_bi before insert on t1 for each row set @a:=new.id;
create trigger t1_ai after insert on t1 for each row set @b:=new.id;
insert into t1 values (101);
select @a, @b;
@a  @b
101 101
select trigger_schema, trigger_name, event_object_schema,
event_object_table, action_statement from information_schema.triggers
where event_object_schema = 'test';
trigger_schema  trigger_name    event_object_schema event_object_table  action_statement
test    t1_bi   test    t1  set @a:=new.id
test    t1_ai   test    t1  set @b:=new.id
=====

Note that this is also using some trick with "chmod":
=====
1143 # Trick which makes update of second .TRN file impossible
1144 let $MYSQLD_DATADIR= `select @@datadir`;
1145 write_file $MYSQLD_DATADIR/test/t1_ai.TRN~;
1146 dummy
1147 EOF
1148 chmod 0000 $MYSQLD_DATADIR/test/t1_ai.TRN~;
1149 # Normalize the datadir path; the embedded server doesn't chdir to datadir
1150 --replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
1151 --error 1
1152 rename table t1 to t2;
=====
[2 Dec 2010 16:14] Anitha Gopi
i5/OS not supported anymore