esp32_arduino_sqlite3_lib icon indicating copy to clipboard operation
esp32_arduino_sqlite3_lib copied to clipboard

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

Open genotix opened this issue 4 years ago • 3 comments

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).

genotix avatar Jan 27 '21 22:01 genotix