Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

haildb.h File Reference

#include <stdio.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  ib_col_meta_t
struct  ib_schema_visitor_t
struct  ib_table_stats_t

Defines

#define HAILDB_API
#define HAILDB_LOCAL
#define UNIV_NO_IGNORE
#define IB_TRUE   0x1UL
#define IB_FALSE   0x0UL
#define IB_SQL_NULL   0xFFFFFFFF
#define IB_N_SYS_COLS   3
#define MAX_TEXT_LEN   4096
#define IB_MAX_COL_NAME_LEN   (64 * 3)
#define IB_MAX_TABLE_NAME_LEN   (64 * 3)
#define ib_tbl_sch_add_blob_col(s, n)   ib_table_schema_add_col(s, n, IB_BLOB, IB_COL_NONE, 0, 0)
#define ib_tbl_sch_add_text_col(s, n)   ib_table_schema_add_col(s, n, IB_VARCHAR, IB_COL_NONE, 0, MAX_TEXT_LEN)
#define ib_tbl_sch_add_varchar_col(s, n, l)   ib_table_schema_add_col(s, n, IB_VARCHAR, IB_COL_NONE, 0, l)
#define ib_tbl_sch_add_u32_col(s, n)   ib_table_schema_add_col(s, n, IB_INT, IB_COL_UNSIGNED, 0, 4)
#define ib_tbl_sch_add_u64_col(s, n)   ib_table_schema_add_col(s, n, IB_INT, IB_COL_UNSIGNED, 0, 8)
#define ib_tbl_sch_add_u64_notnull_col(s, n)
#define ib_cfg_set_int(name, value)   ib_cfg_set(name, value)
#define ib_cfg_set_text(name, value)   ib_cfg_set(name, value)
#define ib_cfg_set_bool_on(name)   ib_cfg_set(name, IB_TRUE)
#define ib_cfg_set_bool_off(name)   ib_cfg_set(name, IB_FALSE)
#define ib_cfg_set_callback(name, value)   ib_cfg_set(name, value)

Typedefs

typedef enum db_err ib_err_t
typedef unsigned char ib_byte_t
typedef unsigned long int ib_ulint_t
typedef void * ib_opaque_t
typedef ib_ulint_t ib_bool_t
typedef ib_opaque_t ib_charset_t
typedef int8_t ib_i8_t
typedef uint8_t ib_u8_t
typedef int16_t ib_i16_t
typedef uint16_t ib_u16_t
typedef int32_t ib_i32_t
typedef uint32_t ib_u32_t
typedef int64_t ib_i64_t
typedef uint64_t ib_u64_t
typedef ib_u64_t ib_id_t
typedef void(* ib_cb_t )(void)
typedef FILE * ib_msg_stream_t
typedef int(* ib_msg_log_t )(ib_msg_stream_t, const char *,...)
typedef struct ib_tpl_struct * ib_tpl_t
typedef struct ib_trx_struct * ib_trx_t
typedef struct ib_crsr_struct * ib_crsr_t
typedef struct ib_tbl_sch_struct * ib_tbl_sch_t
typedef struct ib_idx_sch_struct * ib_idx_sch_t
typedef int(* ib_schema_visitor_table_all_t )(void *arg, const char *name, int name_len)
typedef int(* ib_schema_visitor_table_t )(void *arg, const char *name, ib_tbl_fmt_t tbl_fmt, ib_ulint_t page_size, int n_cols, int n_indexes)
typedef int(* ib_schema_visitor_table_col_t )(void *arg, const char *name, ib_col_type_t col_type, ib_ulint_t len, ib_col_attr_t attr)
typedef int(* ib_schema_visitor_index_t )(void *arg, const char *name, ib_bool_t clustered, ib_bool_t unique, int n_cols)
typedef int(* ib_schema_visitor_index_col_t )(void *arg, const char *name, ib_ulint_t prefix_len)
typedef int(* ib_client_cmp_t )(const ib_col_meta_t *col_meta, const ib_byte_t *p1, ib_ulint_t p1_len, const ib_byte_t *p2, ib_ulint_t p2_len)
typedef void(* ib_panic_handler_t )(void *, int, char *,...)
typedef int(* ib_trx_is_interrupted_handler_t )(void *)

Enumerations

enum  db_err {
  DB_SUCCESS = 10, DB_ERROR, DB_INTERRUPTED, DB_OUT_OF_MEMORY,
  DB_OUT_OF_FILE_SPACE, DB_LOCK_WAIT, DB_DEADLOCK, DB_ROLLBACK,
  DB_DUPLICATE_KEY, DB_QUE_THR_SUSPENDED, DB_MISSING_HISTORY, DB_CLUSTER_NOT_FOUND = 30,
  DB_TABLE_NOT_FOUND, DB_MUST_GET_MORE_FILE_SPACE, DB_TABLE_IS_BEING_USED, DB_TOO_BIG_RECORD,
  DB_LOCK_WAIT_TIMEOUT, DB_NO_REFERENCED_ROW, DB_ROW_IS_REFERENCED, DB_CANNOT_ADD_CONSTRAINT,
  DB_CORRUPTION, DB_COL_APPEARS_TWICE_IN_INDEX, DB_CANNOT_DROP_CONSTRAINT, DB_NO_SAVEPOINT,
  DB_TABLESPACE_ALREADY_EXISTS, DB_TABLESPACE_DELETED, DB_LOCK_TABLE_FULL, DB_FOREIGN_DUPLICATE_KEY,
  DB_TOO_MANY_CONCURRENT_TRXS, DB_UNSUPPORTED, DB_PRIMARY_KEY_IS_NULL, DB_FATAL,
  DB_FAIL = 1000, DB_OVERFLOW, DB_UNDERFLOW, DB_STRONG_FAIL,
  DB_ZIP_OVERFLOW, DB_RECORD_NOT_FOUND = 1500, DB_END_OF_INDEX, DB_SCHEMA_ERROR = 2000,
  DB_DATA_MISMATCH, DB_SCHEMA_NOT_LOCKED, DB_NOT_FOUND, DB_READONLY,
  DB_INVALID_INPUT
}
enum  ib_cfg_type_t {
  IB_CFG_IBOOL, IB_CFG_ULINT, IB_CFG_ULONG, IB_CFG_TEXT,
  IB_CFG_CB
}
enum  ib_col_type_t {
  IB_VARCHAR = 1, IB_CHAR = 2, IB_BINARY = 3, IB_VARBINARY = 4,
  IB_BLOB = 5, IB_INT = 6, IB_SYS = 8, IB_FLOAT = 9,
  IB_DOUBLE = 10, IB_DECIMAL = 11, IB_VARCHAR_ANYCHARSET = 12, IB_CHAR_ANYCHARSET = 13
}
enum  ib_tbl_fmt_t { IB_TBL_REDUNDANT, IB_TBL_COMPACT, IB_TBL_DYNAMIC, IB_TBL_COMPRESSED }
enum  ib_col_attr_t {
  IB_COL_NONE = 0, IB_COL_NOT_NULL = 1, IB_COL_UNSIGNED = 2, IB_COL_NOT_USED = 4,
  IB_COL_CUSTOM1 = 8, IB_COL_CUSTOM2 = 16, IB_COL_CUSTOM3 = 32
}
enum  ib_lck_mode_t {
  IB_LOCK_IS = 0, IB_LOCK_IX, IB_LOCK_S, IB_LOCK_X,
  IB_LOCK_NOT_USED, IB_LOCK_NONE, IB_LOCK_NUM = IB_LOCK_NONE
}
enum  ib_srch_mode_t { IB_CUR_G = 1, IB_CUR_GE = 2, IB_CUR_L = 3, IB_CUR_LE = 4 }
enum  ib_match_mode_t { IB_CLOSEST_MATCH, IB_EXACT_MATCH, IB_EXACT_PREFIX }
enum  ib_trx_state_t { IB_TRX_NOT_STARTED, IB_TRX_ACTIVE, IB_TRX_COMMITTED_IN_MEMORY, IB_TRX_PREPARED }
enum  ib_trx_level_t { IB_TRX_READ_UNCOMMITTED = 0, IB_TRX_READ_COMMITTED = 1, IB_TRX_REPEATABLE_READ = 2, IB_TRX_SERIALIZABLE = 3 }
enum  ib_shutdown_t { IB_SHUTDOWN_NORMAL, IB_SHUTDOWN_NO_IBUFMERGE_PURGE, IB_SHUTDOWN_NO_BUFPOOL_FLUSH }
enum  ib_schema_visitor_version_t { IB_SCHEMA_VISITOR_TABLE = 1, IB_SCHEMA_VISITOR_TABLE_COL = 2, IB_SCHEMA_VISITOR_TABLE_AND_INDEX = 3, IB_SCHEMA_VISITOR_TABLE_AND_INDEX_COL = 4 }

Functions

