00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023 #ifndef HAILDB_H
00024 #define HAILDB_H
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #if defined(BUILDING_HAILDB)
00031 # if defined(HAVE_VISIBILITY)
00032 # define HAILDB_API __attribute__ ((visibility("default")))
00033 # define HAILDB_LOCAL __attribute__ ((visibility("hidden")))
00034 # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
00035 # define HAILDB_API __global
00036 # define HAILDB_LOCAL __hidden
00037 # elif defined(_MSC_VER)
00038 # define HAILDB_API extern __declspec(dllexport)
00039 # define HAILDB_LOCAL
00040 # endif
00041 #else
00042 # if defined(_MSC_VER)
00043 # define HAILDB_API extern __declspec(dllimport)
00044 # define HAILDB_LOCAL
00045 # else
00046 # define HAILDB_API
00047 # define HAILDB_LOCAL
00048 # endif
00049 #endif
00050
00056 enum db_err {
00057 DB_SUCCESS = 10,
00059
00060 DB_ERROR,
00065 DB_INTERRUPTED,
00068 DB_OUT_OF_MEMORY,
00072 DB_OUT_OF_FILE_SPACE,
00076 DB_LOCK_WAIT,
00081 DB_DEADLOCK,
00085 DB_ROLLBACK,
00087 DB_DUPLICATE_KEY,
00090 DB_QUE_THR_SUSPENDED,
00096 DB_MISSING_HISTORY,
00100 DB_CLUSTER_NOT_FOUND = 30,
00102 DB_TABLE_NOT_FOUND,
00104 DB_MUST_GET_MORE_FILE_SPACE,
00107 DB_TABLE_IS_BEING_USED,
00111 DB_TOO_BIG_RECORD,
00116 DB_LOCK_WAIT_TIMEOUT,
00118 DB_NO_REFERENCED_ROW,
00122 DB_ROW_IS_REFERENCED,
00126 DB_CANNOT_ADD_CONSTRAINT,
00129 DB_CORRUPTION,
00132 DB_COL_APPEARS_TWICE_IN_INDEX,
00135 DB_CANNOT_DROP_CONSTRAINT,
00138 DB_NO_SAVEPOINT,
00141 DB_TABLESPACE_ALREADY_EXISTS,
00145 DB_TABLESPACE_DELETED,
00148 DB_LOCK_TABLE_FULL,
00153 DB_FOREIGN_DUPLICATE_KEY,
00158 DB_TOO_MANY_CONCURRENT_TRXS,
00163 DB_UNSUPPORTED,
00168 DB_PRIMARY_KEY_IS_NULL,
00171 DB_FATAL,
00176
00177 DB_FAIL = 1000,
00179 DB_OVERFLOW,
00182 DB_UNDERFLOW,
00186 DB_STRONG_FAIL,
00189 DB_ZIP_OVERFLOW,
00192 DB_RECORD_NOT_FOUND = 1500,
00194 DB_END_OF_INDEX,
00198
00199 DB_SCHEMA_ERROR = 2000,
00201 DB_DATA_MISMATCH,
00204 DB_SCHEMA_NOT_LOCKED,
00209 DB_NOT_FOUND,
00212 DB_READONLY,
00215 DB_INVALID_INPUT,
00217 };
00218 #include <stdio.h>
00219
00220 #ifdef _MSC_VER
00221 #define strncasecmp _strnicmp
00222 #define strcasecmp _stricmp
00223 #endif
00224
00228 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
00229 #define UNIV_NO_IGNORE __attribute__ ((warn_unused_result))
00230 #else
00231 #define UNIV_NO_IGNORE
00232 #endif
00233
00234
00236 #define IB_TRUE 0x1UL
00237
00238 #define IB_FALSE 0x0UL
00239
00240
00244 typedef enum db_err ib_err_t;
00246 typedef unsigned char ib_byte_t;
00248 typedef unsigned long int ib_ulint_t;
00250 typedef void* ib_opaque_t;
00251
00252
00254 typedef ib_ulint_t ib_bool_t;
00256 typedef ib_opaque_t ib_charset_t;
00257
00258
00259 #if !defined(_MSC_VER)
00260 #include <stdint.h>
00261 #endif
00262
00263
00264
00265 #if defined(_MSC_VER)
00266
00267 typedef __int8 ib_i8_t;
00268 #else
00269
00270 typedef int8_t ib_i8_t;
00271 #endif
00272
00273 #if defined(_MSC_VER)
00274
00275 typedef unsigned __int8 ib_u8_t;
00276 #else
00277
00278 typedef uint8_t ib_u8_t;
00279 #endif
00280
00281 #if defined(_MSC_VER)
00282
00283 typedef __int16 ib_i16_t;
00284 #else
00285
00286 typedef int16_t ib_i16_t;
00287 #endif
00288
00289 #if defined(_MSC_VER)
00290
00291 typedef unsigned __int16 ib_u16_t;
00292 #else
00293
00294 typedef uint16_t ib_u16_t;
00295 #endif
00296
00297 #if defined(_MSC_VER)
00298
00299 typedef __int32 ib_i32_t;
00300 #else
00301
00302 typedef int32_t ib_i32_t;
00303 #endif
00304
00305 #if defined(_MSC_VER)
00306
00307 typedef unsigned __int32 ib_u32_t;
00308 #else
00309
00310 typedef uint32_t ib_u32_t;
00311 #endif
00312
00313 #if defined(_MSC_VER)
00314
00315 typedef __int64 ib_i64_t;
00316 #else
00317
00318 typedef int64_t ib_i64_t;
00319 #endif
00320
00321 #if defined(_MSC_VER)
00322
00323 typedef unsigned __int64 ib_u64_t;
00324 #else
00325
00326 typedef uint64_t ib_u64_t;
00327 #endif
00328
00330 typedef ib_u64_t ib_id_t;
00331
00333 typedef enum {
00334 IB_CFG_IBOOL,
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349 IB_CFG_ULINT,
00352 IB_CFG_ULONG,
00355 IB_CFG_TEXT,
00358 IB_CFG_CB
00360 } ib_cfg_type_t;
00361
00363 typedef enum {
00364 IB_VARCHAR = 1,
00367 IB_CHAR = 2,
00370 IB_BINARY = 3,
00374 IB_VARBINARY = 4,
00376 IB_BLOB = 5,
00379 IB_INT = 6,
00387 IB_SYS = 8,
00391 IB_FLOAT = 9,
00393 IB_DOUBLE = 10,
00395 IB_DECIMAL = 11,
00398 IB_VARCHAR_ANYCHARSET = 12,
00400 IB_CHAR_ANYCHARSET = 13
00402 } ib_col_type_t;
00403
00405 typedef enum {
00406 IB_TBL_REDUNDANT,
00409 IB_TBL_COMPACT,
00417 IB_TBL_DYNAMIC,
00420 IB_TBL_COMPRESSED
00422 } ib_tbl_fmt_t;
00423
00425 typedef enum {
00426 IB_COL_NONE = 0,
00428 IB_COL_NOT_NULL = 1,
00430 IB_COL_UNSIGNED = 2,
00432 IB_COL_NOT_USED = 4,
00434 IB_COL_CUSTOM1 = 8,
00438 IB_COL_CUSTOM2 = 16,
00442 IB_COL_CUSTOM3 = 32
00445 } ib_col_attr_t;
00446
00447
00449 typedef enum {
00450 IB_LOCK_IS = 0,
00453 IB_LOCK_IX,
00456 IB_LOCK_S,
00459 IB_LOCK_X,
00462 IB_LOCK_NOT_USED,
00464 IB_LOCK_NONE,
00467 IB_LOCK_NUM = IB_LOCK_NONE
00468 } ib_lck_mode_t;
00469
00472 typedef enum {
00473 IB_CUR_G = 1,
00477 IB_CUR_GE = 2,
00482 IB_CUR_L = 3,
00486 IB_CUR_LE = 4
00490 } ib_srch_mode_t;
00491
00493 typedef enum {
00494 IB_CLOSEST_MATCH,
00496 IB_EXACT_MATCH,
00499 IB_EXACT_PREFIX
00504 } ib_match_mode_t;
00505
00507 typedef struct {
00508 ib_col_type_t type;
00510 ib_col_attr_t attr;
00512 ib_u32_t type_len;
00514 ib_u16_t client_type;
00517 ib_charset_t* charset;
00518 } ib_col_meta_t;
00519
00520
00526 typedef enum {
00527 IB_TRX_NOT_STARTED,
00530 IB_TRX_ACTIVE,
00534 IB_TRX_COMMITTED_IN_MEMORY,
00536 IB_TRX_PREPARED
00537 } ib_trx_state_t;
00538
00539
00541 typedef enum {
00542 IB_TRX_READ_UNCOMMITTED = 0,
00549 IB_TRX_READ_COMMITTED = 1,
00559 IB_TRX_REPEATABLE_READ = 2,
00564 IB_TRX_SERIALIZABLE = 3
00566 } ib_trx_level_t;
00567
00571 typedef enum {
00572 IB_SHUTDOWN_NORMAL,
00576 IB_SHUTDOWN_NO_IBUFMERGE_PURGE,
00579 IB_SHUTDOWN_NO_BUFPOOL_FLUSH
00583 } ib_shutdown_t;
00584
00586 typedef void (*ib_cb_t)(void);
00587
00591 typedef FILE* ib_msg_stream_t;
00592
00595 typedef int (*ib_msg_log_t)(ib_msg_stream_t, const char*, ...);
00596
00597
00598
00599
00600
00601
00607 typedef struct ib_tpl_struct* ib_tpl_t;
00608
00616 typedef struct ib_trx_struct* ib_trx_t;
00617
00619 typedef struct ib_crsr_struct* ib_crsr_t;
00620
00622 typedef struct ib_tbl_sch_struct* ib_tbl_sch_t;
00623
00625 typedef struct ib_idx_sch_struct* ib_idx_sch_t;
00626
00628 typedef enum {
00629 IB_SCHEMA_VISITOR_TABLE = 1,
00630 IB_SCHEMA_VISITOR_TABLE_COL = 2,
00631 IB_SCHEMA_VISITOR_TABLE_AND_INDEX = 3,
00632 IB_SCHEMA_VISITOR_TABLE_AND_INDEX_COL = 4
00633 } ib_schema_visitor_version_t;
00634
00636 typedef int (*ib_schema_visitor_table_all_t) (
00639 void* arg,
00640 const char* name,
00641 int name_len);
00644 typedef int (*ib_schema_visitor_table_t) (
00647 void* arg,
00648 const char* name,
00649 ib_tbl_fmt_t tbl_fmt,
00650 ib_ulint_t page_size,
00651 int n_cols,
00652 int n_indexes);
00655 typedef int (*ib_schema_visitor_table_col_t) (
00658 void* arg,
00659 const char* name,
00660 ib_col_type_t col_type,
00661 ib_ulint_t len,
00662 ib_col_attr_t attr);
00665 typedef int (*ib_schema_visitor_index_t) (
00668 void* arg,
00669 const char* name,
00670 ib_bool_t clustered,
00671 ib_bool_t unique,
00672 int n_cols);
00675 typedef int (*ib_schema_visitor_index_col_t) (
00678 void* arg,
00679 const char* name,
00680 ib_ulint_t prefix_len);
00683 typedef struct {
00684 ib_schema_visitor_version_t version;
00686 ib_schema_visitor_table_t table;
00688 ib_schema_visitor_table_col_t table_col;
00690 ib_schema_visitor_index_t index;
00692 ib_schema_visitor_index_col_t index_col;
00694 } ib_schema_visitor_t;
00695
00696
00699 typedef int (*ib_client_cmp_t)(
00702 const ib_col_meta_t*
00703 col_meta,
00704 const ib_byte_t*p1,
00705 ib_ulint_t p1_len,
00706 const ib_byte_t*p2,
00707 ib_ulint_t p2_len);
00709
00711 #define IB_SQL_NULL 0xFFFFFFFF
00712
00713 #define IB_N_SYS_COLS 3
00714
00716 #define MAX_TEXT_LEN 4096
00717
00718
00720 #define IB_MAX_COL_NAME_LEN (64 * 3)
00721
00723 #define IB_MAX_TABLE_NAME_LEN (64 * 3)
00724
00729 #define ib_tbl_sch_add_blob_col(s, n) \
00730 ib_table_schema_add_col(s, n, IB_BLOB, IB_COL_NONE, 0, 0)
00731
00737 #define ib_tbl_sch_add_text_col(s, n) \
00738 ib_table_schema_add_col(s, n, IB_VARCHAR, IB_COL_NONE, 0, MAX_TEXT_LEN)
00739
00746 #define ib_tbl_sch_add_varchar_col(s, n, l) \
00747 ib_table_schema_add_col(s, n, IB_VARCHAR, IB_COL_NONE, 0, l)
00748
00754 #define ib_tbl_sch_add_u32_col(s, n) \
00755 ib_table_schema_add_col(s, n, IB_INT, IB_COL_UNSIGNED, 0, 4)
00756
00762 #define ib_tbl_sch_add_u64_col(s, n) \
00763 ib_table_schema_add_col(s, n, IB_INT, IB_COL_UNSIGNED, 0, 8)
00764
00770 #define ib_tbl_sch_add_u64_notnull_col(s, n) \
00771 ib_table_schema_add_col(s, n, IB_INT, \
00772 IB_COL_NOT_NULL | IB_COL_UNSIGNED,0,\
00773 8)
00774
00780 #define ib_cfg_set_int(name, value) ib_cfg_set(name, value)
00781
00788 #define ib_cfg_set_text(name, value) ib_cfg_set(name, value)
00789
00795 #define ib_cfg_set_bool_on(name) ib_cfg_set(name, IB_TRUE)
00796
00802 #define ib_cfg_set_bool_off(name) ib_cfg_set(name, IB_FALSE)
00803
00810 #define ib_cfg_set_callback(name, value) ib_cfg_set(name, value)
00811
00813 extern ib_client_cmp_t ib_client_compare;
00814
00827
00843 HAILDB_API
00844 ib_u64_t
00845 ib_api_version(void) UNIV_NO_IGNORE;
00846
00847
00848
00857 HAILDB_API
00858 ib_err_t
00859 ib_init(void) UNIV_NO_IGNORE;
00860
00861
00862
00874 HAILDB_API
00875 ib_err_t
00876 ib_startup(
00877
00878 const char* format) UNIV_NO_IGNORE;
00879
00880
00890 HAILDB_API
00891 ib_err_t
00892 ib_shutdown(
00893
00894 ib_shutdown_t flag) UNIV_NO_IGNORE;
00895
00896
00909 HAILDB_API
00910 ib_err_t
00911 ib_trx_start(
00912
00913 ib_trx_t ib_trx,
00914 ib_trx_level_t ib_trx_level) UNIV_NO_IGNORE;
00915
00916
00924 HAILDB_API
00925 ib_trx_t
00926 ib_trx_begin(
00927
00928 ib_trx_level_t ib_trx_level) UNIV_NO_IGNORE;
00929
00930
00931
00940 HAILDB_API
00941 void
00942 ib_trx_set_client_data(
00943
00944 ib_trx_t ib_trx,
00945 void* client_data);
00946
00947
00959 HAILDB_API
00960 ib_trx_state_t
00961 ib_trx_state(
00962
00963 ib_trx_t ib_trx) UNIV_NO_IGNORE;
00964
00965
00974 HAILDB_API
00975 ib_err_t
00976 ib_trx_release(
00977
00978 ib_trx_t ib_trx) UNIV_NO_IGNORE;
00979
00980
00988 HAILDB_API
00989 ib_err_t
00990 ib_trx_commit(
00991
00992 ib_trx_t ib_trx) UNIV_NO_IGNORE;
00993
00994
01002 HAILDB_API
01003 ib_err_t
01004 ib_trx_rollback(
01005
01006 ib_trx_t ib_trx) UNIV_NO_IGNORE;
01007
01008
01022 HAILDB_API
01023 ib_err_t
01024 ib_table_schema_add_col(
01025
01026 ib_tbl_sch_t ib_tbl_sch,
01027 const char* name,
01028 ib_col_type_t ib_col_type,
01029 ib_col_attr_t ib_col_attr,
01030 ib_u16_t client_type,
01031 ib_ulint_t len) UNIV_NO_IGNORE;
01032
01033
01044 HAILDB_API
01045 ib_err_t
01046 ib_table_schema_add_index(
01047
01048 ib_tbl_sch_t ib_tbl_sch,
01049 const char* name,
01050 ib_idx_sch_t* ib_idx_sch) UNIV_NO_IGNORE;
01051
01052
01058 HAILDB_API
01059 void
01060 ib_table_schema_delete(
01061
01062 ib_tbl_sch_t ib_tbl_sch);
01063
01064
01075 HAILDB_API
01076 ib_err_t
01077 ib_table_schema_create(
01078
01079 const char* name,
01080 ib_tbl_sch_t* ib_tbl_sch,
01081 ib_tbl_fmt_t ib_tbl_fmt,
01082 ib_ulint_t page_size) UNIV_NO_IGNORE;
01083
01084
01093 HAILDB_API
01094 ib_err_t
01095 ib_index_schema_add_col(
01096
01097 ib_idx_sch_t ib_idx_sch,
01098 const char* name,
01099 ib_ulint_t prefix_len) UNIV_NO_IGNORE;
01100
01101
01111 HAILDB_API
01112 ib_err_t
01113 ib_index_schema_create(
01114
01115 ib_trx_t ib_usr_trx,
01116 const char* name,
01117 const char* table_name,
01118 ib_idx_sch_t* ib_idx_sch) UNIV_NO_IGNORE;
01119
01120
01127 HAILDB_API
01128 ib_err_t
01129 ib_index_schema_set_clustered(
01130
01131 ib_idx_sch_t ib_idx_sch) UNIV_NO_IGNORE;
01132
01133
01139 HAILDB_API
01140 void
01141 ib_cursor_set_simple_select(
01142
01143 ib_crsr_t ib_crsr);
01144
01145
01152 HAILDB_API
01153 ib_err_t
01154 ib_index_schema_set_unique(
01155
01156 ib_idx_sch_t ib_idx_sch) UNIV_NO_IGNORE;
01157
01158
01164 HAILDB_API
01165 void
01166 ib_index_schema_delete(
01167
01168 ib_idx_sch_t ib_idx_sch);
01169
01170
01181 HAILDB_API
01182 ib_err_t
01183 ib_table_create(
01184
01185 ib_trx_t ib_trx,
01186 const ib_tbl_sch_t ib_tbl_sch,
01187 ib_id_t* id) UNIV_NO_IGNORE;
01188
01189
01199 HAILDB_API
01200 ib_err_t
01201 ib_table_rename(
01202
01203 ib_trx_t ib_trx,
01204 const char* old_name,
01205 const char* new_name) UNIV_NO_IGNORE;
01206
01207
01216 HAILDB_API
01217 ib_err_t
01218 ib_index_create(
01219
01220 ib_idx_sch_t ib_idx_sch,
01221 ib_id_t* index_id) UNIV_NO_IGNORE;
01222
01223
01232 HAILDB_API
01233 ib_err_t
01234 ib_table_drop(
01235
01236 ib_trx_t trx,
01237 const char* name) UNIV_NO_IGNORE;
01238
01239
01248 HAILDB_API
01249 ib_err_t
01250 ib_index_drop(
01251
01252 ib_trx_t trx,
01253 ib_id_t index_id) UNIV_NO_IGNORE;
01254
01255
01264 HAILDB_API
01265 ib_err_t
01266 ib_cursor_open_table_using_id(
01267
01268 ib_id_t table_id,
01269 ib_trx_t ib_trx,
01270 ib_crsr_t* ib_crsr) UNIV_NO_IGNORE;
01271
01272
01281 HAILDB_API
01282 ib_err_t
01283 ib_cursor_open_index_using_id(
01284
01285 ib_id_t index_id,
01286 ib_trx_t ib_trx,
01287 ib_crsr_t* ib_crsr) UNIV_NO_IGNORE;
01288
01289
01298 HAILDB_API
01299 ib_err_t
01300 ib_cursor_open_index_using_name(
01301
01302 ib_crsr_t ib_open_crsr,
01303 const char* index_name,
01304 ib_crsr_t* ib_crsr) UNIV_NO_IGNORE;
01305
01306
01315 HAILDB_API
01316 ib_err_t
01317 ib_cursor_open_table(
01318
01319 const char* name,
01320 ib_trx_t ib_trx,
01321 ib_crsr_t* ib_crsr) UNIV_NO_IGNORE;
01322
01323
01330 HAILDB_API
01331 ib_err_t
01332 ib_cursor_reset(
01333
01334 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01335
01336
01343 HAILDB_API
01344 ib_err_t
01345 ib_cursor_close(
01346
01347 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01348
01349
01357 HAILDB_API
01358 ib_err_t
01359 ib_cursor_insert_row(
01360
01361 ib_crsr_t ib_crsr,
01362 const ib_tpl_t ib_tpl) UNIV_NO_IGNORE;
01363
01364
01373 HAILDB_API
01374 ib_err_t
01375 ib_cursor_update_row(
01376
01377 ib_crsr_t ib_crsr,
01378 const ib_tpl_t ib_old_tpl,
01379 const ib_tpl_t ib_new_tpl) UNIV_NO_IGNORE;
01380
01381
01388 HAILDB_API
01389 ib_err_t
01390 ib_cursor_delete_row(
01391
01392 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01393
01394
01402 HAILDB_API
01403 ib_err_t
01404 ib_cursor_read_row(
01405
01406 ib_crsr_t ib_crsr,
01407 ib_tpl_t ib_tpl) UNIV_NO_IGNORE;
01408
01409
01416 HAILDB_API
01417 ib_err_t
01418 ib_cursor_prev(
01419
01420 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01421
01422
01429 HAILDB_API
01430 ib_err_t
01431 ib_cursor_next(
01432
01433 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01434
01435
01442 HAILDB_API
01443 ib_err_t
01444 ib_cursor_first(
01445
01446 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01447
01448
01455 HAILDB_API
01456 ib_err_t
01457 ib_cursor_last(
01458
01459 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01460
01461
01472 HAILDB_API
01473 ib_err_t
01474 ib_cursor_moveto(
01475
01476 ib_crsr_t ib_crsr,
01477 ib_tpl_t ib_tpl,
01478 ib_srch_mode_t ib_srch_mode,
01479 int* result) UNIV_NO_IGNORE;
01480
01481
01489 HAILDB_API
01490 void
01491 ib_cursor_attach_trx(
01492
01493 ib_crsr_t ib_crsr,
01494 ib_trx_t ib_trx);
01495
01496
01502 HAILDB_API
01503 void
01504 ib_set_client_compare(
01505
01506 ib_client_cmp_t client_cmp_func);
01507
01508
01515 HAILDB_API
01516 void
01517 ib_cursor_set_match_mode(
01518
01519 ib_crsr_t ib_crsr,
01520 ib_match_mode_t match_mode);
01521
01522
01532 HAILDB_API
01533 ib_err_t
01534 ib_col_set_value(
01535
01536 ib_tpl_t ib_tpl,
01537 ib_ulint_t col_no,
01538 const void* src,
01539 ib_ulint_t len) UNIV_NO_IGNORE;
01540
01541
01549 HAILDB_API
01550 ib_ulint_t
01551 ib_col_get_len(
01552
01553 ib_tpl_t ib_tpl,
01554 ib_ulint_t i) UNIV_NO_IGNORE;
01555
01556
01566 HAILDB_API
01567 ib_ulint_t
01568 ib_col_copy_value(
01569
01570 ib_tpl_t ib_tpl,
01571 ib_ulint_t i,
01572 void* dst,
01573 ib_ulint_t len);
01574
01575
01584 HAILDB_API
01585 ib_err_t
01586 ib_tuple_read_i8(
01587
01588 ib_tpl_t ib_tpl,
01589 ib_ulint_t i,
01590 ib_i8_t* ival) UNIV_NO_IGNORE;
01591
01592
01601 HAILDB_API
01602 ib_err_t
01603 ib_tuple_read_u8(
01604
01605 ib_tpl_t ib_tpl,
01606 ib_ulint_t i,
01607 ib_u8_t* ival) UNIV_NO_IGNORE;
01608
01609
01618 HAILDB_API
01619 ib_err_t
01620 ib_tuple_read_i16(
01621
01622 ib_tpl_t ib_tpl,
01623 ib_ulint_t i,
01624 ib_i16_t* ival) UNIV_NO_IGNORE;
01625
01626
01635 HAILDB_API
01636 ib_err_t
01637 ib_tuple_read_u16(
01638
01639 ib_tpl_t ib_tpl,
01640 ib_ulint_t i,
01641 ib_u16_t* ival) UNIV_NO_IGNORE;
01642
01643
01652 HAILDB_API
01653 ib_err_t
01654 ib_tuple_read_i32(
01655
01656 ib_tpl_t ib_tpl,
01657 ib_ulint_t i,
01658 ib_i32_t* ival) UNIV_NO_IGNORE;
01659
01660
01669 HAILDB_API
01670 ib_err_t
01671 ib_tuple_read_u32(
01672
01673 ib_tpl_t ib_tpl,
01674 ib_ulint_t i,
01675 ib_u32_t* ival) UNIV_NO_IGNORE;
01676
01677
01686 HAILDB_API
01687 ib_err_t
01688 ib_tuple_read_i64(
01689
01690 ib_tpl_t ib_tpl,
01691 ib_ulint_t i,
01692 ib_i64_t* ival) UNIV_NO_IGNORE;
01693
01694
01703 HAILDB_API
01704 ib_err_t
01705 ib_tuple_read_u64(
01706
01707 ib_tpl_t ib_tpl,
01708 ib_ulint_t i,
01709 ib_u64_t* ival) UNIV_NO_IGNORE;
01710
01711
01719 HAILDB_API
01720 const void*
01721 ib_col_get_value(
01722
01723 ib_tpl_t ib_tpl,
01724 ib_ulint_t i) UNIV_NO_IGNORE;
01725
01726
01735 HAILDB_API
01736 ib_ulint_t
01737 ib_col_get_meta(
01738
01739 ib_tpl_t ib_tpl,
01740 ib_ulint_t i,
01741 ib_col_meta_t* ib_col_meta);
01742
01743
01750 HAILDB_API
01751 ib_tpl_t
01752 ib_tuple_clear(
01753
01754 ib_tpl_t ib_tpl) UNIV_NO_IGNORE;
01755
01756
01767 HAILDB_API
01768 ib_err_t
01769 ib_tuple_get_cluster_key(
01770
01771 ib_crsr_t ib_crsr,
01772 ib_tpl_t* ib_dst_tpl,
01773 const ib_tpl_t ib_src_tpl) UNIV_NO_IGNORE;
01774
01775
01784 HAILDB_API
01785 ib_err_t
01786 ib_tuple_copy(
01787
01788 ib_tpl_t ib_dst_tpl,
01789 const ib_tpl_t ib_src_tpl) UNIV_NO_IGNORE;
01790
01791
01798 HAILDB_API
01799 ib_tpl_t
01800 ib_sec_search_tuple_create(
01801
01802 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01803
01804
01811 HAILDB_API
01812 ib_tpl_t
01813 ib_sec_read_tuple_create(
01814
01815 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01816
01817
01824 HAILDB_API
01825 ib_tpl_t
01826 ib_clust_search_tuple_create(
01827
01828 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01829
01830
01837 HAILDB_API
01838 ib_tpl_t
01839 ib_clust_read_tuple_create(
01840
01841 ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01842
01843
01850 HAILDB_API
01851 ib_ulint_t
01852 ib_tuple_get_n_user_cols(
01853
01854 const ib_tpl_t ib_tpl) UNIV_NO_IGNORE;
01855
01856
01863 HAILDB_API
01864 ib_ulint_t
01865 ib_tuple_get_n_cols(
01866
01867 const ib_tpl_t ib_tpl) UNIV_NO_IGNORE;
01868
01869
01875 HAILDB_API
01876 void
01877 ib_tuple_delete(
01878
01879 ib_tpl_t ib_tpl);
01880
01881
01890 HAILDB_API
01891 ib_err_t
01892 ib_cursor_truncate(
01893
01894 ib_crsr_t* ib_crsr,
01895 ib_id_t* table_id) UNIV_NO_IGNORE;
01896
01897
01905 HAILDB_API
01906 ib_err_t
01907 ib_table_truncate(
01908
01909 const char* table_name,
01910 ib_id_t* table_id) UNIV_NO_IGNORE;
01911
01912
01920 HAILDB_API
01921 ib_err_t
01922 ib_table_get_id(
01923
01924 const char* table_name,
01925 ib_id_t* table_id) UNIV_NO_IGNORE;
01926
01927
01936 HAILDB_API
01937 ib_err_t
01938 ib_index_get_id(
01939
01940 const char* table_name,
01941 const char* index_name,
01942 ib_id_t* index_id) UNIV_NO_IGNORE;
01943
01944
01951 HAILDB_API
01952 ib_bool_t
01953 ib_database_create(
01954
01955 const char* dbname) UNIV_NO_IGNORE;
01956
01957
01965 HAILDB_API
01966 ib_err_t
01967 ib_database_drop(
01968
01969 const char* dbname) UNIV_NO_IGNORE;
01970
01971
01978 HAILDB_API
01979 ib_bool_t
01980 ib_cursor_is_positioned(
01981
01982 const ib_crsr_t ib_crsr) UNIV_NO_IGNORE;
01983
01984
01991 HAILDB_API
01992 ib_err_t
01993 ib_schema_lock_shared(
01994
01995 ib_trx_t ib_trx) UNIV_NO_IGNORE;
01996
01997
02004 HAILDB_API
02005 ib_err_t
02006 ib_schema_lock_exclusive(
02007
02008 ib_trx_t ib_trx) UNIV_NO_IGNORE;
02009
02010
02018 HAILDB_API
02019 ib_bool_t
02020 ib_schema_lock_is_exclusive(
02021
02022 const ib_trx_t ib_trx) UNIV_NO_IGNORE;
02023
02024
02029 HAILDB_API
02030 ib_bool_t
02031 ib_schema_lock_is_shared(
02032
02033 const ib_trx_t ib_trx) UNIV_NO_IGNORE;
02034
02035
02042 HAILDB_API
02043 ib_err_t
02044 ib_schema_unlock(
02045
02046 ib_trx_t ib_trx);
02047
02048
02056 HAILDB_API
02057 ib_err_t
02058 ib_cursor_lock(
02059
02060 ib_crsr_t ib_crsr,
02061 ib_lck_mode_t ib_lck_mode) UNIV_NO_IGNORE;
02062
02063
02072 HAILDB_API
02073 ib_err_t
02074 ib_table_lock(
02075
02076 ib_trx_t ib_trx,
02077 ib_id_t table_id,
02078 ib_lck_mode_t ib_lck_mode) UNIV_NO_IGNORE;
02079
02080
02088 HAILDB_API
02089 ib_err_t
02090 ib_cursor_set_lock_mode(
02091
02092 ib_crsr_t ib_crsr,
02093 ib_lck_mode_t ib_lck_mode) UNIV_NO_IGNORE;
02094
02095
02101 HAILDB_API
02102 void
02103 ib_cursor_set_cluster_access(
02104
02105 ib_crsr_t ib_crsr);
02106
02107
02126 HAILDB_API
02127 ib_err_t
02128 ib_table_schema_visit(
02129
02130 ib_trx_t ib_trx,
02131 const char* name,
02132 const ib_schema_visitor_t*
02133 visitor,
02134 void* arg) UNIV_NO_IGNORE;
02135
02136
02151 HAILDB_API
02152 ib_err_t
02153 ib_schema_tables_iterate(
02154
02155 ib_trx_t ib_trx,
02156 ib_schema_visitor_table_all_t
02157 visitor,
02158 void* arg) UNIV_NO_IGNORE;
02159
02160
02169 HAILDB_API
02170 ib_err_t
02171 ib_cfg_var_get_type(
02172
02173 const char* name,
02174 ib_cfg_type_t* type) UNIV_NO_IGNORE;
02175
02176
02185 HAILDB_API
02186 ib_err_t
02187 ib_cfg_set(
02188
02189 const char* name,
02190 ...) UNIV_NO_IGNORE;
02191
02192
02202 HAILDB_API
02203 ib_err_t
02204 ib_cfg_get(
02205
02206 const char* name,
02207 void* value) UNIV_NO_IGNORE;
02208
02209
02219 HAILDB_API
02220 ib_err_t
02221 ib_cfg_get_all(
02222
02223 const char*** names,
02224 ib_u32_t* names_num) UNIV_NO_IGNORE;
02225
02226
02237 HAILDB_API
02238 void
02239 ib_savepoint_take(
02240
02241 ib_trx_t ib_trx,
02242 const void* name,
02243 ib_ulint_t name_len);
02244
02245
02256 HAILDB_API
02257 ib_err_t
02258 ib_savepoint_release(
02259
02260 ib_trx_t ib_trx,
02261 const void* name,
02262 ib_ulint_t name_len) UNIV_NO_IGNORE;
02263
02264
02280 HAILDB_API
02281 ib_err_t
02282 ib_savepoint_rollback(
02283
02284 ib_trx_t ib_trx,
02285 const void* name,
02286 ib_ulint_t name_len) UNIV_NO_IGNORE;
02287
02288
02298 HAILDB_API
02299 ib_err_t
02300 ib_tuple_write_i8(
02301
02302 ib_tpl_t ib_tpl,
02303 int col_no,
02304 ib_i8_t val) UNIV_NO_IGNORE;
02305
02306
02316 HAILDB_API
02317 ib_err_t
02318 ib_tuple_write_i16(
02319
02320 ib_tpl_t ib_tpl,
02321 int col_no,
02322 ib_i16_t val) UNIV_NO_IGNORE;
02323
02324
02334 HAILDB_API
02335 ib_err_t
02336 ib_tuple_write_i32(
02337
02338 ib_tpl_t ib_tpl,
02339 int col_no,
02340 ib_i32_t val) UNIV_NO_IGNORE;
02341
02342
02352 HAILDB_API
02353 ib_err_t
02354 ib_tuple_write_i64(
02355
02356 ib_tpl_t ib_tpl,
02357 int col_no,
02358 ib_i64_t val) UNIV_NO_IGNORE;
02359
02360
02370 HAILDB_API
02371 ib_err_t
02372 ib_tuple_write_u8(
02373
02374 ib_tpl_t ib_tpl,
02375 int col_no,
02376 ib_u8_t val) UNIV_NO_IGNORE;
02377
02378
02388 HAILDB_API
02389 ib_err_t
02390 ib_tuple_write_u16(
02391
02392 ib_tpl_t ib_tpl,
02393 int col_no,
02394 ib_u16_t val) UNIV_NO_IGNORE;
02395
02396
02406 HAILDB_API
02407 ib_err_t
02408 ib_tuple_write_u32(
02409
02410 ib_tpl_t ib_tpl,
02411 int col_no,
02412 ib_u32_t val) UNIV_NO_IGNORE;
02413
02414
02424 HAILDB_API
02425 ib_err_t
02426 ib_tuple_write_u64(
02427
02428 ib_tpl_t ib_tpl,
02429 int col_no,
02430 ib_u64_t val) UNIV_NO_IGNORE;
02431
02432
02438 HAILDB_API
02439 void
02440 ib_cursor_stmt_begin(
02441
02442 ib_crsr_t ib_crsr);
02443
02444
02453 HAILDB_API
02454 ib_err_t
02455 ib_tuple_write_double(
02456
02457 ib_tpl_t ib_tpl,
02458 int col_no,
02459 double val) UNIV_NO_IGNORE;
02460
02461
02470 HAILDB_API
02471 ib_err_t
02472 ib_tuple_read_double(
02473
02474 ib_tpl_t ib_tpl,
02475 ib_ulint_t col_no,
02476 double* dval) UNIV_NO_IGNORE;
02477
02478
02487 HAILDB_API
02488 ib_err_t
02489 ib_tuple_write_float(
02490
02491 ib_tpl_t ib_tpl,
02492 int col_no,
02493 float val) UNIV_NO_IGNORE;
02494
02495
02504 HAILDB_API
02505 ib_err_t
02506 ib_tuple_read_float(
02507
02508 ib_tpl_t ib_tpl,
02509 ib_ulint_t col_no,
02510 float* fval) UNIV_NO_IGNORE;
02511
02512
02520 HAILDB_API
02521 void
02522 ib_logger_set(
02523
02524 ib_msg_log_t ib_msg_log,
02525 ib_msg_stream_t ib_msg_stream);
02526
02527
02535 HAILDB_API
02536 const char*
02537 ib_strerror(
02538
02539 ib_err_t db_errno) UNIV_NO_IGNORE;
02540
02541
02551 HAILDB_API
02552 ib_err_t
02553 ib_status_get_i64(
02554
02555 const char* name,
02556 ib_i64_t* dst) UNIV_NO_IGNORE;
02557
02558
02568 HAILDB_API
02569 ib_err_t
02570 ib_status_get_all(
02571
02572 const char*** names,
02573 ib_u32_t* names_num) UNIV_NO_IGNORE;
02574
02581 typedef void (*ib_panic_handler_t)(void*, int, char*, ...);
02582
02593 HAILDB_API
02594 void
02595 ib_set_panic_handler(ib_panic_handler_t new_panic_handler);
02596
02605 typedef int (*ib_trx_is_interrupted_handler_t)(void*);
02606
02617 HAILDB_API
02618 void
02619 ib_set_trx_is_interrupted_handler(ib_trx_is_interrupted_handler_t handler);
02620
02633 HAILDB_API
02634 ib_err_t
02635 ib_get_duplicate_key(ib_trx_t ib_trx, const char **table_name, const char **index_name);
02636
02638 typedef struct {
02639 ib_i64_t stat_n_rows;
02642 ib_u64_t stat_clustered_index_size;
02645 ib_u64_t stat_sum_of_other_index_sizes;
02647 ib_u64_t stat_modified_counter;
02658 } ib_table_stats_t;
02659
02660
02672 HAILDB_API
02673 ib_err_t
02674 ib_get_table_statistics(ib_crsr_t ib_crsr, ib_table_stats_t *table_stats, size_t sizeof_ib_table_stats_t);
02675
02688 HAILDB_API
02689 ib_err_t
02690 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);
02691
02701 HAILDB_API
02702 ib_err_t
02703 ib_update_table_statistics(ib_crsr_t crsr);
02704
02716 HAILDB_API
02717 ib_err_t
02718 ib_error_inject(int error_to_inject);
02719
02720 #ifdef __cplusplus
02721 }
02722 #endif
02723
02724 #endif