Skip to content
Snippets Groups Projects
Commit 9dfb4fdf authored by Dmitry Ivanov's avatar Dmitry Ivanov
Browse files

fix: check tuple metadata size in tuple_validate_raw

This check is needed to prevent the following scenario:

```
box.cfg()

box.schema.space.create("test")
box.space.test:create_index("primary", {
        unique = true, parts = { { field = 1, type = "str" } }
})

local t = { "pk1", {}, "value" }
for i = 1, 9000 do
  table.insert(t[2], { i })
end
box.space.test:insert(t)

-- This succeeds, but shouldn't!
box.space.test:create_index("broken", {
        parts = { { path = "[*][1]", type = "unsigned", field = 2 } }
})
-- This fails with an error due to metadata update...
box.space.test:update("pk1", { { "=", 3, "new value" } })
```

```
2025-03-03 10:26:13.519 [41046] main tuple.h:473 E> ER_TUPLE_METADATA_IS_TOO_BIG: Can't create tuple: metadata size 36022 is too big
```

NO_DOC=picodata
NO_CHANGELOG=picodata
parent b06e25ff
No related branches found
No related tags found
1 merge request!230fix: check tuple metadata size in tuple_validate_raw
Pipeline #63887 passed