Troubleshooting SQLite Result Codes from Error 11 to 15

SQLServerF1

SQL return code 11 SQLITE_CORRUPT
The SQLITE_CORRUPT result code indicates that the database file has been corrupted. See the How To Corrupt Your Database Files for further discussion on how corruption can occur.
SQL return code 12 SQLITE_NOTFOUND
The SQLITE_NOTFOUND result code is used in two contexts. SQLITE_NOTFOUND can be returned by the sqlite3_file_control() interface to indicate that the file control opcode passed as the third argument was not recognized by the underlying VFS. SQLITE_NOTFOUND can also be returned by the xSetSystemCall() method of an sqlite3_vfs object.

The SQLITE_NOTFOUND result code is also used internally by the SQLite implementation, but those internal uses are not exposed to the application.
SQL return code 13 SQLITE_FULL
The SQLITE_FULL result code indicates that a write could not complete because the disk is full. Note that this error can occur when trying to write information into the main database file, or it can also occur when writing into temporary disk files.
Sometimes applications encounter this error even though there is an abundance of primary disk space because the error occurs when writing into temporary disk files on a system where temporary files are stored on a separate partition with much less space that the primary disk.

SQL return code 14 SQLITE_CANTOPEN
The SQLITE_CANTOPEN result code indicates that SQLite was unable to open a file. The file in question might be a primary database file or on of several temporary disk files.
SQL return code 15 SQLITE_PROTOCOL
The SQLITE_PROTOCOL result code indicates a problem with the file locking protocol used by SQLite. The SQLITE_PROTOCOL error is currently only returned when using WAL mode and attempting to start a new transaction. There is a race condition that can occur when two separate database connections both try to start a transaction at the same time in WAL mode. The loser of the race backs off and tries again, after a brief delay. If the same connection loses the locking race dozens of times over a span of multiple seconds, it will eventually give up and return SQLITE_PROTOCOL. The SQLITE_PROTOCOL error should appear in practice very, very rarely, and only when there are many separate processes all competing intensely to write to the same database.

Above are the list of SQLite Result Codes or Error Codes and their Description from Error 11 to 15 while performing certain operations against SQLite.

What are SQLite Errors?

SQLite programs have access to several types of common error information when the server returns an error. The SQLite message displayed contains three types of information:

A numeric error code. This number is SQLite and is not portable to other database systems. All result codes are integers. Symbolic names for all result codes are created using “#define” macros.Primary result code symbolic names are of the form “SQLITE_XXXXXX” where XXXXXX is a sequence of uppercase alphabetic characters. Extended result code names are of the form “SQLITE_XXXXXX_YYYYYYY” where the XXXXXX part is the corresponding primary result code and the YYYYYYY is an extension that further classifies the result code. The names and numeric values for existing result codes are fixed and unchanging. However, new result codes, and especially new extended result codes, might appear in future releases of SQLite.

Hope this was helpful.

Thanks,
SQLServerF1 Team
Information about SQLite Result Codes or Error Codes and Error Messages or Warnings on Windows, Linux Operating Systems.

 

Leave a Reply

Your email address will not be published. Required fields are marked *