Data Structures | Functions | Variables

MySQL db driver
[Database Abstraction Layer]

Collaboration diagram for MySQL db driver:

Data Structures

Functions

Variables


Function Documentation

static int bind_mysql_params ( MYSQL_STMT *  st,
db_fld_t *  params1,
db_fld_t *  params2 
) [static]

Up to two sets of parameters are provided. Both of them are used in UPDATE command, params1 as colspecs and values and params2 as WHERE clause. In other cases one set could be enough because values or match (WHERE clause) is needed.

Parameters:
st MySQL command statement
params1 first set of params
params2 second set of params
Returns:
0 if OK, <0 on MySQL error, >0 on DB API error
See also:
update_params

Definition at line 831 of file my_cmd.c.

References set_field().

Referenced by upload_cmd().

Here is the call graph for this function:

Here is the caller graph for this function:

static int build_delete_cmd ( str sql_cmd,
db_cmd_t cmd 
) [static]
Parameters:
sql_cmd SQL statement as a result of this function
cmd input for statement creation
Returns:
-1 on error, 0 on success

Definition at line 144 of file my_cmd.c.

References _str::len, db_cmd::match, _str::s, and db_cmd::table.

static int build_replace_cmd ( str sql_cmd,
db_cmd_t cmd 
) [static]
Parameters:
sql_cmd SQL statement as a result of this function
cmd input for statement creation

Definition at line 310 of file my_cmd.c.

References _str::len, _str::s, db_cmd::table, and db_cmd::vals.

static int build_select_cmd ( str sql_cmd,
db_cmd_t cmd 
) [static]
Parameters:
sql_cmd SQL statement as a result of this function
cmd input for statement creation

Definition at line 218 of file my_cmd.c.

References _str::len, db_cmd::match, db_cmd::result, _str::s, and db_cmd::table.

static int build_update_cmd ( str sql_cmd,
db_cmd_t cmd 
) [static]
Parameters:
sql_cmd SQL statement as a result of this function
cmd input for statement creation

Definition at line 419 of file my_cmd.c.

References string_buffer::len, _str::len, db_cmd::match, _str::s, string_buffer::s, sb_add(), set_str(), db_cmd::table, and db_cmd::vals.

Here is the call graph for this function:

static int exec_cmd_safe ( db_cmd_t cmd  )  [static]

The function contains all the necessary logic to detect reset or disconnected database connections and uploads commands to the server if necessary.

Parameters:
cmd Command to be executed
Returns:
0 if OK, <0 on MySQL failure, >0 on DB API failure

Definition at line 674 of file my_cmd.c.

References db_cmd::ctx, set_mysql_params(), and upload_cmd().

Here is the call graph for this function:

static int sb_add ( struct string_buffer sb,
str nstr 
) [inline, static]
Parameters:
sb string buffer
nstr string to add
Returns:
0 if OK, -1 if failed

Definition at line 373 of file my_cmd.c.

References string_buffer::increment, _str::len, string_buffer::len, _str::s, string_buffer::s, and string_buffer::size.

Referenced by build_update_cmd().

Here is the caller graph for this function:

static void set_field ( MYSQL_BIND *  bind,
db_fld_t *  fld 
) [static]
Parameters:
bind destination
fld source

Definition at line 768 of file my_cmd.c.

Referenced by bind_mysql_params().

Here is the caller graph for this function:

static void set_mysql_params ( db_cmd_t cmd  )  [inline, static]
Parameters:
cmd Command structure which contains pointers to MYSQL_STMT and parameters values
See also:
bind_mysql_params

Definition at line 553 of file my_cmd.c.

References db_cmd::match, and db_cmd::vals.

Referenced by exec_cmd_safe().

Here is the caller graph for this function:

static str* set_str ( str str,
const char *  s 
) [inline, static]

Used for temporary str variables.

Definition at line 405 of file my_cmd.c.

References _str::len, and _str::s.

Referenced by build_update_cmd().

Here is the caller graph for this function:

static int upload_cmd ( db_cmd_t cmd  )  [static]
Parameters:
cmd Command to be uploaded
Returns:
0 if OK, >0 on DB API errors, <0 on MySQL errors

Definition at line 1099 of file my_cmd.c.

References bind_mysql_params(), db_cmd::ctx, db_cmd::match, db_cmd::result, db_cmd::type, and db_cmd::vals.

Referenced by exec_cmd_safe().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 52 of file mysql_mod.c.

Referenced by db_mysql_submit_query().

int my_ping_interval = 5 * 60

Definition at line 52 of file mysql_mod.c.

Referenced by db_mysql_submit_query().