Skip to content
Snippets Groups Projects
  • Dmitry Ivanov's avatar
    9dfb4fdf
    fix: check tuple metadata size in tuple_validate_raw · 9dfb4fdf
    Dmitry Ivanov authored
    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
    9dfb4fdf
    History
    fix: check tuple metadata size in tuple_validate_raw
    Dmitry Ivanov authored
    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