• Jon Olav Hauglid's avatar
    Bug# 11763784 (former 56541) · 455646e7
    Jon Olav Hauglid authored
    ASSERTION TABLE->DB_STAT FAILED IN
    SQL_BASE.CC::OPEN_TABLE() DURING I_S Q
    
    This assert could be triggered if a statement requiring a name
    lock on a table (e.g. DROP TRIGGER) executed concurrently
    with an I_S query which also used the table.
    
    One connection first started an I_S query that opened a given table.
    Then another connection started a statement requiring a name lock
    on the same table. This statement was blocked since the table was
    in use by the I_S query. When the I_S query resumed and tried to
    open the table again as part of get_all_tables(), it would encounter
    a table instance with an old version number representing the pending
    name lock. Since I_S queries ignore version checks and thus pending
    name locks, it would try to continue. This caused it to encounter
    the assert. The assert checked that the TABLE instance found with a
    different version, was a real, open table. However, since this TABLE
    instance instead represented a pending name lock, the check would
    fail and trigger the assert.
    
    This patch fixes the problem by removing the assert. It is ok for
    TABLE::db_stat to be 0 in this case since the TABLE instance can
    represent a pending name lock.
    
    Test case added to lock_sync.test.
    455646e7
lock_sync.result 23.4 KB