HAILDB_API ib_u64_t ib_api_version (void) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_init (void) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_startup (const char *format) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_shutdown (ib_shutdown_t flag) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_trx_start (ib_trx_t ib_trx, ib_trx_level_t ib_trx_level) UNIV_NO_IGNORE
HAILDB_API ib_trx_t ib_trx_begin (ib_trx_level_t ib_trx_level) UNIV_NO_IGNORE
HAILDB_API void ib_trx_set_client_data (ib_trx_t ib_trx, void *client_data)
HAILDB_API ib_trx_state_t ib_trx_state (ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_trx_release (ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_trx_commit (ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_trx_rollback (ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_schema_add_col (ib_tbl_sch_t ib_tbl_sch, const char *name, ib_col_type_t ib_col_type, ib_col_attr_t ib_col_attr, ib_u16_t client_type, ib_ulint_t len) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_schema_add_index (ib_tbl_sch_t ib_tbl_sch, const char *name, ib_idx_sch_t *ib_idx_sch) UNIV_NO_IGNORE
HAILDB_API void ib_table_schema_delete (ib_tbl_sch_t ib_tbl_sch)
HAILDB_API ib_err_t ib_table_schema_create (const char *name, ib_tbl_sch_t *ib_tbl_sch, ib_tbl_fmt_t ib_tbl_fmt, ib_ulint_t page_size) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_index_schema_add_col (ib_idx_sch_t ib_idx_sch, const char *name, ib_ulint_t prefix_len) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_index_schema_create (ib_trx_t ib_usr_trx, const char *name, const char *table_name, ib_idx_sch_t *ib_idx_sch) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_index_schema_set_clustered (ib_idx_sch_t ib_idx_sch) UNIV_NO_IGNORE
HAILDB_API void ib_cursor_set_simple_select (ib_crsr_t ib_crsr)
HAILDB_API ib_err_t ib_index_schema_set_unique (ib_idx_sch_t ib_idx_sch) UNIV_NO_IGNORE
HAILDB_API void ib_index_schema_delete (ib_idx_sch_t ib_idx_sch)
HAILDB_API ib_err_t ib_table_create (ib_trx_t ib_trx, const ib_tbl_sch_t ib_tbl_sch, ib_id_t *id) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_rename (ib_trx_t ib_trx, const char *old_name, const char *new_name) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_index_create (ib_idx_sch_t ib_idx_sch, ib_id_t *index_id) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_drop (ib_trx_t trx, const char *name) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_index_drop (ib_trx_t trx, ib_id_t index_id) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_open_table_using_id (ib_id_t table_id, ib_trx_t ib_trx, ib_crsr_t *ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_open_index_using_id (ib_id_t index_id, ib_trx_t ib_trx, ib_crsr_t *ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_open_index_using_name (ib_crsr_t ib_open_crsr, const char *index_name, ib_crsr_t *ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_open_table (const char *name, ib_trx_t ib_trx, ib_crsr_t *ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_reset (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_close (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_insert_row (ib_crsr_t ib_crsr, const ib_tpl_t ib_tpl) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_update_row (ib_crsr_t ib_crsr, const ib_tpl_t ib_old_tpl, const ib_tpl_t ib_new_tpl) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_delete_row (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_read_row (ib_crsr_t ib_crsr, ib_tpl_t ib_tpl) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_prev (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_next (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_first (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_last (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_moveto (ib_crsr_t ib_crsr, ib_tpl_t ib_tpl, ib_srch_mode_t ib_srch_mode, int *result) UNIV_NO_IGNORE
HAILDB_API void ib_cursor_attach_trx (ib_crsr_t ib_crsr, ib_trx_t ib_trx)
HAILDB_API void ib_set_client_compare (ib_client_cmp_t client_cmp_func)
HAILDB_API void ib_cursor_set_match_mode (ib_crsr_t ib_crsr, ib_match_mode_t match_mode)
HAILDB_API ib_err_t ib_col_set_value (ib_tpl_t ib_tpl, ib_ulint_t col_no, const void *src, ib_ulint_t len) UNIV_NO_IGNORE
HAILDB_API ib_ulint_t ib_col_get_len (ib_tpl_t ib_tpl, ib_ulint_t i) UNIV_NO_IGNORE
HAILDB_API ib_ulint_t ib_col_copy_value (ib_tpl_t ib_tpl, ib_ulint_t i, void *dst, ib_ulint_t len)
HAILDB_API ib_err_t ib_tuple_read_i8 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_i8_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_u8 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_u8_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_i16 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_i16_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_u16 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_u16_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_i32 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_i32_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_u32 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_u32_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_i64 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_i64_t *ival) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_u64 (ib_tpl_t ib_tpl, ib_ulint_t i, ib_u64_t *ival) UNIV_NO_IGNORE
HAILDB_API const void * ib_col_get_value (ib_tpl_t ib_tpl, ib_ulint_t i) UNIV_NO_IGNORE
HAILDB_API ib_ulint_t ib_col_get_meta (ib_tpl_t ib_tpl, ib_ulint_t i, ib_col_meta_t *ib_col_meta)
HAILDB_API ib_tpl_t ib_tuple_clear (ib_tpl_t ib_tpl) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_get_cluster_key (ib_crsr_t ib_crsr, ib_tpl_t *ib_dst_tpl, const ib_tpl_t ib_src_tpl) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_copy (ib_tpl_t ib_dst_tpl, const ib_tpl_t ib_src_tpl) UNIV_NO_IGNORE
HAILDB_API ib_tpl_t ib_sec_search_tuple_create (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_tpl_t ib_sec_read_tuple_create (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_tpl_t ib_clust_search_tuple_create (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_tpl_t ib_clust_read_tuple_create (ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_ulint_t ib_tuple_get_n_user_cols (const ib_tpl_t ib_tpl) UNIV_NO_IGNORE
HAILDB_API ib_ulint_t ib_tuple_get_n_cols (const ib_tpl_t ib_tpl) UNIV_NO_IGNORE
HAILDB_API void ib_tuple_delete (ib_tpl_t ib_tpl)
HAILDB_API ib_err_t ib_cursor_truncate (ib_crsr_t *ib_crsr, ib_id_t *table_id) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_truncate (const char *table_name, ib_id_t *table_id) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_get_id (const char *table_name, ib_id_t *table_id) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_index_get_id (const char *table_name, const char *index_name, ib_id_t *index_id) UNIV_NO_IGNORE
HAILDB_API ib_bool_t ib_database_create (const char *dbname) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_database_drop (const char *dbname) UNIV_NO_IGNORE
HAILDB_API ib_bool_t ib_cursor_is_positioned (const ib_crsr_t ib_crsr) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_schema_lock_shared (ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_schema_lock_exclusive (ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_bool_t ib_schema_lock_is_exclusive (const ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_bool_t ib_schema_lock_is_shared (const ib_trx_t ib_trx) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_schema_unlock (ib_trx_t ib_trx)
HAILDB_API ib_err_t ib_cursor_lock (ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_table_lock (ib_trx_t ib_trx, ib_id_t table_id, ib_lck_mode_t ib_lck_mode) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cursor_set_lock_mode (ib_crsr_t ib_crsr, ib_lck_mode_t ib_lck_mode) UNIV_NO_IGNORE
HAILDB_API void ib_cursor_set_cluster_access (ib_crsr_t ib_crsr)
HAILDB_API ib_err_t ib_table_schema_visit (ib_trx_t ib_trx, const char *name, const ib_schema_visitor_t *visitor, void *arg) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_schema_tables_iterate (ib_trx_t ib_trx, ib_schema_visitor_table_all_t visitor, void *arg) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cfg_var_get_type (const char *name, ib_cfg_type_t *type) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cfg_set (const char *name,...) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cfg_get (const char *name, void *value) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_cfg_get_all (const char ***names, ib_u32_t *names_num) UNIV_NO_IGNORE
HAILDB_API void ib_savepoint_take (ib_trx_t ib_trx, const void *name, ib_ulint_t name_len)
HAILDB_API ib_err_t ib_savepoint_release (ib_trx_t ib_trx, const void *name, ib_ulint_t name_len) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_savepoint_rollback (ib_trx_t ib_trx, const void *name, ib_ulint_t name_len) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_i8 (ib_tpl_t ib_tpl, int col_no, ib_i8_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_i16 (ib_tpl_t ib_tpl, int col_no, ib_i16_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_i32 (ib_tpl_t ib_tpl, int col_no, ib_i32_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_i64 (ib_tpl_t ib_tpl, int col_no, ib_i64_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_u8 (ib_tpl_t ib_tpl, int col_no, ib_u8_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_u16 (ib_tpl_t ib_tpl, int col_no, ib_u16_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_u32 (ib_tpl_t ib_tpl, int col_no, ib_u32_t val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_u64 (ib_tpl_t ib_tpl, int col_no, ib_u64_t val) UNIV_NO_IGNORE
HAILDB_API void ib_cursor_stmt_begin (ib_crsr_t ib_crsr)
HAILDB_API ib_err_t ib_tuple_write_double (ib_tpl_t ib_tpl, int col_no, double val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_double (ib_tpl_t ib_tpl, ib_ulint_t col_no, double *dval) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_write_float (ib_tpl_t ib_tpl, int col_no, float val) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_tuple_read_float (ib_tpl_t ib_tpl, ib_ulint_t col_no, float *fval) UNIV_NO_IGNORE
HAILDB_API void ib_logger_set (ib_msg_log_t ib_msg_log, ib_msg_stream_t ib_msg_stream)
HAILDB_API const char * ib_strerror (ib_err_t db_errno) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_status_get_i64 (const char *name, ib_i64_t *dst) UNIV_NO_IGNORE
HAILDB_API ib_err_t ib_status_get_all (const char ***names, ib_u32_t *names_num) UNIV_NO_IGNORE
HAILDB_API void ib_set_panic_handler (ib_panic_handler_t new_panic_handler)
HAILDB_API void ib_set_trx_is_interrupted_handler (ib_trx_is_interrupted_handler_t handler)
HAILDB_API ib_err_t ib_get_duplicate_key (ib_trx_t ib_trx, const char **table_name, const char **index_name)
HAILDB_API ib_err_t ib_get_table_statistics (ib_crsr_t ib_crsr, ib_table_stats_t *table_stats, size_t sizeof_ib_table_stats_t)
HAILDB_API ib_err_t ib_get_index_stat_n_diff_key_vals (ib_crsr_t ib_crsr, const char *index_name, ib_u64_t *ncols, ib_i64_t **n_diff)
HAILDB_API ib_err_t ib_update_table_statistics (ib_crsr_t crsr)
HAILDB_API ib_err_t ib_error_inject (int error_to_inject)

Variables

ib_client_cmp_t ib_client_compare

Detailed Description

<


Define Documentation

#define IB_FALSE   0x0UL

The boolean value of "false" used internally within InnoDB

#define IB_MAX_COL_NAME_LEN   (64 * 3)

The maximum length of a column name in a table schema.

#define IB_MAX_TABLE_NAME_LEN   (64 * 3)

The maximum length of a table name (plus database name).

#define IB_N_SYS_COLS   3

The number of system columns in a row.

#define IB_SQL_NULL   0xFFFFFFFF

Represents SQL_NULL length

#define ib_tbl_sch_add_blob_col (   s,
  n 
)    ib_table_schema_add_col(s, n, IB_BLOB, IB_COL_NONE, 0, 0)

Add a BLOB column to a table schema.

Parameters:
s is the the schema handle
n is the column name
#define ib_tbl_sch_add_text_col (   s,
  n 
)    ib_table_schema_add_col(s, n, IB_VARCHAR, IB_COL_NONE, 0, MAX_TEXT_LEN)

Add a BLOB column to a table schema.

Parameters:
s is the the schema handle
n is the column name Add a TEXT column to a table schema.
#define ib_tbl_sch_add_u32_col (   s,
  n 
)    ib_table_schema_add_col(s, n, IB_INT, IB_COL_UNSIGNED, 0, 4)

Add an UNSIGNED INT column to a table schema.

Parameters:
s is the schema handle
n is the column name
Returns:
DB_SUCCESS or error code
#define ib_tbl_sch_add_u64_col (   s,
  n 
)    ib_table_schema_add_col(s, n, IB_INT, IB_COL_UNSIGNED, 0, 8)

Add an UNSIGNED BIGINT column to a table schema.

Parameters:
s is the schema handle
n is the column name
Returns:
DB_SUCCESS or error code
#define ib_tbl_sch_add_u64_notnull_col (   s,
  n 
)
Value:

Add an UNSIGNED BIGINT NOT NULL column to a table schema.

Parameters:
s is the schema handle
n is the column name
Returns:
DB_SUCCESS or error code
#define ib_tbl_sch_add_varchar_col (   s,
  n,
  l 
)    ib_table_schema_add_col(s, n, IB_VARCHAR, IB_COL_NONE, 0, l)

Add a VARCHAR column to a table schema.

Parameters:
s is the schema handle
n is the column name
l the max length of the VARCHAR column
Returns:
DB_SUCCESS or error code
#define IB_TRUE   0x1UL

The boolean value of "true" used internally within InnoDB

#define MAX_TEXT_LEN   4096

The maximum length of a text column.

#define UNIV_NO_IGNORE

Some HailDB methods will produce warnings if the result of them is not checked in client code. This uses a GCC compiler extension.


Typedef Documentation

Representation of a "boolean" type within InnoDB

typedef unsigned char ib_byte_t

Representation of a byte within InnoDB

typedef void(* ib_cb_t)(void)

Generical InnoDB callback prototype.

A character set pointer

typedef int(* ib_client_cmp_t)(const ib_col_meta_t *col_meta,const ib_byte_t *p1,ib_ulint_t p1_len,const ib_byte_t *p2,ib_ulint_t p2_len)

This function is used to compare two data fields for which the data type is such that we must use the client code to compare them. in: key length

typedef struct ib_crsr_struct* ib_crsr_t

InnoDB cursor handle

typedef enum db_err ib_err_t

All InnoDB error codes are represented by ib_err_t. See db_err for a complete list of possible error codes.

typedef int16_t ib_i16_t

A signed 16 bit integral type.

typedef int32_t ib_i32_t

A signed 32 bit integral type.

typedef int64_t ib_i64_t

A signed 64 bit integral type.

typedef int8_t ib_i8_t

A signed 8 bit integral type.

typedef ib_u64_t ib_id_t

The integral type that represents internal table and index ids.

typedef struct ib_idx_sch_struct* ib_idx_sch_t

InnoDB index schema handle

typedef int(* ib_msg_log_t)(ib_msg_stream_t, const char *,...)

All log messages are written to this function.It should have the same behavior as fprintf(3).

typedef FILE* ib_msg_stream_t

The first argument to the InnoDB message logging function. By default it's set to stderr. You should treat ib_msg_stream_t as a void*, since it will probably change in the future.

typedef void* ib_opaque_t

Representation of a void* within InnoDB

typedef void(* ib_panic_handler_t)(void *, int, char *,...)

Type of callback in the event of HailDB panicing. Your callback should call exit() rather soon, as continuing after a panic will lead to errors returned from every API function. We have also not fully tested every possible outcome from not immediately calling exit().

typedef int(* ib_schema_visitor_index_col_t)(void *arg,const char *name,ib_ulint_t prefix_len)

Index column visitor Prefix length

typedef int(* ib_schema_visitor_index_t)(void *arg,const char *name,ib_bool_t clustered,ib_bool_t unique,int n_cols)

Index visitor No. of cols defined

typedef int(* ib_schema_visitor_table_all_t)(void *arg,const char *name,int name_len)

Visit all tables in the InnoDB schem. Length of name in bytes

typedef int(* ib_schema_visitor_table_col_t)(void *arg,const char *name,ib_col_type_t col_type,ib_ulint_t len,ib_col_attr_t attr)

Table column visitor Column attributes

typedef int(* ib_schema_visitor_table_t)(void *arg,const char *name,ib_tbl_fmt_t tbl_fmt,ib_ulint_t page_size,int n_cols,int n_indexes)

Table visitor No. of indexes defined

typedef struct ib_tbl_sch_struct* ib_tbl_sch_t

InnoDB table schema handle

typedef struct ib_tpl_struct* ib_tpl_t

InnoDB tuple handle. This handle can refer to either a cluster index tuple or a secondary index tuple. There are two types of tuples for each type of index, making a total of four types of tuple handles. There is a tuple for reading the entire row contents and another for searching on the index key.

typedef int(* ib_trx_is_interrupted_handler_t)(void *)

Callback for checking if a transaction has been interrupted. This callback lets you implement the MySQL KILL command kind of functionality. A transaction may block in the thread it's running in (for example, while acquiring row locks or doing IO) but other threads may do something that causes ib_trx_is_interrupted_handler_t to return true.

typedef struct ib_trx_struct* ib_trx_t

InnoDB transaction handle, all database operations need to be covered by transactions. This handle represents a transaction. The handle can be created with ib_trx_begin(), you commit your changes with ib_trx_commit() and undo your changes using ib_trx_rollback(). If the InnoDB deadlock monitor rolls back the transaction then you need to free the transaction using the function ib_trx_release(). You can query the state of an InnoDB transaction by calling ib_trx_state().

typedef uint16_t ib_u16_t

An unsigned 16 bit integral type.

typedef uint32_t ib_u32_t

An unsigned 32 bit integral type.

typedef uint64_t ib_u64_t

An unsigned 64 bit integral type.

typedef uint8_t ib_u8_t

An unsigned 8 bit integral type.

typedef unsigned long int ib_ulint_t

Representation of an unsigned long int within InnoDB


Enumeration Type Documentation

enum db_err

InnoDB error codes. Most of the error codes are internal to the engine and will not be seen by user applications. The partial error codes reflect the sub-state of an operation within InnoDB. Some of the error codes are deprecated and are no longer used.

Enumerator:
DB_SUCCESS 

A successult result

DB_ERROR 

This is a generic error code. It is used to classify error conditions that can't be represented by other codes

DB_INTERRUPTED 

An operation was interrupted by a user.

DB_OUT_OF_MEMORY 

Operation caused an out of memory error. Within InnoDB core code this is normally a fatal error

DB_OUT_OF_FILE_SPACE 

The operating system returned an out of file space error when trying to do an IO operation.

DB_LOCK_WAIT 

A lock request by transaction resulted in a lock wait. The thread is suspended internally by InnoDB and is put on a lock wait queue.

DB_DEADLOCK 

A lock request by a transaction resulted in a deadlock. The transaction was rolled back

DB_ROLLBACK 

Not used

DB_DUPLICATE_KEY 

A record insert or update violates a unique contraint.

DB_QUE_THR_SUSPENDED 

A query thread should be in state suspended but is trying to acquire a lock. Currently this is treated as a hard error and a violation of an invariant.

DB_MISSING_HISTORY 

Required history data has been deleted due to lack of space in rollback segment

DB_CLUSTER_NOT_FOUND 

This error is not used

DB_TABLE_NOT_FOUND 

The table could not be found

DB_MUST_GET_MORE_FILE_SPACE 

The database has to be stopped and restarted with more file space

DB_TABLE_IS_BEING_USED 

The user is trying to create a table in the InnoDB data dictionary but a table with that name already exists

DB_TOO_BIG_RECORD 

A record in an index would not fit on a compressed page, or it would become bigger than 1/2 free space in an uncompressed page frame

DB_LOCK_WAIT_TIMEOUT 

Lock wait lasted too long

DB_NO_REFERENCED_ROW 

Referenced key value not found for a foreign key in an insert or update of a row

DB_ROW_IS_REFERENCED 

Cannot delete or update a row because it contains a key value which is referenced

DB_CANNOT_ADD_CONSTRAINT 

Adding a foreign key constraint to a table failed

DB_CORRUPTION 

Data structure corruption noticed

DB_COL_APPEARS_TWICE_IN_INDEX 

InnoDB cannot handle an index where same column appears twice

DB_CANNOT_DROP_CONSTRAINT 

Dropping a foreign key constraint from a table failed

DB_NO_SAVEPOINT 

No savepoint exists with the given name

DB_TABLESPACE_ALREADY_EXISTS 

We cannot create a new single-table tablespace because a file of the same name already exists

DB_TABLESPACE_DELETED 

Tablespace does not exist or is being dropped right now

DB_LOCK_TABLE_FULL 

Lock structs have exhausted the buffer pool (for big transactions, InnoDB stores the lock structs in the buffer pool)

DB_FOREIGN_DUPLICATE_KEY 

Foreign key constraints activated but the operation would lead to a duplicate key in some table

DB_TOO_MANY_CONCURRENT_TRXS 

When InnoDB runs out of the preconfigured undo slots, this can only happen when there are too many concurrent transactions

DB_UNSUPPORTED 

When InnoDB sees any artefact or a feature that it can't recoginize or work with e.g., FT indexes created by a later version of the engine.

DB_PRIMARY_KEY_IS_NULL 

A column in the PRIMARY KEY was found to be NULL

DB_FATAL 

The application should clean up and quite ASAP. Fatal error, InnoDB cannot continue operation without risking database corruption.

DB_FAIL 

Partial failure code.

DB_OVERFLOW 

If an update or insert of a record doesn't fit in a Btree page

DB_UNDERFLOW 

If an update or delete of a record causes a Btree page to be below a minimum threshold

DB_STRONG_FAIL 

Failure to insert a secondary index entry to the insert buffer

DB_ZIP_OVERFLOW 

Failure trying to compress a page

DB_RECORD_NOT_FOUND 

Record not found

DB_END_OF_INDEX 

A cursor operation or search operation scanned to the end of the index.

DB_SCHEMA_ERROR 

Generic schema error

DB_DATA_MISMATCH 

Column update or read failed because the types mismatch

DB_SCHEMA_NOT_LOCKED 

If an API function expects the schema to be locked in exclusive mode and if it's not then that API function will return this error code

DB_NOT_FOUND 

Generic error code for "Not found" type of errors

DB_READONLY 

Generic error code for "Readonly" type of errors

DB_INVALID_INPUT 

Generic error code for "Invalid input" type of errors

Possible types for a configuration variable.

Enumerator:
IB_CFG_IBOOL 

The configuration parameter is of type ibool

IB_CFG_ULINT 

The configuration parameter is of type ulint

IB_CFG_ULONG 

The configuration parameter is of type ulong

IB_CFG_TEXT 

The configuration parameter is of type char*

IB_CFG_CB 

The configuration parameter is a callback parameter

InnoDB column attributes

Enumerator:
IB_COL_NONE 

No special attributes.

IB_COL_NOT_NULL 

Column data can't be NULL.

IB_COL_UNSIGNED 

Column is IB_INT and unsigned.

IB_COL_NOT_USED 

Future use, reserved.

IB_COL_CUSTOM1 

Custom precision type, this is a bit that is ignored by InnoDB and so can be set and queried by users.

IB_COL_CUSTOM2 

Custom precision type, this is a bit that is ignored by InnoDB and so can be set and queried by users.

IB_COL_CUSTOM3 

Custom precision type, this is a bit that is ignored by InnoDB and so can be set and queried by users.

column types that are supported.

Enumerator:
IB_VARCHAR 

Character varying length. The column is not padded.

IB_CHAR 

Fixed length character string. The column is padded to the right.

IB_BINARY 

Fixed length binary, similar to IB_CHAR but the column is not padded to the right.

IB_VARBINARY 

Variable length binary

IB_BLOB 

Binary large object, or a TEXT type

IB_INT 

Integer: can be any size from 1 - 8 bytes. If the size is 1, 2, 4 and 8 bytes then you can use the typed read and write functions. For other sizes you will need to use the ib_col_get_value() function and do the conversion yourself.

IB_SYS 

System column, this column can be one of DATA_TRX_ID, DATA_ROLL_PTR or DATA_ROW_ID.

IB_FLOAT 

C (float) floating point value.

IB_DECIMAL 

> C (double) floating point value. Decimal stored as an ASCII string

IB_VARCHAR_ANYCHARSET 

Any charset, varying length

IB_CHAR_ANYCHARSET 

Any charset, fixed length

InnoDB lock modes.

Enumerator:
IB_LOCK_IS 

Intention shared, an intention lock should be used to lock tables

IB_LOCK_IX 

Intention exclusive, an intention lock should be used to lock tables

IB_LOCK_S 

Shared locks should be used to lock rows

IB_LOCK_X 

Exclusive locks should be used to lock rows

IB_LOCK_NOT_USED 

Future use, reserved

IB_LOCK_NONE 

This is used internally to note consistent read

IB_LOCK_NUM 

number of lock modes

Various match modes used by ib_cursor_moveto()

Enumerator:
IB_CLOSEST_MATCH 

Closest match possible

IB_EXACT_MATCH 

Search using a complete key value

IB_EXACT_PREFIX 

Search using a key prefix which must match to rows: the prefix may contain an incomplete field (the last field in prefix may be just a prefix of a fixed length column)

Currently, this is also the number of callback functions in the struct.

When ib_shutdown() is called InnoDB may take a long time to shutdown because of background tasks e.g., purging deleted records. The following flags allow the user to control the shutdown behavior.

Enumerator:
IB_SHUTDOWN_NORMAL 

Normal shutdown, do insert buffer merge and purge before complete shutdown.

IB_SHUTDOWN_NO_IBUFMERGE_PURGE 

Do not do a purge and index buffer merge at shutdown.

IB_SHUTDOWN_NO_BUFPOOL_FLUSH 

Same as NO_IBUFMERGE_PURGE and in addition do not even flush the buffer pool to data files. No committed transactions are lost

InnoDB cursor search modes for ib_cursor_moveto(). Note: Values must match those found in page0cur.h

Enumerator:
IB_CUR_G 

If search key is not found then position the cursor on the row that is greater than the search key

IB_CUR_GE 

If the search key not found then position the cursor on the row that is greater than or equal to the search key

IB_CUR_L 

If search key is not found then position the cursor on the row that is less than the search key

IB_CUR_LE 

If search key is not found then position the cursor on the row that is less than or equal to the search key

InnoDB table format types

Enumerator:
IB_TBL_REDUNDANT 

Redundant row format, the column type and length is stored in the row.

IB_TBL_COMPACT 

Compact row format, the column type is not stored in the row. The length is stored in the row but the storage format uses a compact format to store the length of the column data and record data storage format also uses less storage.

IB_TBL_DYNAMIC 

Compact row format. BLOB prefixes are not stored in the clustered index

IB_TBL_COMPRESSED 

Similar to dynamic format but with pages compressed

Transaction isolation levels

Enumerator:
IB_TRX_READ_UNCOMMITTED 

Dirty read: non-locking SELECTs are performed so that we do not look at a possible earlier version of a record; thus they are not 'consistent' reads under this isolation level; otherwise like level 2

IB_TRX_READ_COMMITTED 

Somewhat Oracle-like isolation, except that in range UPDATE and DELETE we must block phantom rows with next-key locks; SELECT ... FOR UPDATE and ... LOCK IN SHARE MODE only lock the index records, NOT the gaps before them, and thus allow free inserting; each consistent read reads its own snapshot

IB_TRX_REPEATABLE_READ 

All consistent reads in the same trx read the same snapshot; full next-key locking used in locking reads to block insertions into gaps

IB_TRX_SERIALIZABLE 

All plain SELECTs are converted to LOCK IN SHARE MODE reads

The transaction state can be queried using the ib_trx_state() function. The InnoDB deadlock monitor can roll back a transaction and users should be prepared for this, especially where there is high contention. The way to determine the state of the transaction is to query it's state and check.

Enumerator:
IB_TRX_NOT_STARTED 

Has not started yet, the transaction has not ben started yet.

IB_TRX_ACTIVE 

The transaction is currently active and needs to be either committed or rolled back.

IB_TRX_COMMITTED_IN_MEMORY 

Not committed to disk yet

IB_TRX_PREPARED 

Support for 2PC/XA


Function Documentation

HAILDB_API ib_bool_t ib_schema_lock_is_shared ( const ib_trx_t  ib_trx  ) 

Checks if the data dictionary is latched in shared mode.

Parameters:
ib_trx is a transaction instance
Returns:
TRUE if shared latch

Variable Documentation

Callback function to compare InnoDB key columns in an index.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines