Skip to content

Temporary sort file, Watch dog #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vvvait opened this issue Jan 26, 2021 · 4 comments
Open

Temporary sort file, Watch dog #41

vvvait opened this issue Jan 26, 2021 · 4 comments

Comments

@vvvait
Copy link

vvvait commented Jan 26, 2021

Hi.
Thanks for adapting sqlite3 for esp32.
I researched the work of the library for several months.
On some requests, I began to receive the "disk I / O error" error. I got into the source and found that there is no way to create temporary files.
in esp32.cpp: ESP32Open

const char *zName,              /* File to open, or 0 for a temp file */
...
if( zName==0 ){
  return SQLITE_IOERR;
}

i replaced return SQLITE_IOERR; to zName = "/sd/temp";
and selection of 1000 records with sorting began to work.

It is also worth adding feeding the WatchDog on requests longer than 3 seconds if execute worked in main loop task, otherwise it will fire, may by in ESP32Read and ESP32Write, or add some callbacks.

max performance i have with
#define SQLITE_DEFAULT_PAGE_SIZE 512 //4096
#define SQLITE_DEFAULT_CACHE_SIZE -8 // -1

@siara-cc
Copy link
Owner

Hi, Thank you very much for communicating your findings. I will incorporate these into the repo.

@vvvait
Copy link
Author

vvvait commented Jan 30, 2021

Hi, you still need to delete the temporary file if it already exists, otherwise an error is displayed periodically that the database is damaged

if( zName==0 ){
    zName = "/sd/temp";
    remove(zName); 
}

@winkelict
Copy link

this might be a full implementation of temporary file support:
#81

@siara-cc
Copy link
Owner

@vvvait I have incorporated this with today's commit using code from @winkelict and @savejeff
Thanks to all of you for the support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants