Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

geometry: better assert about invalid value than silently adjust #166

Closed
AskAlexSharov opened this issue Mar 2, 2021 · 2 comments
Closed
Assignees
Labels

Comments

@AskAlexSharov
Copy link
Contributor

set_geometry has code:

 if (bytes2pgno(env, growth_step) > UINT16_MAX)
    growth_step = pgno2bytes(env, UINT16_MAX);

It's very unexpected option configured by me was silently changed.
Also this code is buggy: bytes2pgno can't be used before set env.me_psize is set - but it's not set yet (I passed pagesize=64Kb to set_geometry, but bytes2pgno using 4K value here).

@AskAlexSharov AskAlexSharov changed the title geometry: better assert about invalid value than change it to unexpected value geometry: better assert about invalid value than silently adjust Mar 2, 2021
@AskAlexSharov
Copy link
Contributor Author

Also I think - better push people somehow to call set_geometry before calling other methods, because other methods like set_option can use pgno2bytes.

@erthink
Copy link
Owner

erthink commented Mar 2, 2021

I will definitely fix it soon, but literally today/tomorrow I'm digging out another bug inherited from LMDB.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants