-
Notifications
You must be signed in to change notification settings - Fork 387
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Milestone
Description
s = box.schema.space.create('x')
pk = s:create_index('pk')
s:create_index( '_rawdata', { type='tree', unique=false, parts={{ 5, 'scalar', path='pay_date_to', is_nullable=true }} } )
s:insert{6, 1569246252, 2, 77, { f1 = 123, pay_date_to = box.NULL }, 21, 1, 361 }
-- now you need to apply a format for root fields
s:format({{type='any', name='1'}, {type='any', name='2'}, {type='any', name='3'}, {type='any', name='4'}, {type='map', name='_rawdata', is_nullable=true}})
-- fuckup
Perhaps, the following fix is correct: the code that updates is_nullable property were not adopted for JSON paths.
diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c
index 154535ab1..312c96621 100644
--- a/src/box/tuple_format.c
+++ b/src/box/tuple_format.c
@@ -378,7 +378,8 @@ tuple_format_use_key_part(struct tuple_format *format, uint32_t field_count,
* i.e. DEFAULT.
*/
if (field->nullable_action == ON_CONFLICT_ACTION_DEFAULT) {
- if (part->nullable_action != ON_CONFLICT_ACTION_NONE)
+ if (part->nullable_action != ON_CONFLICT_ACTION_NONE ||
+ part->path != NULL)
field->nullable_action = part->nullable_action;
} else if (part->nullable_action == ON_CONFLICT_ACTION_DEFAULT) {
if (field->nullable_action == ON_CONFLICT_ACTION_NONE)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers