Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Avoid exceptions for flow control during database creation - #11865

Merged
jfirebaugh merged 1 commit into
masterfrom
fix-10796
May 9, 2018
Merged

jfirebaugh merged 1 commit into
masterfrom
fix-10796

Conversation

@jfirebaugh

@jfirebaugh jfirebaugh commented May 8, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #10796.

Unfortuntely, it's difficult to avoid all exceptions, because sqlite3_open_v2 does not reliably return SQLITE_NOTADB if the file is not a database. However, this should avoid cases where developers misinterpret the SQLITE_CANTOPEN exception as a crash, which is the common case.

Unfortuntely, it's difficult to avoid all exceptions, because sqlite3_open_v2 does not reliably return SQLITE_NOTADB if the file is not a database. However, this should avoid cases where developers misinterpret the SQLITE_CANTOPEN exception as a crash, which is the common case.
@friedbunny friedbunny added refactor Core The cross-platform C++ core, aka mbgl labels May 8, 2018

@friedbunny friedbunny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jfirebaugh
jfirebaugh merged commit a1195f6 into master May 9, 2018
@jfirebaugh
jfirebaugh deleted the fix-10796 branch May 9, 2018 14:32
@kkaefer

kkaefer commented May 14, 2018

Copy link
Copy Markdown
Member

Started working on more tests for this a while ago: https://github.com/mapbox/mapbox-gl-native/tree/offlinedb-test
This branch specifically contains a way to simulate various exceptional situations like out of disk space, unwritable file systems etc. and the tests work very reliably on macOS. It still needs a Linux port though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Core The cross-platform C++ core, aka mbgl refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants