-
Notifications
You must be signed in to change notification settings - Fork 68
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
VACUUM result disk I/O error #55
Comments
Did you manage to resolve this? I'm getting the same issue. |
Hi, no. still same issue. |
Hi, not sure what is causing this, but please check this out: #50 (comment) |
Hi, I am experiencing the same issue but through the SPI bound SD card. All other functions are fine, only VACUUM causing this issue. |
I have looked into this and its solvable: 1.) a temporary file is opened. this is not implemented currently -> filename is 0 and the doc says you have to come up with a filename yourself. -> first thing that needs to be fixed in ESP32Open like this:
2.) next the temp file needs to be initialized with some data as when writing out the seek somehow fails as it trys to seek to a position that is outside of the files size.
lastly, truncate is not implemented and thus the operation sometimes fails. ESP32 for an unknown reason refuses to implement truncate in there filesystem. you can work around this by (moving the file -> creating a new file with the name of the original file with the correct truncated size -> copy data from the original file into new file) its not a step by step fix but helping hints for somebody how wants to fix this. my code has at this point deviated to far so that i can publish a pullrequest. also some other problems might also be fixed by implementing the temporary file and trucate like the issue with dropping tables or auto increment primary key |
@savejeff Thanks for sharing this!! I will check. |
i found out the problem with seek. sqlite expects that when a seek is above the file size and a write is started that the file is extended to the seek position with zeros. so in direct write when the start offset is above the file size, the file must be extended with zeros until file.size == iOfst like this:
Here is what chatgpt has to say about it:
Im getting Operation successful with Vacum now |
i think i have now fixed most of the problems that caused the IO Disk errors others reported. @siara-cc i can send you the my implementation. its based on arduinos FS classes and not on the basic fwrite, etc functions but it demonstrates the needed general behaviour |
Hi, thank you for the detailed explanation. If a PR is not possible, I suggest attaching the zip file here so I can check and modify the library. |
Hi,
I try to use "VACUUM" but i get this error disk I/O error.
Other sqlite command work well.
I use ESP32 and SPIFFS.
i use the command
sqlcommand="VACUUM";
"db_exec(db1, sqlcommand);"
thanks for your support
The text was updated successfully, but these errors were encountered: