sqlite-jdbc icon indicating copy to clipboard operation
sqlite-jdbc copied to clipboard

Some of new math function are missing

Open Tapac opened this issue 4 years ago • 5 comments

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.

Tapac avatar Aug 01 '21 15:08 Tapac

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 avatar Aug 10 '22 03:08 gotson

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.

michael-o avatar Aug 10 '22 12:08 michael-o

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.

gotson avatar Aug 10 '22 14:08 gotson

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?

michael-o avatar Aug 10 '22 14:08 michael-o

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.

gotson avatar Aug 10 '22 14:08 gotson