Skip to content

update: allow update absent nullable fields #3378

@Gerold103

Description

@Gerold103

Now in tarantool a one can do this:

box.cfg{}
format = {}
format[1] = {name = 'field1', type = 'unsigned'}
format[2] = {name = 'field2', type = 'unsigned'}
format[3] = {name = 'field3', type = 'unsigned', is_nullable = true}
format[4] = {name = 'field4', type = 'unsigned', is_nullable = true}
s = box.schema.create_space('test', {format = format})
pk = s:create_index('pk')
s:replace{1, 2}

In the inserted tuple {1, 2} fields 3 and 4 are 'virtual' nulls - they are interpreted as NULL, but are not stored. But the fields presence illusion is dispelled when I do this:

s:update({1}, {{'!', 4, 0}})

It leads to an error, because update operation ! can not insert with gaps. But lets allow to do this, if gaps are virtual NULLs. This operation must fill gaps with NULLs.

Same about =. Operation # must be able to become no-op, when a field is a virtual NULL.

Metadata

Metadata

Labels

featureA new functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions