Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.7.1
-
None
-
Debug build, -DEXTRA_DEBUG
Description
parts.partition_debug fails with 2 warnings "Table: ./test/t1#P#p2 is open on rename new table2"
This happens only in 10.7 (I could not repeat it with 10.6) when compiled with DBUG
I can repeat it to 100% on my desktop.
parts.partition_debug [ fail ] Found warnings/errors in server log file!
Test ended at 2022-01-24 15:59:58
line
Warning: Table: ./test/t1#P#p2 is open on rename new table2
Warning: Table: ./test/t1#P#p2 is open on rename new table2
A shorter test case, just for debugging:
(The normal test case, parts.partition_debug only needs to be extended with this MDEV number). Note that it is the new code for CONVERT PARTITION that is generating the issue.
As a separate issue, I noticed that the code does try to rename files that does not exists:
error: error: 7 message: 'Error on rename of './test/tp2.MYD' to './test/t1#P#p2.MYD' (Errcode: 2 "No such file or directory")
That code could probably be cleaned up so that we don't generate errors/warnings that are not needed (for example by testing if the file exists or not before doing a rename)
# including crashing tests.
|
|
--source include/have_debug.inc
|
--source include/have_partition.inc
|
# Don't test this under valgrind, memory leaks will occur
|
--source include/not_valgrind.inc
|
# Crash tests don't work with embedded
|
--source include/not_embedded.inc
|
|
# Make sure system tables are not open, as the test will kill the server
|
# and it will cause corruption errors in the log
|
FLUSH TABLES;
|
|
--echo #
|
--echo # MDEV-22166 CONVERT PARTITION: move out partition into a table
|
--echo #
|
let $create_statement= create or replace table t1 (x int primary key)
|
partition by range(x) (
|
partition p1 values less than (10),
|
partition p2 values less than (20),
|
partition p3 values less than (30),
|
partition p4 values less than (40),
|
partition p5 values less than (50),
|
partition pn values less than maxvalue);
|
|
let $insert_statement= insert into t1 values (2), (12), (22), (32), (42), (52);
|
let $fail_statement= alter table t1 convert partition p2 to table tp2;
|
|
set @save_dbug=@@debug_dbug;
|
set session debug_dbug="+d,fail_convert_partition_5";
|
--source suite/parts/inc/partition_fail.inc
|
set session debug_dbug=@save_dbug;
|
set session debug_dbug="+d,fail_convert_partition_11";
|
--echo # Already finished DDL logging, so tp2 now exists:
|
--source suite/parts/inc/partition_fail.inc
|
set session debug_dbug=@save_dbug;
|
show create table tp2;
|
select * from tp2;
|
drop table tp2;
|