René's URL Explorer Experiment


Title: Create temp view incorrectly marks RO DB "dirty" · Issue #1514 · sqlitebrowser/sqlitebrowser · GitHub

Open Graph Title: Create temp view incorrectly marks RO DB "dirty" · Issue #1514 · sqlitebrowser/sqlitebrowser

X Title: Create temp view incorrectly marks RO DB "dirty" · Issue #1514 · sqlitebrowser/sqlitebrowser

Description: Details for the issue What did you do? Open a DB Read only. In Execute SQL tab, execute create temp view foo as select * from table1; File => Close DB What did you expect to see? Nothing What did you see instead? ? Do you want to save th...

Open Graph Description: Details for the issue What did you do? Open a DB Read only. In Execute SQL tab, execute create temp view foo as select * from table1; File => Close DB What did you expect to see? Nothing What did y...

X Description: Details for the issue What did you do? Open a DB Read only. In Execute SQL tab, execute create temp view foo as select * from table1; File => Close DB What did you expect to see? Nothing What di...

Opengraph URL: https://github.com/sqlitebrowser/sqlitebrowser/issues/1514

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create temp view incorrectly marks RO DB \"dirty\"","articleBody":"Details for the issue\r\n--------------------\r\n\r\n#### What did you do?\r\n\r\nOpen a DB Read only.\r\n\r\nIn Execute SQL tab, execute\r\n\r\n````\r\ncreate temp view foo as select * from table1;\r\n````\r\n\r\nFile => Close DB\r\n\r\n#### What did you expect to see?\r\n\r\nNothing\r\n\r\n#### What did you see instead?\r\n````\r\n? Do you want to save the changes made to the database file ...?\r\n````\r\n\r\nWhile it is reasonable not to parse all the commands & responses in an \"Execute\" tab to determine if actions modify the database, it is guaranteed (I hope) that a database open as Read-Only can not be modified!\r\n\r\nSo, **Option 1**: Don't pay attention to the \"Dirty\" flag if a DB is open read-only,\r\n\r\nHowever, it appears that you may be able to use SQLite to detect a modified DB fairly painlessly.\r\n\r\n**Option 2**: [Section 1.3.6](https://sqlite.org/fileformat2.html) of the DB header spec says:\r\n\r\n> The file change counter is a 4-byte big-endian integer at offset 24 that is incremented whenever the database file is unlocked after having been modified. When two or more processes are reading the same database file, each process can detect database changes from other processes by monitoring the change counter. A process will normally want to flush its database page cache when another process modified the database, since the cache has become stale. The file change counter facilitates this.\r\n>\r\n> In WAL mode, changes to the database are detected using the wal-index and so the change counter is not needed. Hence, the change counter might not be incremented on each transaction in WAL mode.\r\n\r\nSo unless the DB is in WAL mode, you can rely on it instead of your own dirty bit.  (The [API ](https://sqlite.org/c3ref/file_control.html)indicates that sqlite_file_control([SQLITE_FCNTL_FILE_POINTER](https://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlfilepointer)) returns a pointer to [sqlite3_file](https://sqlite.org/c3ref/file.html) object, which includes a pointer to a [sqlite3_io_methods](https://sqlite.org/c3ref/io_methods.html) object, which should allow you to xRead the header)  There should be an API to access this directly, but a quick scan of the documentation didn't turn it up.\r\n\r\nIf this works as expected, you would not have to maintain your own \"dirty\" flag for R/W databases either.  I would expect that to simplify your code, even if you have to save/restore the journaling mode to avoid WAL.\r\n\r\nUseful extra information\r\n-------------------------\r\n\r\nThe info below often helps, please fill it out if you're able to. :)\r\n\r\n#### What operating system are you using?\r\n\r\n- [x] Windows: ( _version:_ 10 pro___ )\r\n- [ ] Linux: ( _distro:_ ___ )\r\n- [ ] Mac OS: ( _version:_ ___ )\r\n- [ ] Other: ___\r\n\r\n#### What is your DB4S version?\r\n\r\n- [ ] 3.10.1\r\n- [ ] 3.10.0\r\n- [ ] 3.9.1\r\n- [x] Other: ___Aug 23 nightly\r\n\r\n#### Did you also\r\n\r\n- [x] Try out the latest nightly version: https://github.com/sqlitebrowser/sqlitebrowser#nightly-builds\r\n- [x] Search for an existing similar issue: https://github.com/sqlitebrowser/sqlitebrowser/issues?utf8=%E2%9C%93&q=is%3Aissue%20\r\n","author":{"url":"https://github.com/tlhackque","@type":"Person","name":"tlhackque"},"datePublished":"2018-08-23T17:45:32Z","url":"https://github.com/sqlitebrowser/sqlitebrowser/issues/1514"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ca36abec-2306-76f5-83c5-a2bb1e85407f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAAC2:F27CE:235CD97:3138417:6AFD3375
html-safe-nonceaa3f7dd02495f09c06aad0ac50f2c461005fd21365f7abe118a2e48f22530c06
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUMyOkYyN0NFOjIzNUNEOTc6MzEzODQxNzo2QUZEMzM3NSIsInZpc2l0b3JfaWQiOiIyNTUwNzg0MzY0NTM5MzYwMTE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6c4c775116b9433c4b2d183895febe3fa589d9b10759cc54e08d7a58b2217d64
hovercard-subject-tagissue:353485847
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlitebrowser/sqlitebrowser/1514/issue_layout
twitter:imagehttps://opengraph.githubassets.com/84064905bca3ed2bc064c72112718829d8d54791cd7162dc64e17d63314b9fa7/sqlitebrowser/sqlitebrowser/issues/1514
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/84064905bca3ed2bc064c72112718829d8d54791cd7162dc64e17d63314b9fa7/sqlitebrowser/sqlitebrowser/issues/1514
og:image:altDetails for the issue What did you do? Open a DB Read only. In Execute SQL tab, execute create temp view foo as select * from table1; File => Close DB What did you expect to see? Nothing What did y...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametlhackque
hostnamegithub.com
expected-hostnamegithub.com
None065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19
turbo-cache-controlno-preview
go-importgithub.com/sqlitebrowser/sqlitebrowser git https://github.com/sqlitebrowser/sqlitebrowser.git
octolytics-dimension-user_id7454271
octolytics-dimension-user_loginsqlitebrowser
octolytics-dimension-repository_id19416551
octolytics-dimension-repository_nwosqlitebrowser/sqlitebrowser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id19416551
octolytics-dimension-repository_network_root_nwosqlitebrowser/sqlitebrowser
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release941021edf0c2ec58298f4a2c8f27ae507d129c92
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/sqlitebrowser/sqlitebrowser/issues/1514#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsqlitebrowser%2Fsqlitebrowser%2Fissues%2F1514
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsqlitebrowser%2Fsqlitebrowser%2Fissues%2F1514
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=sqlitebrowser%2Fsqlitebrowser
Reloadhttps://github.com/sqlitebrowser/sqlitebrowser/issues/1514
Reloadhttps://github.com/sqlitebrowser/sqlitebrowser/issues/1514
Reloadhttps://github.com/sqlitebrowser/sqlitebrowser/issues/1514
sqlitebrowserhttps://github.com/sqlitebrowser
sqlitebrowserhttps://github.com/sqlitebrowser/sqlitebrowser
Codehttps://github.com/sqlitebrowser/sqlitebrowser
Issues786 (786)https://github.com/sqlitebrowser/sqlitebrowser/issues
Pull requests30 (30)https://github.com/sqlitebrowser/sqlitebrowser/pulls
Discussionshttps://github.com/sqlitebrowser/sqlitebrowser/discussions
Actionshttps://github.com/sqlitebrowser/sqlitebrowser/actions
Projectshttps://github.com/sqlitebrowser/sqlitebrowser/projects
Wikihttps://github.com/sqlitebrowser/sqlitebrowser/wiki
Security and qualityhttps://github.com/sqlitebrowser/sqlitebrowser/security
Insightshttps://github.com/sqlitebrowser/sqlitebrowser/insights
https://github.com/sqlitebrowser/sqlitebrowser
New issuehttps://github.com/login?return_to=https://github.com/sqlitebrowser/sqlitebrowser/issues/1514
New issuehttps://github.com/login?return_to=https://github.com/sqlitebrowser/sqlitebrowser/issues/1514
Create temp view incorrectly marks RO DB "dirty"https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#top
bugConfirmed bugs or reports that are very likely to be bugs.https://github.com/sqlitebrowser/sqlitebrowser/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/tlhackque
tlhackquehttps://github.com/tlhackque
on Aug 23, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issue-353485847
Section 1.3.6https://sqlite.org/fileformat2.html
API https://sqlite.org/c3ref/file_control.html
SQLITE_FCNTL_FILE_POINTERhttps://sqlite.org/c3ref/c_fcntl_begin_atomic_write.html#sqlitefcntlfilepointer
sqlite3_filehttps://sqlite.org/c3ref/file.html
sqlite3_io_methodshttps://sqlite.org/c3ref/io_methods.html
https://github.com/sqlitebrowser/sqlitebrowser#nightly-buildshttps://github.com/sqlitebrowser/sqlitebrowser#nightly-builds
https://github.com/sqlitebrowser/sqlitebrowser/issues?utf8=%E2%9C%93&q=is%3Aissue%20https://github.com/sqlitebrowser/sqlitebrowser/issues?utf8=%E2%9C%93&q=is%3Aissue%20
https://github.com/sky5walk
sky5walkhttps://github.com/sky5walk
on Aug 23, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-415530835
I had a similar problem WITH RECURSIVE queries.https://github.com/sqlitebrowser/sqlitebrowser/issues/1297
https://github.com/chrisjlocke
chrisjlockehttps://github.com/chrisjlocke
on Aug 24, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-415662380
#1https://github.com/sqlitebrowser/sqlitebrowser/pull/1
mgrojohttps://github.com/mgrojo
bugConfirmed bugs or reports that are very likely to be bugs.https://github.com/sqlitebrowser/sqlitebrowser/issues?q=state%3Aopen%20label%3A%22bug%22
on Sep 2, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#event-1822390595
https://github.com/tlhackque
tlhackquehttps://github.com/tlhackque
on Sep 6, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-419101067
sqlite3_total_chantges()https://www.sqlite.org/c3ref/total_changes.html
https://github.com/mgrojo
mgrojohttps://github.com/mgrojo
on Sep 6, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-419220457
total_changes() SQL functionhttps://www.sqlite.org/c3ref/total_changes.html
mgrojohttps://github.com/mgrojo
on Sep 20, 2018https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#event-1858539769
Never mark the DB dirty if it is read-only. Issue #1514https://github.com/sqlitebrowser/sqlitebrowser/commit/51db5073b38efa5dea3c320556a40cae4ca8a01c
#1514https://github.com/sqlitebrowser/sqlitebrowser/issues/1514
51db507https://github.com/sqlitebrowser/sqlitebrowser/commit/51db5073b38efa5dea3c320556a40cae4ca8a01c
https://github.com/chrisjlocke
chrisjlockehttps://github.com/chrisjlocke
on Jan 4, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-451365242
@tlhackquehttps://github.com/tlhackque
chrisjlockehttps://github.com/chrisjlocke
response requestedhttps://github.com/sqlitebrowser/sqlitebrowser/issues?q=state%3Aopen%20label%3A%22response%20requested%22
on Jan 4, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#event-2053896912
https://github.com/mgrojo
mgrojohttps://github.com/mgrojo
on Jan 4, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-451443881
#1536https://github.com/sqlitebrowser/sqlitebrowser/pull/1536
mgrojohttps://github.com/mgrojo
response requestedhttps://github.com/sqlitebrowser/sqlitebrowser/issues?q=state%3Aopen%20label%3A%22response%20requested%22
on Jan 4, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#event-2054478276
https://github.com/justinclift
justinclifthttps://github.com/justinclift
on Jan 4, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-451554915
https://github.com/mgrojo
mgrojohttps://github.com/mgrojo
on Jan 4, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-451586393
@MKleusberghttps://github.com/MKleusberg
https://github.com/chrisjlocke
chrisjlockehttps://github.com/chrisjlocke
on Jan 15, 2019https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#issuecomment-454378617
MKleusberghttps://github.com/MKleusberg
on Feb 13, 2020https://github.com/sqlitebrowser/sqlitebrowser/issues/1514#event-3034424671
Never mark the DB dirty if it is read-only. Issue #1514https://github.com/sqlitebrowser/sqlitebrowser/commit/b0065300e481b5db7e1abbc2291339ba5e4f0d63
#1514https://github.com/sqlitebrowser/sqlitebrowser/issues/1514
b006530https://github.com/sqlitebrowser/sqlitebrowser/commit/b0065300e481b5db7e1abbc2291339ba5e4f0d63
Sign up for freehttps://github.com/signup?return_to=https://github.com/sqlitebrowser/sqlitebrowser/issues/1514
Sign in to commenthttps://github.com/login?return_to=https://github.com/sqlitebrowser/sqlitebrowser/issues/1514
bugConfirmed bugs or reports that are very likely to be bugs.https://github.com/sqlitebrowser/sqlitebrowser/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.