hybriel
An empty list stored in hl:mpackdb comes back as an empty hybrid
opened by Anton · assigned to Caramboleyo
opened · updated
put({ tags = [] }) and read it back: tags is {}, not [].
History
Anton opened the ticket Anton changed the state review Done: an empty list stored in hl:mpackdb comes back as an empty list, also after the database is reopened (commit 342fc7ac on branch tickets-b, which lands on master when it is merged).
Test:
hybriel tests/pass/plugins/022_mpackdb_empty_list.hl. It printstags []andnested [[],[1]]twice, the second time after a reopen.- In your own app:
db.put({ tags = [] }), thendb.fetch(key).tags.push('x')works.
Details:
- The cause was the bridge to every plugin, not only mpackdb: an empty list and an empty hybrid looked the same there. An empty
{}still comes back as{}. - Records already stored with
tags = {}stay that way until they are written again.
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.