You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modeled C: no clause marks an operation valid on the failure-state resource; sqlite3_errmsg on a failed open (FailedDatabase) stays raw (ruling §18; spec §16.2b.4) #1612
Found by the SQLite facade (D51 stage 12, ruling §66) — a finding, not a decision; the item is left raw.
Spec §16.2b.4: "A resource owned by an error admits raw access only, unless the facade marks an operation as valid on the failure state; it is carried as a distinct type (FailedDatabase) that has no presented methods." Ruling §18: "A facade-specific error type may itself temporarily own the failure-state resource where required."
The facade language (stages 5–9) has the error type and the distinct failed-state type (D59), and no clause that marks an operation valid on it. SQLite's documented use of the failed handle is exactly one such operation: "if an error occurs … an error code is returned … Otherwise an error code is returned. The sqlite3_errmsg() or sqlite3_errmsg16() routines can be used to obtain an English language description of the error following a failure of any of the sqlite3_open() routines." So a program that wants the message of a failed open writes unsafe { sqlite3_errmsg(failed.repr) } on the FailedDatabase the error carries — raw access, unsafe in an application program.
Missing mechanism (to be ruled): a clause on the fn item, e.g.
fn sqlite3_errmsg
returns borrow CStr from param 0
valid on failed // presented on FailedDatabase as well
rendering the same lend/text-view method on the failed-state type (a view of it, invalidated by nothing else since nothing else is callable on it).
The SQLite fixtures match DatabaseError.FailedWithResource(status, failed) and report the status (SQLITE_CANTOPEN); the handle is closed when the error is dropped, which the debug-alloc fixture covers.
Activity
Facade: `valid on failed` presents a lend or text view on the failed-…
Facade: `valid on failed` presents a lend or text view on the failed-…
Facade: `valid on failed` presents a lend or text view on the failed-…
Modeled C stage 12b: optional callbacks, items valid on the failed st…
D71 facade rulings: ok lists, valid on failed, callback-scope handles…