Skip to content
Snippets Groups Projects
user avatar
Vladimir Davydov authored
Statement generated by the following piece code ({1, 1, 2}) isn't dumped
to the secondary index:

    s = box.schema.space.create('test', {engine = 'vinyl'})
    s:create_index('i1', {parts = {1, 'unsigned'}})
    s:create_index('i2', {parts = {2, 'unsigned'}})

    box.begin()
    s:insert{1, 1, 1}
    s:update(1, {{'+', 3, 1}})
    box.commit()

This happens, because UPDATE is replaced with DELETE + REPLACE in the
transaction log both of which have colun_mask = 0x04 (field #3 is
updated). These statements overwrite the original INSERT in the memory
index on commit, but they are not dumped, because their column_mask does
not intersect with the column mask of the secondary index (0x02).

To avoid that, the new statement (UPDATE = DELETE + REPLACE in this
case) must inherit the column mask of the overwritten statement
(REPLACE).

Fixes #2745
960aad6a
History