25 RCSID(
"$Id: bd151fe16e6928449cddb6757077884537e7ee01 $")
44 {
"0E",
"Invalid schema name list specification",
RLM_SQL_ERROR },
48 {
"0M",
"Invalid sql-invoked procedure reference",
RLM_SQL_ERROR },
51 {
"0S",
"Invalid transform group name specification",
RLM_SQL_ERROR },
52 {
"0T",
"Target table disagrees with cursor specification",
RLM_SQL_ERROR },
53 {
"0V",
"Attempt to assign to ordering column",
RLM_SQL_ERROR },
54 {
"0W",
"Prohibited statement encountered during trigger execution",
RLM_SQL_ERROR },
55 {
"0X",
"Invalid foreign server specification",
RLM_SQL_ERROR },
66 {
"28",
"Invalid authorization specification",
RLM_SQL_ERROR },
67 {
"2B",
"Dependent privilege descriptions still exist",
RLM_SQL_ERROR },
79 {
"39",
"External routine invocation exception",
RLM_SQL_ERROR },
128 for (entry = table; entry->
sql_state; entry++) {
129 size_t len = strlen(entry->
sql_state) * 8;
135 PERROR(
"Failed inserting state");
164 len = strlen(state) * 8;
166 cf_log_err(cp,
"Expected state to have a length between 2-5 chars, got %zu", len);
181 entry->
sql_state = talloc_strdup(entry, state);
182 entry->
meaning =
"USER DEFINED";
183 entry->
rcode = rcode;
186 entry->
rcode = rcode;
Configuration AVP similar to a fr_pair_t.
A section grouping multiple CONF_PAIR.
char const * cf_pair_attr(CONF_PAIR const *pair)
Return the attr of a CONF_PAIR.
int cf_pair_in_table(int32_t *out, fr_table_num_sorted_t const *table, size_t table_len, CONF_PAIR *cp)
Check to see if the CONF_PAIR value is present in the specified table.
void cf_pair_mark_parsed(CONF_PAIR *cp)
Mark a pair as parsed.
CONF_PAIR * cf_pair_find_next(CONF_SECTION const *cs, CONF_PAIR const *prev, char const *attr)
Find a pair with a name matching attr, after specified pair.
#define cf_log_err(_cf, _fmt,...)
#define fr_cond_assert(_x)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
sql_rcode_t rcode
What should happen if we receive this error.
size_t sql_rcode_table_len
char const * meaning
Verbose description.
fr_table_num_sorted_t const sql_rcode_table[]
sql_rcode_t
Action to take at end of an SQL query.
@ RLM_SQL_QUERY_INVALID
Query syntax error.
@ RLM_SQL_ALT_QUERY
Key constraint violation, use an alternative query.
@ RLM_SQL_RECONNECT
Stale connection, should reconnect.
@ RLM_SQL_ERROR
General connection/server error.
@ RLM_SQL_NO_MORE_ROWS
No more rows available.
char const * sql_state
2-5 char error code.
int sql_state_entries_from_table(fr_trie_t *states, sql_state_entry_t const table[])
Insert the contents of a state table into the state trie.
fr_trie_t * sql_state_trie_alloc(TALLOC_CTX *ctx)
Allocate a sql_state trie, and insert the initial set of entries.
sql_state_entry_t const * sql_state_entry_find(fr_trie_t const *states, char const *sql_state)
Lookup an SQL state based on an error code returned from the SQL server or client library.
int sql_state_entries_from_cs(fr_trie_t *states, CONF_SECTION *cs)
Insert the contents of a CONF_SECTION into the state trie.
static sql_state_entry_t sql_2011_classes[]
These are standard, universal, error classes which all SQL servers should produce.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
fr_trie_t * fr_trie_alloc(TALLOC_CTX *ctx, fr_trie_key_t get_key, fr_free_t free_data)
Allocate a trie.
void * fr_trie_remove_by_key(fr_trie_t *ft, void const *key, size_t keylen)
Remove a key and return the associated user ctx.
void * fr_trie_match_by_key(fr_trie_t const *ft, void const *key, size_t keylen)
Match a key and length in a trie and return user ctx, if any.
int fr_trie_insert_by_key(fr_trie_t *ft, void const *key, size_t keylen, void const *data)
Insert a key and user ctx into a trie.
void * fr_trie_lookup_by_key(fr_trie_t const *ft, void const *key, size_t keylen)
Lookup a key in a trie and return user ctx, if any.