Skip to content

Unexpected Extended Error Code #492

Answered by rogerbinns
scarlock asked this question in Q&A
Discussion options

You must be logged in to vote

I've run into a situation where the extended error code is not matching any of the values in apsw.mapping_extended_result_codes. Am I misunderstanding something?

See the SQLite doc. In practical terms result codes were an 8 bit number. When wanting to add detail in extended result codes, the bottom 8 bits are the corresponding result code. For example from the SQLite source:

#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */
#define SQLITE_CONSTRAINT_NOTNULL      (SQLITE_CONSTRAINT | (5<<8))

You got code 5 - SQLITE_BUSY. Because the value is less than 256 it is a standard result code, and not an extended one. I have added apsw.ext.result_string for the next release…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@scarlock
Comment options

@scarlock
Comment options

@rogerbinns
Comment options

@scarlock
Comment options

Answer selected by rogerbinns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants