Skip to content

SQLite 2.3.0 - DELETE with Subquery returns [SQL error: parser stack overflow] #42

Open
@genotix

Description

@genotix

Hi,

I've been trying to execute a DELETE to clean up a single table which fails with error: SQL error: parser stack overflow
My device is an ESP32-WROVER-B (TTGO T-CALL v1.4 to be exact) and I'm using the SPIFFS library without any SD card.

The snippet of code responsible for the delete action:
sql = F("DELETE FROM raw_log WHERE rowid IN (SELECT rowid FROM raw_log limit 20 ASC);"); // Remove oldest first int rc = db_exec(db1, sql.c_str() ); if (rc != SQLITE_OK) { sqlite3_close(db1); return; } vacuum();

The table structure:
CREATE TABLE IF NOT EXISTS raw_log (reg DATETIME, transmitted BOOL, content BLOB);

Any hints on what I'm doing wrong would be appreciated.
(I know could execute the the select separately and run a loop to delete per record and would expect this to work but I rather have clean code if possible; SQLite seems to be -very- complete given the lightweight system it is running on).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions