• Aleksey Midenkov's avatar
    MDEV-29609 create_not_windows test fails with different result · cb583b2f
    Aleksey Midenkov authored
    make_tmp_name() creates temporary name with prefix containing PID and
    TID. This prefix influences max length of the rest of the name (the
    whole name is limited by NAME_LEN). During the test run PID and TID
    can change. PID increases when the server restarts. TID is incremented
    with the new connections (generated by next_thread_id(), is not the
    posix thread ID).
    
    During the test run PID can increase max 2 decimal positions: from
    tens to thousands this requires ~900 restarts. TID depends on
    connection count, but for test we assume it will not trespass 100000
    connections which is 5 decimal positions. So it should be enough to
    reserve 7 characters for PID and TID increment.
    
    The patch reserves more: it reserves 12 characters for 7-decimal PID
    and 5-decimal TID plus 4 chars of additional reserve (for future
    prefix changes) and assumes minimal legth of the prefix is 30 bytes:
    
    #sql-backup-PID-TID-
    #sql-create-PID-TID-
    
    4-6-PID-TID- is 10 + 4 + PID + TID, so PID + TID is 16 chars (7 + 5 + 4).
    cb583b2f
create_not_windows.result 4.73 KB