| Previous | Next |
| SQLITE_E_NOTICE | SQLITE_E_ROW |
SQLITE_E_WARNING
SQLITE_E_WARNING (0x87AF001C) represents SQLite warning emitted through sqlite3_log. Primary code 28 marks warning-class diagnostics sent to the configured SQLite error log. The warning may accompany successful API calls, so incident handling must preserve the extended code and context rather than treating the HRESULT alone as a transaction failure. Apply the native SQLite state-machine rules even though Windows stores the result in an HRESULT facility.
What to retain
| Field | Reason |
|---|---|
| Extended code | Distinguishes a generic warning from a specific warning such as automatic indexing. |
| SQLite message | Often contains the object or planner condition that prompted the report. |
| Statement and lifecycle | Shows whether the warning arose during prepare, step, schema change, or shutdown. |
Avoid callback hazards
The SQLite log callback should be fast and must not create a reentrant path that uses the same connection. Copy bounded diagnostic data and return.
Narrow response
- Check the direct return code of the operation
- Map the full extended result code before selecting remediation
- Reproduce with the same schema and query plan in a disposable copy
Verification
The underlying warning condition is understood or removed, while the log callback continues to receive an intentional test warning without destabilizing the database path.
Retain the extended warning identity
Do not collapse the value to the primary low-byte code before recording it. The extended code can identify a planner or recovery condition that deserves a different response, while the surrounding SQL operation may still complete successfully. Keep the SQLite library version and compile options with the event, because diagnostics and planner behavior can change across embedded builds even when the application binary is unchanged.
Questions that narrow the result
| Question | Diagnostic direction |
|---|---|
| Same input rejected elsewhere | Agreement at the same offset supports a representation or contract cause |
| Known-good sample fails locally | Attention shifts to local libraries, state, packaging, or configuration |
| Clean process behaves differently | Look for mutation, leaked state, concurrency, or cached negotiation |
| Boundary control no longer fails | Validation may have been disabled rather than corrected |
Preserve causal order
Timestamp acquisition, parsing or preparation, the call returning this result, automatic retry, and cleanup so a later network, storage, or disposal result cannot replace the original cause.
SQLite object lifetimes
| Object | Record |
|---|---|
| Database connection | Open flags, threading mode, transaction state, and latest connection error |
| Prepared statement | SQL identity, bindings, prepare API, and step call |
| Current row | Column values governed by the documented SQLITE_ROW lifetime |
| Log callback | Extended code and message retained even when the active API succeeds |
Native SQLite identity behind the result
Keep the primary and extended SQLite result before mapping it to this result, because masking the low byte or treating every HRESULT alike can erase the distinction among ROW, DONE, NOTICE, WARNING, and an extended warning.
Cleanup paths
- Finalize every statement that will not be reused
- Reset reusable statements only at a documented terminal state
- Avoid recursive SQLite use from the configured log callback
- Verify rollback, commit, and close independently from this result
Decision boundary
| Evidence | Use |
|---|---|
| Direct API return | Determines control flow for prepare, step, reset, finalize, or transaction work |
| Extended result code | Preserves the specific SQLite condition before HRESULT translation |
| Log callback event | Adds diagnostics but does not automatically replace the direct API result |
| Transaction outcome | Separately determines whether completed statement work becomes durable |
Technical references
- SQLite result and extended result codes
- SQLite sqlite3_step contract
- SQLite error logging interface
- SQLite query planner and automatic indexes
Looking for a different code? Search another status or error code.
