Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3aca628

Browse filesBrowse 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 <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f756378 commit 3aca628
Copy full SHA for 3aca628

File tree

Expand file treeCollapse file tree

3 files changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎deps/sqlite/sqlite.gyp‎

Copy file name to clipboardExpand all lines: deps/sqlite/sqlite.gyp
+1Lines changed: 1 addition & 0 deletions
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
],
Collapse file

‎deps/sqlite/unofficial.gni‎

Copy file name to clipboardExpand all lines: deps/sqlite/unofficial.gni
+1Lines changed: 1 addition & 0 deletions
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
]
Collapse file

‎test/parallel/test-sqlite.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-sqlite.js
+8Lines changed: 8 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.