Skip to content
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

Some of new math function are missing #633

Closed
Tapac opened this issue Aug 1, 2021 · 5 comments · Fixed by #763
Closed

Some of new math function are missing #633

Tapac opened this issue Aug 1, 2021 · 5 comments · Fixed by #763
Assignees
Labels
enhancement:SQLite Enhancement about sqlite features

Comments

@Tapac
Copy link
Contributor

Tapac commented Aug 1, 2021

Since SQLite 3.35.0 version there should be new math functions provided but some of them are unsupported by Xerial implementation:

Please consider to add support for those functions.

@gotson
Copy link
Collaborator

gotson commented Aug 10, 2022

Until now the native library was built by adding extension-functions.c (from https://sqlite.org/contrib), which contains some math functions, among others.

If we enable the new math functions it generates a conflict, so we need to adjust that extension-functions.c file.

There is one thing we need to be careful about, currently log(X) performs the natural logarithm ln(X), but in the new math functions there is a dedicated ln(X), as well as log10(X) and log2(X). log(x) in the new math functions is an alias for log10(X). This will be a breaking change, so i will hold off on that until we release the next major version (3.40.0), and mark that down in the release notes.

gotson added a commit to gotson/sqlite-jdbc that referenced this issue Aug 10, 2022
gotson added a commit to gotson/sqlite-jdbc that referenced this issue Aug 10, 2022
@gotson gotson self-assigned this Aug 10, 2022
@michael-o
Copy link
Contributor

Note: This file (https://sqlite.org/contrib/download/extension-functions.c?get=25) is partially obsolete and included in SQLite. It needs to be revised first.

@gotson
Copy link
Collaborator

gotson commented Aug 10, 2022

Note: This file (https://sqlite.org/contrib/download/extension-functions.c?get=25) is partially obsolete and included in SQLite. It needs to be revised first.

It's still relevant for functions that are not natively in SQLite, and would still be needed when compiling without SQLITE_ENABLE_MATH_FUNCTIONS.

@michael-o
Copy link
Contributor

Note: This file (https://sqlite.org/contrib/download/extension-functions.c?get=25) is partially obsolete and included in SQLite. It needs to be revised first.

It's still relevant for functions that are not natively in SQLite, and would still be needed when compiling without SQLITE_ENABLE_MATH_FUNCTIONS.

For the diff it makes sense, but why compile with and then add the extensions file?

@gotson
Copy link
Collaborator

gotson commented Aug 10, 2022

Note: This file (https://sqlite.org/contrib/download/extension-functions.c?get=25) is partially obsolete and included in SQLite. It needs to be revised first.

It's still relevant for functions that are not natively in SQLite, and would still be needed when compiling without SQLITE_ENABLE_MATH_FUNCTIONS.

For the diff it makes sense, but why compile with and then add the extensions file?

You can see my WIP here, i've used #ifndef SQLITE_ENABLE_MATH_FUNCTIONS to skip stuff we don't need if the math functions will be enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement:SQLite Enhancement about sqlite features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants