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

vnstat: no longer works after databases/sqlite3 disabled DQS #243

Closed
joeroback opened this issue Mar 8, 2023 · 2 comments
Closed

vnstat: no longer works after databases/sqlite3 disabled DQS #243

joeroback opened this issue Mar 8, 2023 · 2 comments
Labels

Comments

@joeroback
Copy link

joeroback commented Mar 8, 2023

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269966

causing issues on FreeBSD and other systems like OPNsense (based on FreeBSD).

FreeBSD bug has an attachment bug fix

@vergoh
Copy link
Owner

vergoh commented Mar 8, 2023

Thanks for this bug report. Looking at https://sqlite.org/quirks.html#dblquote, this interpretation difference between single and double quotes is something I wasn't aware of and I've clearly somehow managed to pick the less future proof option. However, I think that the correct solution would be to refactor the queries having column names in single-quotes instead of using sqlite3_db_config() to change the feature configuration. According to https://sqlite.org/c3ref/c_dbconfig_defensive.html SQLITE_DBCONFIG_DQS_DML and SQLITE_DBCONFIG_DQS_DDL both can be used to activate legacy features so the better approach would be not to use legacy in the first place (assuming there's no backwards incompatibility with older sqlite3 releases).

Since this situation is at least currently reproducable in FreeBSD, I should be able to replicate the situation and test for a fix myself.

@vergoh vergoh added the bug label Mar 8, 2023
@vergoh vergoh closed this as completed in 2e66151 Mar 9, 2023
@vergoh
Copy link
Owner

vergoh commented Mar 9, 2023

The test suite (make check) of affected vnStat releases (past releases included) will fail if DQS wasn't enabled so the status can be tested without install. The committed refactoring of queries causing the issue has been tested starting from SQLite version 3.6.22 without causing backwards incompatible side effects. DQS doesn't affect the database structure so this correction doesn't require any vnStat database updates.

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

No branches or pull requests

2 participants