Cross reference for sq/mysql_driver.c of index.

# File sq/mysql_driver.c

      $Revision: 1.42 $

      SQL module (sq) - this is a MySQL implementation of the SQL module.

      Status: NOT REVUED, TESTED

## Included Files

- `#include "/home/shane/code/RIP/include/rip.h"`
  - `#include </home/shane/code/RIP/include/config.h>`
  - `#include <sys/param.h>`
  - `#include </ncc/dbwork/platforms/yucca-debug/glib-indep/include/glib-1.2/glib.h>`
  - `#include "/home/shane/code/RIP/include/AU_util.h"`
    - `#include <stdio.h>`
    - `#include <stdlib.h>`
    - `#include <string.h>`
    - `#include <sys/types.h>`
    - `#include <unistd.h>`
    - `#include <regex.h>`
    - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/aa.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
      - `#include <sys/types.h>`
      - `#include <glib.h>`
      - `#include </home/shane/code/RIP/include/inet6def.h>`
      - `#include </home/shane/code/RIP/include/erroutines.h>`
  - `#include "/home/shane/code/RIP/include/access_control.h"`
    - `#include "/home/shane/code/RIP/include/erroutines.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/rxroutines.h"`
      - `#include <glib.h>`
      - `#include <pthread.h>`
      - `#include <stubs.h>`
      - `#include </home/shane/code/RIP/include/memwrap.h>`
      - `#include <stdio.h>`
      - `#include <iproutines.h>`
      - `#include <erroutines.h>`
      - `#include "/home/shane/code/RIP/include/sk.h"`
        - `#include "/home/shane/code/RIP/include/stubs.h"`
        - `#include <sys/time.h>`
        - `#include <unistd.h>`
        - `#include <sys/types.h>`
        - `#include <sys/socket.h>`
        - `#include <netinet/in.h>`
        - `#include <netdb.h>`
        - `#include <pthread.h>`
        - `#include <stdlib.h>`
        - `#include <errno.h>`
        - `#include <fcntl.h>`
        - `#include <signal.h>`
        - `#include <stdio.h>`
        - `#include "/home/shane/code/RIP/include/iproutines.h"`
      - `#include "/home/shane/code/RIP/include/thread.h"`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
      - `#include "/usr/local/mysql/include/mysql/mysql.h"`
        - `#include <sys/types.h>`
        - `#include "/usr/local/mysql/include/mysql/mysql_com.h"`
        - `#include "/usr/local/mysql/include/mysql/mysql_version.h"`
      - `#include "/usr/local/mysql/include/mysql/mysqld_error.h"`
      - `#include "/home/shane/code/RIP/include/erroutines.h"`
  - `#include "/home/shane/code/RIP/include/bitmask.h"`
  - `#include "/home/shane/code/RIP/include/ca_adminAttribs.h"`
  - `#include "/home/shane/code/RIP/include/ca_configFns.h"`
    - `#include "/home/shane/code/RIP/include/ca_defs.h"`
      - `#include <pthread.h>`
      - `#include <glib.h>`
    - `#include <memwrap.h>`
    - `#include <erroutines.h>`
  - `#include "/home/shane/code/RIP/include/ca_defs.h"`
  - `#include "/home/shane/code/RIP/include/ca_dictionary.h"`
  - `#include "/home/shane/code/RIP/include/ca_macros.h"`
    - `#include "/home/shane/code/RIP/include/ca_adminAttribs.h"`
  - `#include "/home/shane/code/RIP/include/ca_srcAttribs.h"`
  - `#include "/home/shane/code/RIP/include/comparisons.h"`
  - `#include "/home/shane/code/RIP/include/constants.h"`
    - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/defs.h"`
    - `#include <glib.h>`
    - `#include "/home/shane/code/RIP/include/bitmask.h"`
    - `#include "/home/shane/code/RIP/include/DF_class_enum.def"`
    - `#include "/home/shane/code/RIP/include/DF_class_mask.def"`
    - `#include "/home/shane/code/RIP/include/DF_attribute_enum.def"`
    - `#include "/home/shane/code/RIP/include/DF_attribute_inv_attr_mask.def"`
    - `#include "/home/shane/code/RIP/include/which_keytypes.h"`
      - `#include "/home/shane/code/RIP/include/bitmask.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/rxroutines.h"`
  - `#include "/home/shane/code/RIP/include/er_arrays.h"`
    - `#include "/home/shane/code/RIP/include/erroutines.h"`
  - `#include "/home/shane/code/RIP/include/er_aspects.h"`
  - `#include "/home/shane/code/RIP/include/er_facilities.h"`
  - `#include "/home/shane/code/RIP/include/er_formats.h"`
  - `#include "/home/shane/code/RIP/include/er_macro.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/er_paths.h"`
    - `#include <sys/param.h>`
    - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/er_yacc_helper.h"`
  - `#include "/home/shane/code/RIP/include/erroutines.h"`
  - `#include "/home/shane/code/RIP/include/fdwrap.h"`
    - `#include <stdio.h>`
  - `#include "/home/shane/code/RIP/include/mg_getopt.h"`
  - `#include "/home/shane/code/RIP/include/globaldefs.h"`
  - `#include "/home/shane/code/RIP/include/gpg.h"`
    - `#include <netdb.h>`
    - `#include <unistd.h>`
    - `#include "/home/shane/code/RIP/include/mail_parser.h"`
      - `#include "/home/shane/code/RIP/include/gpg.h"`
      - `#include "/home/shane/code/RIP/include/memwrap.h"`
  - `#include "/home/shane/code/RIP/include/inet6def.h"`
  - `#include "/home/shane/code/RIP/include/iproutines.h"`
  - `#include "/home/shane/code/RIP/include/mail_parser.h"`
  - `#include "/home/shane/code/RIP/include/memwrap.h"`
  - `#include "/home/shane/code/RIP/include/mm.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/mail.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/linkage.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/osdep.h"`
      - `#include <string.h>`
      - `#include <sys/types.h>`
      - `#include <stdlib.h>`
      - `#include <dirent.h>`
      - `#include <fcntl.h>`
      - `#include <unistd.h>`
      - `#include <time.h>`
      - `#include <utime.h>`
      - `#include <syslog.h>`
      - `#include <sys/file.h>`
      - `#include <ustat.h>`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/env_unix.h"`
        - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/env.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/fs.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/ftl.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/nl.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/tcp.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/lockfix.h"`
    - `#include "/home/shane/code/RIP/include/gpg.h"`
    - `#include "/home/shane/code/RIP/include/mail_parser.h"`
    - `#include "/home/shane/code/RIP/include/memwrap.h"`
    - `#include "/ncc/dbwork/platforms/yucca-debug/glib-indep/include/glib-1.2/glib.h"`
  - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
  - `#include "/home/shane/code/RIP/include/nh.h"`
    - `#include <mysql_driver.h>`
  - `#include "/home/shane/code/RIP/include/notification.h"`
    - `#include <stdarg.h>`
    - `#include <stdio.h>`
    - `#include <strings.h>`
    - `#include <unistd.h>`
    - `#include <stdlib.h>`
    - `#include <time.h>`
    - `#include <glib.h>`
    - `#include "/home/shane/code/RIP/include/UP_util.h"`
      - `#include "/home/shane/code/RIP/include/syntax_api.h"`
  - `#include "/home/shane/code/RIP/include/numconv.h"`
  - `#include "/home/shane/code/RIP/include/pc_commands.h"`
  - `#include "/home/shane/code/RIP/include/properties.h"`
  - `#include "/home/shane/code/RIP/include/protocol_config.h"`
  - `#include "/home/shane/code/RIP/include/protocol_mirror.h"`
    - `#include <glib.h>`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/aa.h"`
      - `#include "/home/shane/code/RIP/include/iproutines.h"`
  - `#include "/home/shane/code/RIP/include/protocol_whois.h"`
    - `#include "/home/shane/code/RIP/include/query_command.h"`
      - `#include <glib.h>`
      - `#include "/home/shane/code/RIP/include/bitmask.h"`
      - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/query_command.h"`
  - `#include "/home/shane/code/RIP/include/query_instructions.h"`
    - `#include "/home/shane/code/RIP/include/rxroutines.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
    - `#include "/home/shane/code/RIP/include/query_command.h"`
    - `#include "/home/shane/code/RIP/include/defs.h"`
    - `#include "/home/shane/code/RIP/include/which_keytypes.h"`
    - `#include "/home/shane/code/RIP/include/access_control.h"`
    - `#include "/home/shane/code/RIP/include/ca_configFns.h"`
    - `#include "/home/shane/code/RIP/include/ca_dictionary.h"`
    - `#include "/home/shane/code/RIP/include/ca_macros.h"`
    - `#include "/home/shane/code/RIP/include/ca_srcAttribs.h"`
  - `#include "/home/shane/code/RIP/include/rp.h"`
    - `#include <stddef.h>`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <defs.h>`
    - `#include <iproutines.h>`
    - `#include <erroutines.h>`
    - `#include <rxroutines.h>`
    - `#include <mysql_driver.h>`
    - `#include "/home/shane/code/RIP/include/ca_defs.h"`
    - `#include <thread.h>`
  - `#include "/home/shane/code/RIP/include/rxroutines.h"`
  - `#include "/home/shane/code/RIP/include/server.h"`
  - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/stubs.h"`
  - `#include "/home/shane/code/RIP/include/syntax_api.h"`
  - `#include "/home/shane/code/RIP/include/ta.h"`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <stdio.h>`
    - `#include "/home/shane/code/RIP/include/stubs.h"`
    - `#include "/home/shane/code/RIP/include/memwrap.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
    - `#include "/home/shane/code/RIP/include/timediff.h"`
      - `#include <sys/time.h>`
  - `#include "/home/shane/code/RIP/include/thread.h"`
  - `#include "/home/shane/code/RIP/include/timediff.h"`
  - `#include "/home/shane/code/RIP/include/ud.h"`
  - `#include "/home/shane/code/RIP/include/ud_int.h"`
    - `#include <stdio.h>`
    - `#include <strings.h>`
    - `#include <glib.h>`
    - `#include <stdlib.h>`
    - `#include <ctype.h>`
    - `#include <unistd.h>`
    - `#include "/home/shane/code/RIP/include/defs.h"`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/erroutines.h"`
    - `#include "/home/shane/code/RIP/include/rp.h"`
    - `#include "/home/shane/code/RIP/include/nh.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
    - `#include "/home/shane/code/RIP/include/memwrap.h"`
    - `#include "/home/shane/code/RIP/include/ca_configFns.h"`
    - `#include "/home/shane/code/RIP/include/ca_dictionary.h"`
    - `#include "/home/shane/code/RIP/include/ca_macros.h"`
    - `#include "/home/shane/code/RIP/include/ca_srcAttribs.h"`
    - `#include "/home/shane/code/RIP/include/globaldefs.h"`
    - `#include "/home/shane/code/RIP/include/bitmask.h"`
    - `#include "/home/shane/code/RIP/include/which_keytypes.h"`
  - `#include "/home/shane/code/RIP/include/ud_tr.h"`
    - `#include "/home/shane/code/RIP/include/ud_int.h"`
  - `#include "/home/shane/code/RIP/include/ut_string.h"`
  - `#include "/home/shane/code/RIP/include/wh_queries.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/which_keytypes.h"`

- `#include <stdlib.h>`

- `#include <stdio.h>`

- `#include <time.h>`

- `#include <sys/timeb.h>`

- `#include <strings.h>`

- `#include <sys/types.h>`

- `#include <limits.h>`

- `#include <errno.h>`

- `#include <glib.h>`

## Global Variable Lock

`pthread_mutex_t Lock`

Included from | /home/shane/code/RIP/include/ca_defs.h
Visible in: |  | aa/aa.c
|  | ac/access_control.c
|  | ca/ca_configFns.c
|  | ca/ca_initFn.c
|  | ca/ca_sanityCheck.c
|  | ca/ca_sourceLoader.c
|  | ca/ca_values.c
|  | co/constants.c
|  | df/defs.c
|  | er/er.c
|  | er/er_arrays.c
|  | er/er_macro.c
|  | er/er_paths.c
|  | er/er_print.c
|  | ip/ip.c
|  | ma/bitmask.c
|  | mm/mm.c
|  | nh/nh.c
|  | pa/gpg.c
|  | pa/spawn.c
|  | pc/pc_commands.c
|  | pc/protocol_config.c
|  | pm/pm_serials.c
|  | pm/protocol_mirror.c
|  | pr/properties.c
|  | pw/protocol_whois.c
|  | qc/mg_getopt.c
|  | qc/query_command.c
|  | qi/query_instructions.c
|  | rp/rp_convert.c
|  | rp/rp_load.c
|  | rp/rp_search.c
|  | rp/rp_tree.c
|  | rp/rp_update.c
|  | rx/rx_node.c
|  | rx/rx_print.c
|  | rx/rx_search.c
|  | rx/rx_tree.c
|  | sk/cd_socket.c
|  | sk/cd_watchdog.c
|  | sk/sk_socket.c
|  | sq/mysql_driver.c
Used in: | ca_get_adminIntElement() | ca/ca_configFns.c
| ca_get_adminStrElement() | ca/ca_configFns.c
| ca_get_boolean() | ca/ca_configFns.c
| ca_get_dirlist() | ca/ca_configFns.c
| ca_get_int() | ca/ca_configFns.c
| ca_get_string() | ca/ca_configFns.c
| ca_set_boolean() | ca/ca_configFns.c
| ca_srchandle2Intelement() | ca/ca_configFns.c
| ca_srchandle2Strelement() | ca/ca_configFns.c

## Global Function SQ_abort_query()

`int SQ_abort_query ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | ER_dbg_va() | er/er.c
| SQ_close_connection() | sq/mysql_driver.c
| SQ_duplicate_connection() | sq/mysql_driver.c
| mysql_kill()
Called by: | qi_kill_body() | qi/query_instructions.c

## Global Function SQ_close_connection()

      Call this function to close a connection to the server

      SQ_connection_t *sql_connection The connection to the database.

      More:

      Authors:
            ottrey

    Online References:

        mysql_close()

`void SQ_close_connection ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_close()
Called by: | AC_acc_load() | ac/access_control.c
| AC_acl_sql() | ac/access_control.c
| PM_interact() | pm/protocol_mirror.c
| QI_execute() | qi/query_instructions.c
| RP_sql_load_reg() | rp/rp_load.c
| SQ_abort_query() | sq/mysql_driver.c
| SQ_get_connection() | sq/mysql_driver.c
| aa_find() | aa/aa.c
| pm_get_source_info() | pm/pm_serials.c
| sql_execute_watched() | qi/query_instructions.c

## Global Function SQ_duplicate_connection()

`MYSQL* SQ_duplicate_connection ( MYSQL* orig )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | SQ_get_connection() | sq/mysql_driver.c
Called by: | SQ_abort_query() | sq/mysql_driver.c
| sql_execute_watched() | qi/query_instructions.c

## Global Function SQ_errno()

      Get the error number for the last error.

      SQ_connection_t *sql_connection The connection to the database.

      More:

      Authors:
            ottrey

    Online References:

        mysql_free_result()

`int SQ_errno ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_errno()
Called by: | AC_acc_load() | ac/access_control.c
| AC_dbopen_admin() | ac/access_control.c
| PM_interact() | pm/protocol_mirror.c
| QI_execute() | qi/query_instructions.c
| RP_sql_load_attr_space() | rp/rp_load.c
| __report_sql_error() | qi/query_instructions.c
| aa_find() | aa/aa.c
| add_ref_name() | qi/query_instructions.c
| insert_radix_serials() | qi/query_instructions.c
| qi_collect_domain() | qi/query_instructions.c
| qi_collect_ids() | qi/query_instructions.c
| qi_fetch_references() | qi/query_instructions.c
| rx_node_has_mnt_irt() | qi/query_instructions.c
| write_objects() | qi/query_instructions.c

## Global Function SQ_error()

      Get the error string for the last error.

      SQ_connection_t *sql_connection The connection to the database.

      More:

      Authors:
            ottrey

    Online References:

        mysql_error()

`char* SQ_error ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_error()
Called by: | AC_acc_load() | ac/access_control.c
| AC_dbopen_admin() | ac/access_control.c
| NH_comrol() | nh/nh.c
| PM_get_minmax_serial() | pm/pm_serials.c
| PM_get_serial_object() | pm/pm_serials.c
| PM_interact() | pm/protocol_mirror.c
| QI_execute() | qi/query_instructions.c
| RP_sql_load_attr_space() | rp/rp_load.c
| SQ_get_connection() | sq/mysql_driver.c
| __report_sql_error() | qi/query_instructions.c
| aa_find() | aa/aa.c
| get_range() | nh/nh.c
| sq_get_minmax_id() | sq/mysql_driver.c

## Global Function SQ_escape_string()

      Returns a copy of the string passed that has been escaped so it
      may be safely used in SQL strings.

      Return values

      Escaped string (allocated memory which must be freed)

      More:

      Authors:
            shane

    Online References:

`char* SQ_escape_string ( MYSQL* sql_connection, char* str )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | UT_malloc_real(), mysql_real_escape_string(), strlen()

## Global Function SQ_execute_query()

      Execute the sql query.

      SQ_connection_t *sql_connection Connection to database.

      SQ_result_set_t *result ptr to the structure to hold result.
      May be NULL if no result is needed.

      Returns:
        0 if the query was successful.
        Non-zero if an error occured.

      More:

      Authors:
            ottrey, andrei, marek

    Online References:

        mysql_query()
        mysql_use_result()

`int SQ_execute_query ( MYSQL* sql_connection, const char* query, MYSQL_RES** result_ptr )`

`MYSQL* sql_connection`
  &nbs;
`const char* query`
  SQL query.
`MYSQL_RES** result_ptr`
  &nbs;

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | ER_dbg_va() | er/er.c
| ER_is_traced() | er/er.c
| SQ_get_affected_rows() | sq/mysql_driver.c
| UT_timediff(), UT_timeget(), mysql_free_result(), mysql_query(), mysql_store_result()
Called by: | AC_acc_load() | ac/access_control.c
| AC_acl_sql() | ac/access_control.c
| NH_comrol() | nh/nh.c
| PM_get_minmax_serial() | pm/pm_serials.c
| PM_get_serial_object() | pm/pm_serials.c
| QI_execute() | qi/query_instructions.c
| RP_sql_load_attr_space() | rp/rp_load.c
| RP_sql_load_reg() | rp/rp_load.c
| SQ_get_table_size() | sq/mysql_driver.c
| aa_find() | aa/aa.c
| add_ref_name() | qi/query_instructions.c
| create_range() | nh/nh.c
| get_range() | nh/nh.c
| insert_radix_serials() | qi/query_instructions.c
| qi_collect_domain() | qi/query_instructions.c
| qi_collect_ids() | qi/query_instructions.c
| qi_fetch_references() | qi/query_instructions.c
| rx_node_has_mnt_irt() | qi/query_instructions.c
| sq_get_minmax_id() | sq/mysql_driver.c
| sql_execute_watched() | qi/query_instructions.c
| update_range() | nh/nh.c

## Global Function SQ_execute_query_nostore()

`int SQ_execute_query_nostore ( MYSQL* sql_connection, const char* query, MYSQL_RES** result_ptr )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_query(), mysql_use_result()

## Global Function SQ_free_result()

      Free the result set.

      SQ_result_set_t *result The results.

      More:

      Authors:
            ottrey

    Online References:

        mysql_free_result()

`void SQ_free_result ( MYSQL_RES* result )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_free_result()
Called by: | AC_acc_load() | ac/access_control.c
| AC_acl_sql() | ac/access_control.c
| PM_get_minmax_serial() | pm/pm_serials.c
| PM_get_serial_object() | pm/pm_serials.c
| RP_sql_load_attr_space() | rp/rp_load.c
| SQ_get_table_size() | sq/mysql_driver.c
| aa_find() | aa/aa.c
| get_range() | nh/nh.c
| qi_collect_domain() | qi/query_instructions.c
| qi_fetch_references() | qi/query_instructions.c
| rx_node_has_mnt_irt() | qi/query_instructions.c
| sq_get_minmax_id() | sq/mysql_driver.c
| sql_execute_watched() | qi/query_instructions.c
| write_objects() | qi/query_instructions.c

## Global Function SQ_get_affected_rows()

      Get the row count of a table

      char *table   The table to be examined

      More:

      Authors:
            marek

`int SQ_get_affected_rows ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_affected_rows()
Called by: | SQ_execute_query() | sq/mysql_driver.c
| create_range() | nh/nh.c
| qi_collect_domain() | qi/query_instructions.c
| qi_collect_ids() | qi/query_instructions.c
| update_range() | nh/nh.c

## Global Function SQ_get_column_count()

      Get the column count.

      SQ_result_set_t *result The results from the query.

      More:

      Authors:
            ottrey

    Online References:

        mysql_num_fields()

`int SQ_get_column_count ( MYSQL_RES* result )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_num_fields()
Called by: | RP_sql_load_attr_space() | rp/rp_load.c

## Global Function SQ_get_column_int()

      Get an integer from the column.

      SQ_result_set_t *result The results.

      SQ_row_t *current_row The current row.

      returns -1 if error occurs, 0 otherwise.
      Note - it never says what error occured....

      More:

      Authors:
            ottrey

    Online References:

`int SQ_get_column_int ( MYSQL_RES* result, MYSQL_ROW* current_row, unsigned int column, long* resultptr )`

`MYSQL_RES* result`
  &nbs;
`MYSQL_ROW* current_row`
  &nbs;
`unsigned int column`
  The column index.
`long* resultptr`
  pointer where the result should be stored

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | ___errno(), strtol()
Called by: | qi_prep_run_refer() | qi/query_instructions.c
| rx_node_has_mnt_irt() | qi/query_instructions.c

## Global Function SQ_get_column_label()

      Get the column label.

      SQ_result_set_t *result The results from the query.

      More:

      Authors:
            ottrey

    Online References:

        mysql_fetch_field_direct()

`char* SQ_get_column_label ( MYSQL_RES* result, unsigned int column )`

`MYSQL_RES* result`
  &nbs;
`unsigned int column`
  The column index.

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | UT_strdup_real(), mysql_fetch_field_direct()
Called by: | SQ_result_to_string() | sq/mysql_driver.c

## Global Function SQ_get_column_max_length()

      Get the max length of the column.

      SQ_result_set_t *result The results from the query.

      More:

      Authors:
            ottrey

    Online References:

        mysql_fetch_field_direct()

`unsigned int SQ_get_column_max_length ( MYSQL_RES* result, unsigned int column )`

`MYSQL_RES* result`
  &nbs;
`unsigned int column`
  The column index.

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_fetch_field_direct()
Called by: | SQ_result_to_string() | sq/mysql_driver.c

## Global Function SQ_get_column_string()

      Get the column string.

      SQ_row_t *current_row The current row (obtained from a SQ_row_next() ).

      More:

      Authors:
            ottrey

    Online References:

`char* SQ_get_column_string ( MYSQL_RES* result, MYSQL_ROW* current_row, unsigned int column )`

`MYSQL_RES* result`
  &nbs;
`MYSQL_ROW* current_row`
  &nbs;
`unsigned int column`
  The column index.

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | UT_malloc_real(), memcpy(), mysql_fetch_lengths()
Called by: | AC_acc_load() | ac/access_control.c
| AC_acl_sql() | ac/access_control.c
| PM_get_minmax_serial() | pm/pm_serials.c
| PM_get_serial_object() | pm/pm_serials.c
| SQ_get_table_size() | sq/mysql_driver.c
| get_range() | nh/nh.c
| qi_fetch_references() | qi/query_instructions.c
| qi_prep_run_refer() | qi/query_instructions.c
| sq_get_minmax_id() | sq/mysql_driver.c
| write_results() | qi/query_instructions.c

## Global Function SQ_get_column_string_nocopy()

`char* SQ_get_column_string_nocopy ( MYSQL_RES* result, MYSQL_ROW* current_row, unsigned int column )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Called by: | aa_parserow() | aa/aa.c
| make_sql2pack() | rp/rp_load.c

## Global Function SQ_get_column_strings()

      Get the all the strings in one column.

      SQ_result_set_t *result The results.

      More:

      Authors:
            ottrey

    Online References:

`char* SQ_get_column_strings ( MYSQL_RES* result, unsigned int column )`

`MYSQL_RES* result`
  &nbs;
`unsigned int column`
  The column index.

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | UT_strdup_real(), g_string_append(), g_string_append_c(), g_string_free(), g_string_sized_new(), mysql_fetch_row()

## Global Function SQ_get_connection()

      Get a connection to the database.

      More:

      Authors:
            ottrey

    Online References:

        mysql_init()
        mysql_real_connect()

`MYSQL* SQ_get_connection ( const char* host, unsigned int port, const char* db, const char* user, const char* password )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | ER_perror() | er/er.c
| NOERR() | er/er.c
| SQ_close_connection() | sq/mysql_driver.c
| SQ_error() | sq/mysql_driver.c
| SQ_try_connection() | sq/mysql_driver.c
| fprintf(), sleep()
Called by: | AC_dbopen_admin() | ac/access_control.c
| PM_interact() | pm/protocol_mirror.c
| QI_execute() | qi/query_instructions.c
| RP_sql_load_reg() | rp/rp_load.c
| SQ_duplicate_connection() | sq/mysql_driver.c
| pm_get_source_info() | pm/pm_serials.c

## Global Function SQ_get_info()

      Get additional information about the most
      recently executed query.

      SQ_connection_t *sql_connection The connection to the database.
      int info[3] array of integers where information is stored

      The meaning of the numbers returned depends on the query type:

      info[SQL_RECORDS] - # of Records for INSERT
      info[SQL_MATCHES] - # of Matches for UPDATE
      info[SQL_DUPLICATES] - # of Duplicates
      info[SQL_WARNINGS] - # of Warnings

      More:

     Authors:
      andrei

    Online References:

        mysql_info()

`int SQ_get_info ( MYSQL* sql_connection, int info[3] )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | atoi(), mysql_info()

## Global Function SQ_get_insert_id()

      Get the ID that was most recently generated for an AUTO_INCREMENT field

      More:

      Authors:
            andrei

`long SQ_get_insert_id ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_insert_id()

## Global Function SQ_get_table_size()

      Get the row count of a table

      More:

      Authors:
            marek

`int SQ_get_table_size ( MYSQL* sql_connection, char* table )`

`MYSQL* sql_connection`
  &nbs;
`char* table`
  The table to be examined

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | SQ_execute_query() | sq/mysql_driver.c
| SQ_free_result() | sq/mysql_driver.c
| SQ_get_column_string() | sq/mysql_driver.c
| SQ_row_next() | sq/mysql_driver.c
| UT_free_real(), fprintf(), g_string_free(), g_string_new(), g_string_sprintf(), sscanf()

## Global Function SQ_info_to_string()

      Convert all available information about the sql server into a string.

      SQ_connection_t *sql_connection The connection to the database.

      More:

      Authors:
            ottrey

    Online References:

`char* SQ_info_to_string ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | UT_strdup_real(), g_string_append(), g_string_free(), g_string_sized_new(), g_string_sprintfa(), mysql_dump_debug_info(), mysql_errno(), mysql_error(), mysql_get_client_info(), mysql_get_host_info(), mysql_get_proto_info(), mysql_get_server_info(), mysql_info(), mysql_ping(), mysql_stat(), mysql_thread_id()

## Global Function SQ_num_rows()

      Call this function to find out how many rows are in a query result

      SQ_result_set_t *result The results.

      More:

      Authors:
            ottrey

    Online References:

        mysql_num_rows()

`int SQ_num_rows ( MYSQL_RES* result )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_num_rows()
Called by: | AC_acl_sql() | ac/access_control.c
| qi_collect_domain() | qi/query_instructions.c

## Global Function SQ_ping()

      Checks whether or not the connection to the server is working.
      If it has gone down, an automatic reconnection is attempted.

      Return values

      Zero if the server is alive. Non-zero if an error occurred.

      More:

      Authors:
            andrei

    Online References:

`int SQ_ping ( MYSQL* sql_connection )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_ping()

## Global Function SQ_result_to_string()

      Convert the result set to a string.

      SQ_result_set_t *result The results.

      More:

      Authors:
            ottrey

    Online References:

`char* SQ_result_to_string ( MYSQL_RES* result )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | SQ_get_column_label() | sq/mysql_driver.c
| SQ_get_column_max_length() | sq/mysql_driver.c
| UT_strdup_real(), mysql_fetch_row(), mysql_num_fields(), sprintf(), strcat(), strcpy(), strlen()

## Global Function SQ_row_next()

      Get the next row.

      SQ_result_set_t *result The results from the query.

      unsigned int column The column index.

      More:

      Authors:
            ottrey

    Online References:

        mysql_fetch_row()

`MYSQL_ROW* SQ_row_next ( MYSQL_RES* result )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | mysql_fetch_row()
Called by: | AC_acc_load() | ac/access_control.c
| AC_acl_sql() | ac/access_control.c
| PM_get_minmax_serial() | pm/pm_serials.c
| PM_get_serial_object() | pm/pm_serials.c
| RP_sql_load_attr_space() | rp/rp_load.c
| SQ_get_table_size() | sq/mysql_driver.c
| aa_parserow() | aa/aa.c
| get_range() | nh/nh.c
| qi_collect_domain() | qi/query_instructions.c
| qi_fetch_references() | qi/query_instructions.c
| rx_node_has_mnt_irt() | qi/query_instructions.c
| sq_get_minmax_id() | sq/mysql_driver.c
| write_results() | qi/query_instructions.c

## Global Function SQ_try_connection()

`er_ret_t SQ_try_connection ( MYSQL** conn, const char* host, unsigned int port, const char* db, const char* user, const char* password )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | fprintf(), mysql_init(), mysql_options(), mysql_real_connect()
Called by: | SQ_get_connection() | sq/mysql_driver.c

## Global Function sq_get_minmax_id()

`long sq_get_minmax_id ( MYSQL* sql_connection, char* id_name, char* table, int max )`

Prototyped in: | /home/shane/code/RIP/include/mysql_driver.h
Calls: | ER_perror() | er/er.c
| SQ_error() | sq/mysql_driver.c
| SQ_execute_query() | sq/mysql_driver.c
| SQ_free_result() | sq/mysql_driver.c
| SQ_get_column_string() | sq/mysql_driver.c
| SQ_row_next() | sq/mysql_driver.c
| UT_free_real(), atol(), fprintf(), g_string_free(), g_string_sized_new(), g_string_sprintf()
Called by: | create_range() | nh/nh.c

## Local Function asctime_r()

`static char* asctime_r ( const struct tm* __tm, char* __buf )`

Included from: | /usr/include/time.h
Calls: | __posix_asctime_r()

## Local Function ctime_r()

`static char* ctime_r ( const time_t* __time, char* __buf )`

Included from: | /usr/include/time.h
Calls: | __posix_ctime_r()

## Local Function getlogin_r()

`static int getlogin_r ( char* __name, int __len )`

Included from: | /usr/include/unistd.h
Calls: | __posix_getlogin_r()

## Local Function readdir_r()

`static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )`

Included from: | /usr/include/dirent.h
Calls: | __posix_readdir_r()

## Local Function sigwait()

`static int sigwait ( const sigset_t* __setp, int* __signo )`

Included from: | /usr/include/signal.h
Calls: | __posix_sigwait()

## Local Function ttyname_r()

`static int ttyname_r ( int __fildes, char* __buf, size_t __size )`

Included from: | /usr/include/unistd.h
Calls: | __posix_ttyname_r()