Bug #96445 A test may miss "create table ..."
Submitted: 7 Aug 2019 9:09 Modified: 30 Nov 2021 10:25
Reporter: Jiajing Zhou Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.7.25, 5.7.36 OS:Any
Assigned to: CPU Architecture:Any

[7 Aug 2019 9:09] Jiajing Zhou
Description:
The test steps does't match the description.

How to repeat:
The test "mysql-test/t/create.test", line #1790 - #1801:

~~~test
# Case 2: A database with tables in it and has an unrelated file in it's database
#         directory. Dropping such database should throw ER_DB_DROP_RMDIR
#         error.
CREATE DATABASE db_with_tables_and_an_unrelated_file_in_data_directory;
--write_file $MYSQLD_DATADIR/db_with_tables_and_an_unrelated_file_in_data_directory/intruder.txt
EOF
--replace_result $MYSQLD_DATADIR ./ \\ /
--error ER_DB_DROP_RMDIR
DROP DATABASE db_with_tables_and_an_unrelated_file_in_data_directory;
# Cleanup
--remove_file $MYSQLD_DATADIR/db_with_tables_and_an_unrelated_file_in_data_directory/intruder.txt
DROP DATABASE db_with_tables_and_an_unrelated_file_in_data_directory;
~~~

I guess that "create table xx" has missed.
 

Suggested fix:
After "EOF", add a step like:

~~~test
use db_with_tables_and_an_unrelated_file_in_data_directory
create table t1(b char(0));
~~~
[30 Nov 2021 10:25] MySQL Verification Team
Hello Jiajing Zhou,

Thank you for the report and feedback.

regards,
Umesh