Skip to content

Commit 3aca628

Browse files
cjihrigRafaelGSS
authored andcommitted
sqlite: enable SQL math functions
This commit enables SQLite math functions. Fixes: #56435 PR-URL: #56447 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f756378 commit 3aca628

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

deps/sqlite/sqlite.gyp

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
1414
},
1515
'defines': [
16+
'SQLITE_ENABLE_MATH_FUNCTIONS',
1617
'SQLITE_ENABLE_SESSION',
1718
'SQLITE_ENABLE_PREUPDATE_HOOK'
1819
],

deps/sqlite/unofficial.gni

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ template("sqlite_gn_build") {
88
config("sqlite_config") {
99
include_dirs = [ "." ]
1010
defines = [
11+
"SQLITE_ENABLE_MATH_FUNCTIONS",
1112
"SQLITE_ENABLE_SESSION",
1213
"SQLITE_ENABLE_PREUPDATE_HOOK",
1314
]

test/parallel/test-sqlite.js

+8
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,11 @@ test('PRAGMAs are supported', (t) => {
103103
{ __proto__: null, journal_mode: 'wal' },
104104
);
105105
});
106+
107+
test('math functions are enabled', (t) => {
108+
const db = new DatabaseSync(':memory:');
109+
t.assert.deepStrictEqual(
110+
db.prepare('SELECT PI() AS pi').get(),
111+
{ __proto__: null, pi: 3.141592653589793 },
112+
);
113+
});

0 commit comments

Comments
 (0)