The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions | Variables
sql_state.c File Reference

Implements sql_state matching and categorisation. More...

#include "rlm_sql.h"
+ Include dependency graph for sql_state.c:

Go to the source code of this file.

Functions

int sql_state_entries_from_cs (fr_trie_t *states, CONF_SECTION *cs)
 Insert the contents of a CONF_SECTION into the state trie. More...
 
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. More...
 
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. More...
 
fr_trie_tsql_state_trie_alloc (TALLOC_CTX *ctx)
 Allocate a sql_state trie, and insert the initial set of entries. More...
 

Variables

static sql_state_entry_t sql_2011_classes []
 These are standard, universal, error classes which all SQL servers should produce. More...
 

Detailed Description

Implements sql_state matching and categorisation.

Id
bd151fe16e6928449cddb6757077884537e7ee01

Definition in file sql_state.c.

Function Documentation

◆ sql_state_entries_from_cs()

int sql_state_entries_from_cs ( fr_trie_t states,
CONF_SECTION cs 
)

Insert the contents of a CONF_SECTION into the state trie.

The attribute side of the CONF_PAIR specifies the sqlclass and the value specifies the error code.

Parameters
[in]statesTrie of states.
[in]csContaining overrides to define new sql state entries or change existing ones.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 153 of file sql_state.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sql_state_entries_from_table()

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.

Parameters
[in]statesTrie of states.
[in]tableto insert.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 124 of file sql_state.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sql_state_entry_find()

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.

Parameters
[in]statesTrie of states.
[in]sql_stateto lookup.
Returns

Definition at line 203 of file sql_state.c.

+ Here is the call graph for this function:

◆ sql_state_trie_alloc()

fr_trie_t* sql_state_trie_alloc ( TALLOC_CTX *  ctx)

Allocate a sql_state trie, and insert the initial set of entries.

Parameters
[in]ctxto allocate states in.
Returns
  • SQL state trie on success.
  • NULL on failure.

Definition at line 102 of file sql_state.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ sql_2011_classes

sql_state_entry_t sql_2011_classes[]
static

These are standard, universal, error classes which all SQL servers should produce.

Note
Only vague descriptions of these errors were available when deciding return codes. If anyone wishes to change the classification of any of these errors, please send a pull request.

Definition at line 35 of file sql_state.c.