node:sqlite: "VACUUM INTO" gives error "no such function: floor" #56435
Copy link
Copy link
Closed
Description
Activity
It seems like the issue is related to the use of
floor()and notVACUUMitself. Is that correct?I'm guessing this is because SQLite is currently compiled without
SQLITE_ENABLE_MATH_FUNCTIONS.That is likely the reason.
I'm running into this issue as well, not with VACCUM specifically, but with the missing math functions:
FLOOR,CEIL, etc (https://www.sqlite.org/lang_mathfunc.html).I just wanted to add a +1 to getting those enabled by default unless there's a good reason not to?
Node v23.5.0
import { DatabaseSync } from 'node:sqlite' const db = new DatabaseSync(':memory:') db.exec('SELECT FLOOR(1.275)')- added a commit that references this issue
on Jan 3, 2025 - added a commit that references this issue
on Jan 5, 2025 - added a commit that references this issue
on Jan 13, 2025 - added 2 commits that reference this issue
on Jan 31, 2025 - added a commit that references this issue
on Mar 13, 2025
Metadata
Metadata
Assignees
Labels
No labels
Version
22.11.0
Platform
Subsystem
node:sqlite
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
I tested the code with a very simple database with only one table as shown in the table. The column calcPoint is a generated column defined by
floor(point). It generates errorError: no such function: floor.If I remove the generated column calcPoint,
VACUUM INTOworks without error.What is the expected behavior? Why is that the expected behavior?
VACUUM INTOshould work when function floor is used.What do you see instead?
VACUUM INTOgives error "Error: no such function: floor" when function floor is used.Additional information
This issue might exists for other sqlite functions as well.