Skip to content

LMDB Support for driver flags #8892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 23, 2022
Merged

LMDB Support for driver flags #8892

merged 4 commits into from
Jul 23, 2022

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Jun 29, 2022

This fixes #8856

I'm not exactly sure about the implementation for the driver flags as the way DBA is currently built the headers seem to be added somewhat magically.

These commit should also be kept separately.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! However, I don't like to introduce DBA_LMDB_USE_SUB_DIR; after all, this is a flags parameter, and as such a bitmask. Passing 0 should be sufficient, shouldn't it?

@Girgias
Copy link
Member Author

Girgias commented Jul 21, 2022

I think the reason why I added the constant is that the default would not be 0 and it feels a bit weird, but I can remove it

@cmb69
Copy link
Member

cmb69 commented Jul 21, 2022

Yeah, I see your point. It is unfortunate, that we started with MDB_NOSUBDIR as default. Maybe keep DBA_LMDB_USE_SUB_DIR.

@Girgias
Copy link
Member Author

Girgias commented Jul 22, 2022

@kocsismate why am I getting an:

In ./ext/dba/dba.stub.php:
Constant DBA_LMDB_NO_SUB_DIR must have a @cvalue annotation

Error? I don't understand why it needs a CVALUE annotation as the value is defined in the stubs?

@kocsismate
Copy link
Member

why am I getting an:
In ./ext/dba/dba.stub.php:
Constant DBA_LMDB_NO_SUB_DIR must have a @cvalue annotation
Error? I don't understand why it needs a CVALUE annotation as the value is defined in the stubs?

But the value is UNKNOWN, right? UNKNOWN value means that REGISTER_*_CONSTANT() calls should use the C constant as value. If there is a proper constant value but there's no @cvalue then the former is used. If there are both, then the C constant value is used in C code, and an assertion is added that the 2 values match.

@Girgias
Copy link
Member Author

Girgias commented Jul 22, 2022

why am I getting an:
In ./ext/dba/dba.stub.php:
Constant DBA_LMDB_NO_SUB_DIR must have a @cvalue annotation
Error? I don't understand why it needs a CVALUE annotation as the value is defined in the stubs?

But the value is UNKNOWN, right? UNKNOWN value means that REGISTER_*_CONSTANT() calls should use the C constant as value. If there is a proper constant value but there's no @cvalue then the former is used. If there are both, then the C constant value is used in C code, and an assertion is added that the 2 values match.

The value is not UNKNOWN it is 0 as it's a constant I created which does not have an equivalent in C, which is why I'm confused by the error

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (besides the two nits). Please add a note in NEWS and UPGRADING when merging.

Currently only LMDB with DBA_LMDB_USE_SUB_DIR/DBA_LMDB_NO_SUB_DIR are supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dba: lmdb: allow to override the MDB_NOSUBDIR flag
3 participants