• Aleksey Midenkov's avatar
    MDEV-22153 ALTER add default history partitions makes table inaccessible · 13911752
    Aleksey Midenkov authored
    ADD default history partitions generates wrong partition name,
    f.ex. p2 instead of p1. Gap in sequence of partition names leads to
    ha_partition::open_read_partitions() fail on inexistent name.
    
    Manual fixing such broken table requires:
    
    1. create empty table by any name (t_empty) with correct number
    of partitions;
    2. stop the server;
    3. rename data files (.myd, .myi or .ibd) of broken table to t_empty
    fixing the partition sequence (#p2 to #p1, #p3 to #p2);
    4. start the server;
    5. drop the broken table;
    6. rename t_empty to correct table name.
    13911752
partition.test 28 KB