Skip to content
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

db_sqlite: new parameters and minor improvements #3545

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

vasilevalex
Copy link
Contributor

Summary

  • Fix uninitialized memory access
  • Remove unused variables
  • Free memory for errmsg variables
  • Add new parameters to the module to configure the behavior of the database
  • Rename prefixes and names from old copy/paste
  • Use recommended by SQLite documentation way of processing locked state

Details
The PR was started as new feature, but fixed some issues during implementation.

Solution
Please review commits

Compatibility
The original behavior has been changed. If the database is locked, the process attempting to access it will no longer enter an infinite loop. Instead, it will return an error after the default timeout of 500 ms (this value can be modified as module parameter).

sqlite3_db_config with SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION affects
only C-API without enabling SQL function load_extension()
The proper way to handle a locked database is to use a busy timeout.
Previously, the behavior resulted in an infinite lock for the process
attempting to write to the locked database. The default value for the
busy timeout has been set to 500 ms to avoid immediate errors when short
database locks occur.
@vasilevalex vasilevalex force-pushed the sqlite_params branch 2 times, most recently from eb8d1b3 to c307279 Compare December 20, 2024 11:04
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

Successfully merging this pull request may close these issues.

1 participant