1#ifndef TARANTOOL_MODULE_H_INCLUDED
2#define TARANTOOL_MODULE_H_INCLUDED
47#if defined(__cplusplus)
57#define PACKAGE_VERSION_MAJOR 3
61#define PACKAGE_VERSION_MINOR 4
65#define PACKAGE_VERSION_PATCH 0
70#define PACKAGE_VERSION "3.4.0-entrypoint-229-ge2a6e2cd13"
75#define TZDATA_VERSION "2022a"
81#define SYSCONF_DIR "etc"
83#define INSTALL_PREFIX "/usr/local"
85#define BUILD_TYPE "Debug"
87#define BUILD_INFO "Linux-x86_64-Debug"
89#define BUILD_OPTIONS "cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE"
91#define COMPILER_INFO "GNU-13.3.0"
93#define TARANTOOL_C_FLAGS " -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/runner/work/tarantool/tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type -Werror -g -ggdb -O0 "
95#define TARANTOOL_CXX_FLAGS " -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=/home/runner/work/tarantool/tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror -g -ggdb -O0 "
98#define MODULE_LIBDIR "/usr/local/lib/tarantool"
100#define MODULE_LUADIR "/usr/local/share/tarantool"
102#define MODULE_INCLUDEDIR "/usr/local/include/tarantool"
104#define MODULE_LUAPATH "/usr/local/share/tarantool/?.lua;/usr/local/share/tarantool/?/init.lua;/usr/share/tarantool/?.lua;/usr/share/tarantool/?/init.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua"
106#define MODULE_LIBPATH "/usr/local/lib/x86_64-linux-gnu/tarantool/?.so;/usr/local/lib/tarantool/?.so;/usr/lib/x86_64-linux-gnu/lua/luarocks/lib/tarantool/?.so;/usr/lib/x86_64-linux-gnu/tarantool/?.so;/usr/local/lib/x86_64-linux-gnu/lua/5.1/?.so;/usr/local/lib/lua/5.1/?.so;/usr/lib/x86_64-linux-gnu/lua/luarocks/lib/lua/5.1/?.so;/usr/lib/x86_64-linux-gnu/lua/5.1/?.so"
108#define MODULE_LIBSUFFIX ".so"
119# define __has_feature(x) 0
128# define __has_builtin(x) 0
135#ifndef __has_attribute
136# define __has_attribute(x) 0
143#ifndef __has_cpp_attribute
144# define __has_cpp_attribute(x) 0
159#if __has_builtin(__builtin_expect) || defined(__GNUC__)
160# define likely(x) __builtin_expect(!! (x),1)
161# define unlikely(x) __builtin_expect(!! (x),0)
163# define likely(x) (x)
170# define unlikely(x) (x)
193#if __has_builtin(__builtin_prefetch) || defined(__GNUC__)
194# define prefetch(addr, ...) (__builtin_prefetch(addr, __VA_ARGS__))
196# define prefetch(addr, ...) ((void) addr)
204#if __has_builtin(__builtin_unreachable) || defined(__GNUC__)
205# define unreachable() (assert(0), __builtin_unreachable())
207# define unreachable() (assert(0))
217# if __has_builtin(__builtin_offsetof)
218# define offsetof(type, member) __builtin_offsetof(type, member)
220# define offsetof(type, member) ((size_t)&((type *)0)->member)
229#define container_of(ptr, type, member) ({ \
230 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
231 (type *)( (char *)__mptr - offsetof(type,member) );})
247#if defined(__cplusplus)
248# include <stdalign.h>
250#if !defined(alignas) && !defined(__alignas_is_defined)
251# if __has_feature(c_alignas) || (defined(__GNUC__) && __GNUC__ >= 5)
252# include <stdalign.h>
253# elif __has_attribute(aligned) || defined(__GNUC__)
254# define alignas(_n) __attribute__((aligned(_n)))
255# define __alignas_is_defined 1
261#if !defined(alignof) && !defined(__alignof_is_defined)
262# if __has_feature(c_alignof) || (defined(__GNUC__) && __GNUC__ >= 5)
263# include <stdalign.h>
264# elif defined(__GNUC__)
265# define alignof(_T) __alignof(_T)
267# define __alignof_is_defined 1
275# define alignof(_T) offsetof(struct { char c; _T member; }, member)
277# define __alignof_is_defined 1
306#if defined(__cplusplus) && __has_cpp_attribute(maybe_unused)
307# define MAYBE_UNUSED [[maybe_unused]]
308#elif __has_attribute(unused) || defined(__GNUC__)
309# define MAYBE_UNUSED __attribute__((unused))
325#if defined(__cplusplus) && __has_cpp_attribute(nodiscard)
326# define NODISCARD [[nodiscard]]
327#elif __has_attribute(warn_unused_result) || defined(__GNUC__)
328# define NODISCARD __attribute__((warn_unused_result))
343#if __has_attribute(noinline) || defined(__GNUC__)
344# define NOINLINE __attribute__((noinline))
360#if __has_attribute(always_inline) || defined(__GNUC__)
361# define ALWAYS_INLINE inline __attribute__((always_inline))
363# define ALWAYS_INLINE inline
377#if defined(__cplusplus) && __has_cpp_attribute(noreturn)
378# define NORETURN [[noreturn]]
379#elif __has_attribute(noreturn) || defined(__GNUC__)
380# define NORETURN __attribute__((noreturn))
390#if defined(__cplusplus) && __has_cpp_attribute(deprecated)
391# define DEPRECATED(_msg) [[deprecated(_msg)]]
392#elif __has_attribute(deprecated) || defined(__GNUC__)
393# define DEPREACTED __attribute__((deprecated(_msg)))
395# define DEPRECATED(_msg)
401#if defined(__cplusplus) && defined(__GNUC__)
402# define API_EXPORT extern "C" __attribute__ ((nothrow, visibility ("default")))
403#elif defined(__cplusplus)
404# define API_EXPORT extern "C"
405#elif defined(__GNUC__)
406# define API_EXPORT extern __attribute__ ((nothrow, visibility ("default")))
408# define API_EXPORT extern
418#if __has_attribute(format) || defined(__GNUC__)
419# define CFORMAT(_archetype, _stringindex, _firsttocheck) \
420 __attribute__((format(_archetype, _stringindex, _firsttocheck)))
422# define CFORMAT(archetype, stringindex, firsttocheck)
437#if __has_attribute(packed) || defined(__GNUC__)
438# define PACKED __attribute__((packed))
439#elif defined(__CC_ARM)
440# define PACKED __packed
450#if __has_feature(address_sanitizer)
451# define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
453# define NO_SANITIZE_ADDRESS
471#if defined(__cplusplus) && __has_cpp_attribute(fallthrough)
472# define FALLTHROUGH [[fallthrough]]
473#elif __has_attribute(fallthrough) || (defined(__GNUC__) && __GNUC__ >= 7)
474# define FALLTHROUGH __attribute__((fallthrough))
503 int (*old_handler)(
void *));
539 const char *error,
const char *format, va_list ap);
552typedef void (*
sayfunc_t)(int,
const char *, int,
const char *,
577#define say_file_line(level, file, line, error, format, ...) ({ \
578 if (say_log_level_is_enabled(level)) \
579 _say(level, file, line, error, format, ##__VA_ARGS__); })
591#define say(level, error, format, ...) ({ \
592 say_file_line(level, __FILE__, __LINE__, error, format, ##__VA_ARGS__); })
606#define say_error(format, ...) say(S_ERROR, NULL, format, ##__VA_ARGS__)
608#define say_crit(format, ...) say(S_CRIT, NULL, format, ##__VA_ARGS__)
610#define say_warn(format, ...) say(S_WARN, NULL, format, ##__VA_ARGS__)
612#define say_info(format, ...) say(S_INFO, NULL, format, ##__VA_ARGS__)
614#define say_verbose(format, ...) say(S_VERBOSE, NULL, format, ##__VA_ARGS__)
616#define say_debug(format, ...) say(S_DEBUG, NULL, format, ##__VA_ARGS__)
618#define say_syserror(format, ...) say(S_SYSERROR, _say_strerror(errno), \
619 format, ##__VA_ARGS__)
1160 const struct addrinfo *hints,
struct addrinfo **res,
1736 uint32_t path_len,
int index_base);
1905 BOX_KEY_PART_DEF_IS_NULLABLE = 1 << 0,
1906 BOX_KEY_PART_DEF_EXCLUDE_NULL = 1 << 1,
1907 BOX_KEY_PART_DEF_SORT_ORDER_DESC = 1 << 2,
2181 int multikey_idx, uint32_t *key_size_ptr);
2207 uint32_t *key_size_ptr);
2232 uint32_t *key_size_ptr);
2244 FIELD_TYPE_UNSIGNED,
2250 FIELD_TYPE_VARBINARY,
2254 FIELD_TYPE_DATETIME,
2255 FIELD_TYPE_INTERVAL,
2275 ON_CONFLICT_ACTION_NONE = 0,
2276 ON_CONFLICT_ACTION_ROLLBACK,
2277 ON_CONFLICT_ACTION_ABORT,
2278 ON_CONFLICT_ACTION_FAIL,
2279 ON_CONFLICT_ACTION_IGNORE,
2280 ON_CONFLICT_ACTION_REPLACE,
2281 ON_CONFLICT_ACTION_DEFAULT,
2282 on_conflict_action_MAX
2325#define SYSTEM_SPACES(_) \
2327 _(VINYL_DEFERRED_DELETE, 257, false) \
2329 _(SCHEMA, 272, true) \
2331 _(COLLATION, 276, true) \
2333 _(VCOLLATION, 277, true) \
2335 _(SPACE, 280, true) \
2337 _(VSPACE, 281, true) \
2339 _(SEQUENCE, 284, true) \
2341 _(SEQUENCE_DATA, 285, false) \
2343 _(VSEQUENCE, 286, true) \
2345 _(INDEX, 288, true) \
2347 _(VINDEX, 289, true) \
2349 _(FUNC, 296, true) \
2351 _(VFUNC, 297, true) \
2353 _(USER, 304, true) \
2355 _(VUSER, 305, true) \
2357 _(PRIV, 312, true) \
2359 _(VPRIV, 313, true) \
2361 _(CLUSTER, 320, true) \
2363 _(TRIGGER, 328, true) \
2365 _(TRUNCATE, 330, true) \
2367 _(SPACE_SEQUENCE, 340, true) \
2369 _(VSPACE_SEQUENCE, 341, true) \
2371 _(FK_CONSTRAINT, 356, true) \
2373 _(CK_CONSTRAINT, 364, true) \
2375 _(FUNC_INDEX, 372, true) \
2377 _(SESSION_SETTINGS, 380, true) \
2379 _(GC_CONSUMERS, 388, false) \
2382#define SYSTEM_SPACE_MEMBER(name, id, ...) BOX_ ## name ## _ID = id,
2390 BOX_ID_NIL = 2147483647
2467 const char *body,
const char *body_end,
2551box_insert(uint32_t space_id,
const char *tuple,
const char *tuple_end,
2566box_replace(uint32_t space_id,
const char *tuple,
const char *tuple_end,
2605 const char *key_end,
const char *ops,
const char *ops_end,
2627box_upsert(uint32_t space_id, uint32_t index_id,
const char *tuple,
2628 const char *tuple_end,
const char *ops,
const char *ops_end,
2654 struct ArrowSchema *schema);
2747 const char *header,
const char *header_end,
2748 const char *body,
const char *body_end);
2816 const char *key,
const char *key_end);
2886 const char *begin_key,
const char *begin_key_end,
2887 const char *end_key,
const char *end_key_end,
2888 const char **quantile_key,
const char **quantile_key_end);
2972 const char *key,
const char *key_end);
2988 uint32_t index_id, uint32_t *key_size);
3022 ITER_BITS_ALL_SET = 7,
3023 ITER_BITS_ANY_SET = 8,
3024 ITER_BITS_ALL_NOT_SET = 9,
3109 const char *format, ...);
3114#define box_error_raise(code, format, ...) \
3115 box_error_set(__FILE__, __LINE__, code, format, ##__VA_ARGS__)
3357#define BOX_DECIMAL_STRING_BUFFER_SIZE 128
3866enum box_error_code { ER_UNKNOWN = 0, ER_ILLEGAL_PARAMS = 1, ER_MEMORY_ISSUE = 2, ER_TUPLE_FOUND = 3, ER_UNSUPPORTED = 5, ER_READONLY = 7, ER_INJECTION = 8, ER_CREATE_SPACE = 9, ER_SPACE_EXISTS = 10, ER_DROP_SPACE = 11, ER_ALTER_SPACE = 12, ER_INDEX_TYPE = 13, ER_MODIFY_INDEX = 14, ER_LAST_DROP = 15, ER_TUPLE_FORMAT_LIMIT = 16, ER_DROP_PRIMARY_KEY = 17, ER_KEY_PART_TYPE = 18, ER_EXACT_MATCH = 19, ER_INVALID_MSGPACK = 20, ER_TUPLE_NOT_ARRAY = 22, ER_FIELD_TYPE = 23, ER_INDEX_PART_TYPE_MISMATCH = 24, ER_UPDATE_SPLICE = 25, ER_UPDATE_ARG_TYPE = 26, ER_FORMAT_MISMATCH_INDEX_PART = 27, ER_UNKNOWN_UPDATE_OP = 28, ER_UPDATE_FIELD = 29, ER_FUNCTION_TX_ACTIVE = 30, ER_KEY_PART_COUNT = 31, ER_PROC_LUA = 32, ER_NO_SUCH_PROC = 33, ER_NO_SUCH_TRIGGER = 34, ER_NO_SUCH_INDEX_ID = 35, ER_NO_SUCH_SPACE = 36, ER_NO_SUCH_FIELD_NO = 37, ER_EXACT_FIELD_COUNT = 38, ER_FIELD_MISSING = 39, ER_WAL_IO = 40, ER_MORE_THAN_ONE_TUPLE = 41, ER_ACCESS_DENIED = 42, ER_CREATE_USER = 43, ER_DROP_USER = 44, ER_NO_SUCH_USER = 45, ER_USER_EXISTS = 46, ER_CREDS_MISMATCH = 47, ER_UNKNOWN_REQUEST_TYPE = 48, ER_UNKNOWN_SCHEMA_OBJECT = 49, ER_CREATE_FUNCTION = 50, ER_NO_SUCH_FUNCTION = 51, ER_FUNCTION_EXISTS = 52, ER_BEFORE_REPLACE_RET = 53, ER_MULTISTATEMENT_TRANSACTION = 54, ER_TRIGGER_EXISTS = 55, ER_USER_MAX = 56, ER_NO_SUCH_ENGINE = 57, ER_RELOAD_CFG = 58, ER_CFG = 59, ER_SAVEPOINT_EMPTY_TX = 60, ER_NO_SUCH_SAVEPOINT = 61, ER_UNKNOWN_REPLICA = 62, ER_REPLICASET_UUID_MISMATCH = 63, ER_INVALID_UUID = 64, ER_REPLICASET_UUID_IS_RO = 65, ER_INSTANCE_UUID_MISMATCH = 66, ER_REPLICA_ID_IS_RESERVED = 67, ER_MISSING_REQUEST_FIELD = 69, ER_IDENTIFIER = 70, ER_DROP_FUNCTION = 71, ER_ITERATOR_TYPE = 72, ER_REPLICA_MAX = 73, ER_NO_CONNECTION = 77, ER_TIMEOUT = 78, ER_ACTIVE_TRANSACTION = 79, ER_CURSOR_NO_TRANSACTION = 80, ER_NO_SUCH_ROLE = 82, ER_ROLE_EXISTS = 83, ER_CREATE_ROLE = 84, ER_INDEX_EXISTS = 85, ER_SESSION_CLOSED = 86, ER_ROLE_LOOP = 87, ER_GRANT = 88, ER_PRIV_GRANTED = 89, ER_ROLE_GRANTED = 90, ER_PRIV_NOT_GRANTED = 91, ER_ROLE_NOT_GRANTED = 92, ER_MISSING_SNAPSHOT = 93, ER_CANT_UPDATE_PRIMARY_KEY = 94, ER_UPDATE_INTEGER_OVERFLOW = 95, ER_GUEST_USER_PASSWORD = 96, ER_TRANSACTION_CONFLICT = 97, ER_UNSUPPORTED_PRIV = 98, ER_LOAD_FUNCTION = 99, ER_FUNCTION_LANGUAGE = 100, ER_RTREE_RECT = 101, ER_PROC_C = 102, ER_PROTOCOL = 104, ER_WRONG_INDEX_RECORD = 106, ER_WRONG_INDEX_PARTS = 107, ER_WRONG_INDEX_OPTIONS = 108, ER_WRONG_SCHEMA_VERSION = 109, ER_MEMTX_MAX_TUPLE_SIZE = 110, ER_WRONG_SPACE_OPTIONS = 111, ER_UNSUPPORTED_INDEX_FEATURE = 112, ER_VIEW_IS_RO = 113, ER_NO_TRANSACTION = 114, ER_SYSTEM = 115, ER_LOADING = 116, ER_CONNECTION_TO_SELF = 117, ER_COMPRESSION = 119, ER_CHECKPOINT_IN_PROGRESS = 120, ER_SUB_STMT_MAX = 121, ER_COMMIT_IN_SUB_STMT = 122, ER_ROLLBACK_IN_SUB_STMT = 123, ER_DECOMPRESSION = 124, ER_INVALID_XLOG_TYPE = 125, ER_ALREADY_RUNNING = 126, ER_INDEX_FIELD_COUNT_LIMIT = 127, ER_LOCAL_INSTANCE_ID_IS_READ_ONLY = 128, ER_BACKUP_IN_PROGRESS = 129, ER_READ_VIEW_ABORTED = 130, ER_INVALID_INDEX_FILE = 131, ER_INVALID_RUN_FILE = 132, ER_INVALID_VYLOG_FILE = 133, ER_CASCADE_ROLLBACK = 134, ER_VY_QUOTA_TIMEOUT = 135, ER_PARTIAL_KEY = 136, ER_TRUNCATE_SYSTEM_SPACE = 137, ER_LOAD_MODULE = 138, ER_VINYL_MAX_TUPLE_SIZE = 139, ER_WRONG_DD_VERSION = 140, ER_WRONG_SPACE_FORMAT = 141, ER_CREATE_SEQUENCE = 142, ER_ALTER_SEQUENCE = 143, ER_DROP_SEQUENCE = 144, ER_NO_SUCH_SEQUENCE = 145, ER_SEQUENCE_EXISTS = 146, ER_SEQUENCE_OVERFLOW = 147, ER_NO_SUCH_INDEX_NAME = 148, ER_SPACE_FIELD_IS_DUPLICATE = 149, ER_CANT_CREATE_COLLATION = 150, ER_WRONG_COLLATION_OPTIONS = 151, ER_NULLABLE_PRIMARY = 152, ER_NO_SUCH_FIELD_NAME_IN_SPACE = 153, ER_TRANSACTION_YIELD = 154, ER_NO_SUCH_GROUP = 155, ER_SQL_BIND_TYPE = 157, ER_SQL_BIND_PARAMETER_MAX = 158, ER_SQL_EXECUTE = 159, ER_UPDATE_DECIMAL_OVERFLOW = 160, ER_SQL_BIND_NOT_FOUND = 161, ER_ACTION_MISMATCH = 162, ER_VIEW_MISSING_SQL = 163, ER_FOREIGN_KEY_CONSTRAINT = 164, ER_NO_SUCH_MODULE = 165, ER_NO_SUCH_COLLATION = 166, ER_CREATE_FK_CONSTRAINT = 167, ER_NO_SUCH_CONSTRAINT = 169, ER_CONSTRAINT_EXISTS = 170, ER_SQL_TYPE_MISMATCH = 171, ER_ROWID_OVERFLOW = 172, ER_DROP_COLLATION = 173, ER_ILLEGAL_COLLATION_MIX = 174, ER_SQL_NO_SUCH_PRAGMA = 175, ER_SQL_CANT_RESOLVE_FIELD = 176, ER_INDEX_EXISTS_IN_SPACE = 177, ER_INCONSISTENT_TYPES = 178, ER_SQL_SYNTAX_WITH_POS = 179, ER_SQL_STACK_OVERFLOW = 180, ER_SQL_SELECT_WILDCARD = 181, ER_SQL_STATEMENT_EMPTY = 182, ER_SQL_KEYWORD_IS_RESERVED = 183, ER_SQL_SYNTAX_NEAR_TOKEN = 184, ER_SQL_UNKNOWN_TOKEN = 185, ER_SQL_PARSER_GENERIC = 186, ER_SQL_COLUMN_COUNT_MAX = 188, ER_HEX_LITERAL_MAX = 189, ER_INT_LITERAL_MAX = 190, ER_SQL_PARSER_LIMIT = 191, ER_INDEX_DEF_UNSUPPORTED = 192, ER_MULTIKEY_INDEX_MISMATCH = 194, ER_CREATE_CK_CONSTRAINT = 195, ER_SQL_COLUMN_COUNT = 197, ER_FUNC_INDEX_FUNC = 198, ER_FUNC_INDEX_FORMAT = 199, ER_FUNC_INDEX_PARTS = 200, ER_NO_SUCH_FIELD_NAME = 201, ER_FUNC_WRONG_ARG_COUNT = 202, ER_BOOTSTRAP_READONLY = 203, ER_SQL_FUNC_WRONG_RET_COUNT = 204, ER_FUNC_INVALID_RETURN_TYPE = 205, ER_SQL_PARSER_GENERIC_WITH_POS = 206, ER_REPLICA_NOT_ANON = 207, ER_CANNOT_REGISTER = 208, ER_SESSION_SETTING_INVALID_VALUE = 209, ER_SQL_PREPARE = 210, ER_WRONG_QUERY_ID = 211, ER_SEQUENCE_NOT_STARTED = 212, ER_NO_SUCH_SESSION_SETTING = 213, ER_UNCOMMITTED_FOREIGN_SYNC_TXNS = 214, ER_SYNC_QUORUM_TIMEOUT = 216, ER_SYNC_ROLLBACK = 217, ER_TUPLE_METADATA_IS_TOO_BIG = 218, ER_XLOG_GAP = 219, ER_TOO_EARLY_SUBSCRIBE = 220, ER_SQL_CANT_ADD_AUTOINC = 221, ER_QUORUM_WAIT = 222, ER_INTERFERING_PROMOTE = 223, ER_ELECTION_DISABLED = 224, ER_TXN_ROLLBACK = 225, ER_NOT_LEADER = 226, ER_SYNC_QUEUE_UNCLAIMED = 227, ER_SYNC_QUEUE_FOREIGN = 228, ER_UNABLE_TO_PROCESS_IN_STREAM = 229, ER_UNABLE_TO_PROCESS_OUT_OF_STREAM = 230, ER_TRANSACTION_TIMEOUT = 231, ER_ACTIVE_TIMER = 232, ER_TUPLE_FIELD_COUNT_LIMIT = 233, ER_CREATE_CONSTRAINT = 234, ER_FIELD_CONSTRAINT_FAILED = 235, ER_TUPLE_CONSTRAINT_FAILED = 236, ER_CREATE_FOREIGN_KEY = 237, ER_FOREIGN_KEY_INTEGRITY = 238, ER_FIELD_FOREIGN_KEY_FAILED = 239, ER_COMPLEX_FOREIGN_KEY_FAILED = 240, ER_WRONG_SPACE_UPGRADE_OPTIONS = 241, ER_NO_ELECTION_QUORUM = 242, ER_SSL = 243, ER_SPLIT_BRAIN = 244, ER_OLD_TERM = 245, ER_INTERFERING_ELECTIONS = 246, ER_ITERATOR_POSITION = 247, ER_DEFAULT_VALUE_TYPE = 248, ER_UNKNOWN_AUTH_METHOD = 249, ER_INVALID_AUTH_DATA = 250, ER_INVALID_AUTH_REQUEST = 251, ER_WEAK_PASSWORD = 252, ER_OLD_PASSWORD = 253, ER_NO_SUCH_SESSION = 254, ER_WRONG_SESSION_TYPE = 255, ER_PASSWORD_EXPIRED = 256, ER_AUTH_DELAY = 257, ER_AUTH_REQUIRED = 258, ER_SQL_SEQ_SCAN = 259, ER_NO_SUCH_EVENT = 260, ER_BOOTSTRAP_NOT_UNANIMOUS = 261, ER_CANT_CHECK_BOOTSTRAP_LEADER = 262, ER_BOOTSTRAP_CONNECTION_NOT_TO_ALL = 263, ER_NIL_UUID = 264, ER_WRONG_FUNCTION_OPTIONS = 265, ER_MISSING_SYSTEM_SPACES = 266, ER_CLUSTER_NAME_MISMATCH = 267, ER_REPLICASET_NAME_MISMATCH = 268, ER_INSTANCE_NAME_DUPLICATE = 269, ER_INSTANCE_NAME_MISMATCH = 270, ER_SCHEMA_NEEDS_UPGRADE = 271, ER_SCHEMA_UPGRADE_IN_PROGRESS = 272, ER_DEPRECATED = 273, ER_UNCONFIGURED = 274, ER_CREATE_DEFAULT_FUNC = 275, ER_DEFAULT_FUNC_FAILED = 276, ER_INVALID_DEC = 277, ER_IN_ANOTHER_PROMOTE = 278, ER_SHUTDOWN = 279, ER_FIELD_VALUE_OUT_OF_RANGE = 280, ER_REPLICASET_NOT_FOUND = 281, ER_REPLICASET_NO_WRITABLE = 282, ER_REPLICASET_MORE_THAN_ONE_WRITABLE = 283, ER_TXN_COMMIT = 284, ER_READ_VIEW_BUSY = 285, ER_READ_VIEW_CLOSED = 286, ER_WAL_QUEUE_FULL = 287, ER_INVALID_VCLOCK = 288, ER_SYNC_QUEUE_FULL = 289, ER_KEY_PART_VALUE_OUT_OF_RANGE = 290, ER_REPLICA_GC = 291, ER_ALIEN_ENGINE = 292, ER_MVCC_UNAVAILABLE = 293, box_error_code_MAX };
3867#if defined(__cplusplus)
box_error_code
public
Definition module.h:3866
int box_index_max(uint32_t space_id, uint32_t index_id, const char *key, const char *key_end, box_tuple_t **result)
Return a last (maximal) tuple matched the provided key.
@ COIO_READ
READ event.
Definition module.h:1086
@ COIO_WRITE
WRITE event.
Definition module.h:1088
double fiber_time(void)
Report loop begin time as double (cheap).
int box_insert(uint32_t space_id, const char *tuple, const char *tuple_end, box_tuple_t **result)
Execute an INSERT request.
int luaT_cpcall(lua_State *L, lua_CFunction func, void *ud)
Like lua_cpcall(), but with the proper support of Tarantool errors.
int luaL_iscallable(lua_State *L, int idx)
Check whether a Lua object is a function or has metatable/metatype with a __call field.
void fiber_set_name_n(struct fiber *fiber, const char *name, uint32_t len)
Set fiber name.
void fiber_sleep(double s)
Put the current fiber to sleep for at least 's' seconds.
box_decimal_t * box_decimal_mp_decode_data(box_decimal_t *dec, const char **data, uint32_t size)
Decode a decimal from msgpack data without the msgpack extension header.
struct fiber_attr * fiber_attr_new(void)
Create a new fiber attribute container and initialize it with default parameters.
void luaT_pushtuple(struct lua_State *L, box_tuple_t *tuple)
Push a tuple onto the stack.
double fiber_clock(void)
Report loop begin time as double (cheap).
int box_session_push(const char *data, const char *data_end)
Push MessagePack data into a session data channel - socket, console or whatever is behind the session...
box_key_def_t * box_key_def_new_v2(box_key_part_def_t *parts, uint32_t part_count)
Create a key_def from given key parts.
int box_index_quantile(uint32_t space_id, uint32_t index_id, double level, const char *begin_key, const char *begin_key_end, const char *end_key, const char *end_key_end, const char **quantile_key, const char **quantile_key_end)
Return a quantile point in an indexed range.
size_t box_region_used(void)
box region allocator
static bool say_log_level_is_enabled(int level)
Function checks whether passed log level is enabled.
Definition module.h:545
void box_latch_unlock(box_latch_t *latch)
Unlock a latch.
void box_tuple_format_unref(box_tuple_format_t *format)
Decrement tuple format ref count.
uint64_t box_session_id(void)
int64_t luaL_checkint64(struct lua_State *L, int idx)
Checks whether the argument idx is a int64 or a convertible string and returns this number.
box_decimal_t * luaT_isdecimal(struct lua_State *L, int index)
Check whether a value on the Lua stack is a decimal.
int64_t clock_process64(void)
Same as clock_process(), but returns the time as 64 bit signed integer.
int box_decimal_precision(const box_decimal_t *dec)
Decimal precision.
enum iproto_handler_status(* iproto_handler_t)(const char *header, const char *header_end, const char *body, const char *body_end, void *ctx)
IPROTO request handler signature: receives MsgPack encoded header and body, a context provided by box...
Definition module.h:2466
char * luaT_tuple_encode(struct lua_State *L, int idx, size_t *tuple_len_ptr)
Encode a table or a tuple on the Lua stack as an MsgPack array.
bool box_decimal_is_int(const box_decimal_t *dec)
Whether the fractional part of a decimal number is 0.
void box_error_clear(void)
Clear the last error.
void fiber_reschedule(void)
Reschedule fiber to end of event loop cycle.
#define SYSTEM_SPACE_MEMBER(name, id,...)
System space identifier definition.
Definition module.h:2382
const char * box_ro_reason(void)
public
void luaL_pushint64(struct lua_State *L, int64_t val)
Push int64_t onto the stack.
int fiber_cond_wait(struct fiber_cond *cond)
Shortcut for fiber_cond_wait_timeout().
void * box_region_alloc(size_t size)
Allocate size bytes from the box region.
void box_ibuf_read_range(box_ibuf_t *ibuf, char ***rpos, char ***wpos)
Return pointers to read range pointers used [rpos..wpos)
box_tuple_format_t * box_tuple_format_new(struct key_def **keys, uint16_t key_count)
public
int box_truncate(uint32_t space_id)
Truncate space.
uint64_t luaL_touint64(struct lua_State *L, int idx)
Checks whether the argument idx is a uint64 or a convertible string and returns this number.
int box_tuple_ref(box_tuple_t *tuple)
Increase the reference counter of tuple.
void box_tuple_unref(box_tuple_t *tuple)
Decrease the reference counter of tuple.
int box_key_def_validate_full_key(const box_key_def_t *key_def, const char *key, uint32_t *key_size_ptr)
Check a full key against given key definition.
void box_txn_make_sync(void)
Make the transaction synchronous.
void(* sayfunc_t)(int, const char *, int, const char *, const char *,...)
public
Definition module.h:552
int box_upsert(uint32_t space_id, uint32_t index_id, const char *tuple, const char *tuple_end, const char *ops, const char *ops_end, int index_base, box_tuple_t **result)
Execute an UPSERT request.
iterator_type
public
Definition module.h:3013
box_tuple_t * box_tuple_new(box_tuple_format_t *format, const char *data, const char *end)
Allocate and initialize a new tuple from a raw MsgPack Array data.
int box_latch_trylock(box_latch_t *latch)
Try to lock a latch.
box_error_t * box_error_last(void)
Get the information about the last API call error.
int64_t clock_monotonic64(void)
Same as clock_monotonic(), but returns the time as 64 bit signed integer.
box_decimal_t * box_decimal_sqrt(box_decimal_t *res, const box_decimal_t *dec)
Calculate a square root.
struct iterator box_iterator_t
public
Definition module.h:2797
union PACKED box_key_part_def_t
Public representation of a key part definition.
int64_t luaL_toint64(struct lua_State *L, int idx)
Checks whether the argument idx is a int64 or a convertible string and returns this number.
int box_key_def_validate_key(const box_key_def_t *key_def, const char *key, uint32_t *key_size_ptr)
Check a key against given key definition.
int box_decimal_scale(const box_decimal_t *dec)
Decimal scale.
double clock_monotonic(void)
A nonsettable system-wide clock that represents monotonic time.
box_decimal_t * box_decimal_floor(box_decimal_t *dec, int scale)
Apply a floor function to a decimal, i.e.
uint64_t box_slab_info(enum box_slab_info_type type)
Get memtx status information for box.slab.info.
int64_t clock_realtime64(void)
Same as clock_realtime(), but returns the time as 64 bit signed integer.
int box_key_def_validate_tuple(box_key_def_t *key_def, box_tuple_t *tuple)
Check that tuple fields match with given key definition.
box_tuple_t * luaT_istuple(struct lua_State *L, int idx)
Checks whether argument idx is a tuple.
const char * luaT_tolstring(lua_State *L, int idx, size_t *ssize)
Like lua_tolstring, but supports metatables, booleans and nil properly.
int box_sequence_next(uint32_t seq_id, int64_t *result)
Advance a sequence.
int box_txn_set_timeout(double timeout)
Set timeout for transaction, when it expires, transaction will be rolled back.
box_decimal_t * box_decimal_from_string(box_decimal_t *dec, const char *str)
Initialize a decimal with a value from a string.
ssize_t box_index_count(uint32_t space_id, uint32_t index_id, int type, const char *key, const char *key_end)
Count the number of tuple matched the provided key.
void fiber_cond_signal(struct fiber_cond *cond)
Wake one fiber waiting for the cond.
bool fiber_set_cancellable(bool yesno)
Deprecated.
const char * fiber_name(const struct fiber *fiber)
Get fiber name.
box_tuple_t * luaT_checktuple(struct lua_State *L, int idx)
public
box_decimal_t * box_decimal_ln(box_decimal_t *res, const box_decimal_t *dec)
Calculate a natural logarithm (base e).
int luaL_cdef(struct lua_State *L, const char *ctypename)
Declare symbols for FFI.
int box_on_shutdown(void *arg, int(*new_handler)(void *), int(*old_handler)(void *))
Statement Attributes }}}.
void * box_ibuf_reserve(box_ibuf_t *ibuf, size_t size)
Reserve requested amount of bytes in ibuf buffer.
uint32_t box_space_id_by_name(const char *name, uint32_t len)
Find space id by name.
struct fiber * fiber_new_ex(const char *name, const struct fiber_attr *fiber_attr, fiber_func f)
Create a new fiber with defined attributes.
uint32_t box_index_id_by_name(uint32_t space_id, const char *name, uint32_t len)
Find index id by name.
box_key_part_def_t * box_key_def_dump_parts(const box_key_def_t *key_def, uint32_t *part_count_ptr)
Dump key part definitions of given key_def.
int luaT_call(lua_State *L, int nargs, int nreturns)
Like lua_call(), but with the proper support of Tarantool errors.
iproto_handler_status
Return codes for IPROTO request handlers.
Definition module.h:2444
@ IPROTO_HANDLER_ERROR
Error, diagnostic must be set by handler via box_error_set().
Definition module.h:2448
@ IPROTO_HANDLER_OK
Success, no further actions needed.
Definition module.h:2446
@ IPROTO_HANDLER_FALLBACK
Fallback to system handler.
Definition module.h:2450
int fiber_attr_setstacksize(struct fiber_attr *fiber_attr, size_t stack_size)
Set stack size for the fiber attribute.
const char * box_error_message(const box_error_t *error)
Return the error message.
int box_index_min(uint32_t space_id, uint32_t index_id, const char *key, const char *key_end, box_tuple_t **result)
Return a first (minimal) tuple matched the provided key.
void box_key_part_def_create(box_key_part_def_t *part)
Initialize a key part with default values.
int box_txn_commit(void)
Commit the current transaction.
int fiber_join(struct fiber *f)
Wait until the fiber is dead and then move its execution status to the caller.
int box_txn_rollback(void)
Rollback the current transaction.
box_decimal_t * luaT_pushdecimal(struct lua_State *L, const box_decimal_t *dec)
Allocate a new decimal on the Lua stack with copy of given decimal and return a pointer to it.
int box_index_get(uint32_t space_id, uint32_t index_id, const char *key, const char *key_end, box_tuple_t **result)
Get a tuple from index by the key.
uint32_t luaL_ctypeid(struct lua_State *L, const char *ctypename)
Return CTypeID (FFI) of given СDATA type.
box_decimal_t * box_decimal_log10(box_decimal_t *res, const box_decimal_t *dec)
Calculate a common logarithm (base 10).
#define API_EXPORT
The API_EXPORT attribute declares public C API function.
Definition module.h:408
void tnt_tx_push(tnt_tx_func_f func, void *arg)
Schedule the given callback to be executed in TX thread with the provided argument.
void luaL_pushuint64(struct lua_State *L, uint64_t val)
public
void fiber_cond_delete(struct fiber_cond *cond)
Delete the fiber cond object.
void box_region_truncate(size_t size)
Truncate the box region to the given size.
void fiber_wakeup(struct fiber *f)
Interrupt a synchronous wait of a fiber.
int box_sequence_current(uint32_t seq_id, int64_t *result)
Get the last value returned by a sequence.
int64_t box_info_lsn(void)
Get self LSN component of box vclock, -1 if no one or bootstrap haven't succeeded.
int fiber_join_timeout(struct fiber *f, double timeout)
Wait until the fiber is dead or timeout exceeded.
size_t box_tuple_bsize(box_tuple_t *tuple)
Return the number of bytes used to store internal tuple data (MsgPack Array).
ssize_t box_index_len(uint32_t space_id, uint32_t index_id)
Return the number of element in the index.
box_latch_t * box_latch_new(void)
Allocate and initialize the new latch.
void * box_txn_alloc(size_t size)
Allocate memory on txn memory pool.
struct fiber * fiber_find(uint64_t fid)
Get a pointer to a live fiber in the current cord by the given fiber id, which may be used for gettin...
int box_iproto_override(uint32_t req_type, iproto_handler_t handler, iproto_handler_destroy_t destroy, void *ctx)
Sets an IPROTO request handler with the provided context for the given request type.
lua_State * luaT_state(void)
Get global Lua state used by Tarantool.
void box_iterator_free(box_iterator_t *iterator)
Destroy and deallocate iterator.
box_decimal_t * box_decimal_remainder(box_decimal_t *res, const box_decimal_t *lhs, const box_decimal_t *rhs)
Get the remainder of diviging two decimals.
box_decimal_t * box_decimal_exp(box_decimal_t *res, const box_decimal_t *dec)
Calculate exp(dec), i.e.
void * luaL_pushcdata(struct lua_State *L, uint32_t ctypeid)
Push cdata of given ctypeid onto the stack.
int box_delete(uint32_t space_id, uint32_t index_id, const char *key, const char *key_end, box_tuple_t **result)
Execute an DELETE request.
bool box_decimal_is_neg(const box_decimal_t *dec)
Whether a decimal number is negative.
void * box_region_aligned_alloc(size_t size, size_t alignment)
Allocate size bytes from the box region with given alignment.
#define CFORMAT(archetype, stringindex, firsttocheck)
The CFORMAT attribute specifies that a function takes printf, scanf, strftime or strfmon style argume...
Definition module.h:422
box_tuple_t * box_tuple_update(box_tuple_t *tuple, const char *expr, const char *expr_end)
Update a tuple.
void tnt_tx_flush(void)
Send all the pending callbacks of this thread to TX thread.
box_key_def_t * box_key_def_new(uint32_t *fields, uint32_t *types, uint32_t part_count)
Create key definition with given field numbers and field types.
void box_decimal_to_string(const box_decimal_t *dec, char *buf)
Write the decimal as a string into the passed buffer.
box_decimal_t * box_decimal_mp_decode(box_decimal_t *dec, const char **data)
Decode a decimal from msgpack data.
box_decimal_t * box_decimal_from_uint64(box_decimal_t *dec, uint64_t num)
Initialize a decimal with a unsigned integer value.
double clock_process(void)
A clock that measures CPU time consumed by this process (by all threads in the process).
int box_return_tuple(box_function_ctx_t *ctx, box_tuple_t *tuple)
Return a tuple from stored C procedure.
uint32_t box_tuple_field_count(box_tuple_t *tuple)
Return the number of fields in tuple (the size of MsgPack Array).
double clock_realtime(void)
public
void box_key_def_delete(box_key_def_t *key_def)
Delete key definition.
int coio_getaddrinfo(const char *host, const char *port, const struct addrinfo *hints, struct addrinfo **res, double timeout)
Fiber-friendly version of getaddrinfo(3).
void box_latch_delete(box_latch_t *latch)
Destroy and free the latch.
box_decimal_t * box_decimal_round(box_decimal_t *dec, int scale)
Round to nearest decimal at given scale, half goes away from zero.
char * box_tuple_extract_key(box_tuple_t *tuple, uint32_t space_id, uint32_t index_id, uint32_t *key_size)
Extract key from tuple according to key definition of given index.
struct fiber * fiber_new(const char *name, fiber_func f)
Create a new fiber.
struct tuple box_tuple_t
Tuple.
Definition module.h:1627
int box_txn_begin(void)
Begin a transaction in the current fiber.
int box_tuple_compare(box_tuple_t *tuple_a, box_tuple_t *tuple_b, box_key_def_t *key_def)
Compare tuples using the key definition.
int box_txn_set_isolation(uint32_t level)
Set an isolation level for a transaction.
uint64_t box_schema_version(void)
public
int64_t fiber_clock64(void)
Report loop begin time as 64-bit int.
void fiber_set_joinable(struct fiber *fiber, bool yesno)
Set fiber to be joinable (false by default).
int box_tuple_validate(box_tuple_t *tuple, box_tuple_format_t *format)
Check tuple data correspondence to the space format.
int box_sequence_reset(uint32_t seq_id)
Reset a sequence.
box_tuple_t * luaT_tuple_new(struct lua_State *L, int idx, box_tuple_format_t *format)
Create a new tuple with specific format from a Lua table or a tuple.
int luaT_error_at(lua_State *L, int level)
Same as luaT_error but set error trace frame according to given level.
uint64_t fiber_id(const struct fiber *fiber)
Get fiber id.
struct box_latch box_latch_t
public
Definition module.h:3198
int box_replace(uint32_t space_id, const char *tuple, const char *tuple_end, box_tuple_t **result)
Execute an REPLACE request.
const char * box_tuple_field_by_path(box_tuple_t *tuple, const char *path, uint32_t path_len, int index_base)
Return a raw tuple field in the MsgPack format pointed by a JSON path.
int(* fiber_func)(va_list)
Fiber - contains information about fiber.
Definition module.h:669
int64_t box_txn_id(void)
public
int box_return_mp(box_function_ctx_t *ctx, const char *mp, const char *mp_end)
Return MessagePack from a stored C procedure.
box_decimal_t * box_decimal_rescale(box_decimal_t *dec, int scale)
Set scale of dec to scale.
bool fiber_is_cancelled(void)
Check current fiber for cancellation (it must be checked manually).
box_decimal_t * luaT_newdecimal(struct lua_State *L)
public
@ BOX_KEY_PART_DEF_T_SIZE
The constant.
Definition module.h:1938
void fiber_cancel(struct fiber *f)
Cancel the subject fiber.
int box_update(uint32_t space_id, uint32_t index_id, const char *key, const char *key_end, const char *ops, const char *ops_end, int index_base, box_tuple_t **result)
Execute an UPDATE request.
uint64_t fiber_csw(const struct fiber *fiber)
Get number of context switches of the given fiber.
bool luaL_isnull(struct lua_State *L, int idx)
Return true if the value at Lua stack is ffi's NULL (cdata<void *>: NULL).
int fiber_cond_wait_timeout(struct fiber_cond *cond, double timeout)
Suspend the execution of the current fiber (i.e.
box_decimal_t * box_decimal_abs(box_decimal_t *res, const box_decimal_t *dec)
Get the absolute value of a decimal.
int luaT_push_nil_and_error(lua_State *L)
Return nil as the first return value and an error as the second.
int luaT_dostring(struct lua_State *L, const char *str)
Like luaL_dostring(), but in case of error sets fiber diag instead of putting error on stack.
struct tuple_iterator box_tuple_iterator_t
Tuple iterator.
Definition module.h:1740
box_decimal_t * box_decimal_mul(box_decimal_t *res, const box_decimal_t *lhs, const box_decimal_t *rhs)
Multiply two decimal numbers.
struct box_function_ctx box_function_ctx_t
public
Definition module.h:2439
#define SYSTEM_SPACES(_)
public
Definition module.h:2325
int box_index_random(uint32_t space_id, uint32_t index_id, uint32_t rnd, box_tuple_t **result)
Return a random tuple from the index (useful for statistical analysis).
bool box_is_ro(void)
public
void luaL_setcdatagc(struct lua_State *L, int idx)
Sets finalizer function on a cdata object.
int box_error_set(const char *file, unsigned line, uint32_t code, const char *format,...)
Set the last error.
const box_decimal_t * box_decimal_to_uint64(const box_decimal_t *dec, uint64_t *num)
Convert a given decimal to uint64_t.
void(* iproto_handler_destroy_t)(void *ctx)
IPROTO request handler destructor called when the corresponding handler is removed.
Definition module.h:2477
box_decimal_t * box_decimal_sub(box_decimal_t *res, const box_decimal_t *lhs, const box_decimal_t *rhs)
Subtract one decimal number from another.
void fiber_yield(void)
Return control to another fiber and wait until it'll be woken.
void box_tuple_rewind(box_tuple_iterator_t *it)
Rewind iterator to the initial position.
box_decimal_t * box_decimal_pow(box_decimal_t *res, const box_decimal_t *lhs, const box_decimal_t *rhs)
Calculate lhs raised to the power of rhs.
double clock_thread(void)
A clock that measures CPU time consumed by this thread.
void * luaL_checkcdata(struct lua_State *L, int idx, uint32_t *ctypeid)
Checks whether the function argument idx is a cdata.
ssize_t box_index_bsize(uint32_t space_id, uint32_t index_id)
Return the number of bytes used in memory by the index.
int box_decimal_compare(const box_decimal_t *lhs, const box_decimal_t *rhs)
Compare two decimal values.
char * box_key_def_extract_key(box_key_def_t *key_def, box_tuple_t *tuple, int multikey_idx, uint32_t *key_size_ptr)
Extract key from tuple by given key definition and return buffer allocated on the box region with thi...
box_decimal_t * box_decimal_from_int64(box_decimal_t *dec, int64_t num)
Initialize a decimal with a signed integer value.
struct tuple_format box_tuple_format_t
public
Definition module.h:1613
const char * box_error_type(const box_error_t *error)
Return the error type, e.g.
int box_txn_isolation(void)
Get isolation level of current transaction, one of enum txn_isolation_level values (but cannot be TXN...
int box_insert_arrow(uint32_t space_id, struct ArrowArray *array, struct ArrowSchema *schema)
Executes a batch insert request.
int log_level
Logging level.
int coio_wait(int fd, int event, double timeout)
Wait until READ or WRITE event on socket (fd).
struct fiber * fiber_self(void)
Return the current fiber.
void(* tnt_tx_func_f)(void *)
public
Definition module.h:1166
void fiber_cond_broadcast(struct fiber_cond *cond)
Wake up all fibers waiting for the cond.
@ BOX_SYSTEM_ID_MIN
Start of the reserved range of system spaces.
Definition module.h:2386
@ BOX_SYSTEM_ID_MAX
End of the reserved range of system spaces.
Definition module.h:2389
void fiber_start(struct fiber *callee,...)
Start execution of created fiber.
int box_iproto_send(uint64_t sid, const char *header, const char *header_end, const char *body, const char *body_end)
Sends a packet with the given header and body over the IPROTO session's socket.
box_decimal_t * box_decimal_trim(box_decimal_t *dec)
Remove trailing zeros from the fractional part of a number.
void(* log_write_flightrec)(int level, const char *filename, int line, const char *error, const char *format, va_list ap)
This function is called for every log which log level is not less than log_level_flightrec.
box_decimal_t * box_decimal_from_double(box_decimal_t *dec, double d)
Initialize a decimal from double.
box_decimal_t * box_decimal_zero(box_decimal_t *dec)
Initialize a zero decimal number.
int box_sequence_set(uint32_t seq_id, int64_t value)
Set a sequence value.
uint32_t box_tuple_position(box_tuple_iterator_t *it)
Return zero-based next position in iterator.
box_decimal_t * box_decimal_copy(box_decimal_t *dest, const box_decimal_t *src)
Copy decimal value from one storage to another.
box_decimal_t * box_decimal_div(box_decimal_t *res, const box_decimal_t *lhs, const box_decimal_t *rhs)
Divide one decimal number on another.
void fiber_attr_delete(struct fiber_attr *fiber_attr)
Delete the fiber_attr and free all allocated resources.
on_conflict_action
Possible actions on conflict.
Definition module.h:2274
uint64_t luaL_checkuint64(struct lua_State *L, int idx)
Checks whether the argument idx is a uint64 or a convertible string and returns this number.
void fiber_set_ctx(struct fiber *f, void *f_arg)
Set a pointer to context for the fiber.
box_decimal_t * box_decimal_add(box_decimal_t *res, const box_decimal_t *lhs, const box_decimal_t *rhs)
Calculate a sum of two decimal numbers.
void box_ibuf_write_range(box_ibuf_t *ibuf, char ***wpos, char ***end)
Return pointers to write range pointers used [wpos..end)
size_t luaL_getgctotal(struct lua_State *L)
Return size of currently allocated memory.
const char * box_tuple_next(box_tuple_iterator_t *it)
Return the next tuple field from tuple iterator.
void box_tuple_iterator_free(box_tuple_iterator_t *it)
Destroy and free tuple iterator.
void box_tuple_format_ref(box_tuple_format_t *format)
Increment tuple format ref count.
int luaL_iscdata(struct lua_State *L, int idx)
public
box_decimal_t * box_decimal_minus(box_decimal_t *res, const box_decimal_t *dec)
Perform unary minus operation.
struct key_def box_key_def_t
public
Definition module.h:1901
const char * _say_strerror(int errnum)
Internal function that implements MT-Safe strerror().
box_key_def_t * box_key_def_dup(const box_key_def_t *key_def)
Duplicate key_def.
box_tuple_format_t * box_tuple_format_default(void)
Tuple Format.
struct error box_error_t
Error - contains information about error.
Definition module.h:3039
size_t fiber_attr_getstacksize(struct fiber_attr *fiber_attr)
Get stack size from the fiber attribute.
const char * box_tuple_seek(box_tuple_iterator_t *it, uint32_t fieldno)
Seek the tuple iterator.
uint32_t box_decimal_mp_sizeof(const box_decimal_t *dec)
Calculate exact buffer size needed to store msgpack representation of a decimal.
box_slab_info_type
Definition module.h:2779
@ BOX_SLAB_INFO_ARENA_SIZE
Definition module.h:2782
@ BOX_SLAB_INFO_QUOTA_SIZE
Definition module.h:2784
@ BOX_SLAB_INFO_ITEMS_SIZE
Definition module.h:2780
@ BOX_SLAB_INFO_QUOTA_USED
Definition module.h:2785
@ BOX_SLAB_INFO_ARENA_USED
Definition module.h:2783
@ BOX_SLAB_INFO_ITEMS_USED
Definition module.h:2781
box_key_def_t * box_key_def_merge(const box_key_def_t *first, const box_key_def_t *second)
Allocate a new key_def with a set union of key parts from first and second key defs.
box_tuple_t * box_tuple_upsert(box_tuple_t *tuple, const char *expr, const char *expr_end)
Update a tuple.
say_format
Log formats.
Definition module.h:522
void luaL_pushnull(struct lua_State *L)
Push ffi's NULL (cdata<void *>: NULL) onto the stack.
int box_wait_ro(bool ro, double timeout)
public
struct ibuf box_ibuf_t
public
Definition module.h:1211
int64_t fiber_time64(void)
Report loop begin time as 64-bit int.
const char * box_tuple_field(box_tuple_t *tuple, uint32_t fieldno)
Return the raw tuple field in MsgPack format.
int box_iterator_next(box_iterator_t *iterator, box_tuple_t **result)
Retrieve the next item from the iterator.
int luaT_error(lua_State *L)
Re-throws the last Tarantool error as a Lua object.
int box_tuple_compare_with_key(box_tuple_t *tuple_a, const char *key_b, box_key_def_t *key_def)
Compare tuple with key using the key definition.
struct fiber_cond * fiber_cond_new(void)
public
void box_latch_lock(box_latch_t *latch)
Lock a latch.
const box_decimal_t * box_decimal_to_int64(const box_decimal_t *dec, int64_t *num)
Convert a given decimal to int64_t.
void * fiber_get_ctx(struct fiber *f)
Get the context for the fiber which was set via the fiber_set_ctx function.
int coio_close(int fd)
Close the fd and wake any fiber blocked in coio_wait() call on this fd.
txn_isolation_level
public
Definition module.h:1502
@ TXN_ISOLATION_READ_COMMITTED
Allow to read committed, but not confirmed changes.
Definition module.h:1506
@ TXN_ISOLATION_DEFAULT
Take isolation level from global default_isolation_level.
Definition module.h:1504
@ TXN_ISOLATION_LINEARIZABLE
Allow to read only the changes confirmed on any cluster node.
Definition module.h:1512
@ txn_isolation_level_MAX
Upper bound of valid values.
Definition module.h:1514
@ TXN_ISOLATION_READ_CONFIRMED
Allow to read only confirmed changes.
Definition module.h:1508
@ TXN_ISOLATION_BEST_EFFORT
Determine isolation level automatically.
Definition module.h:1510
box_iterator_t * box_index_iterator(uint32_t space_id, uint32_t index_id, int type, const char *key, const char *key_end)
Allocate and initialize iterator for space_id, index_id.
bool box_txn(void)
Return true if there is an active transaction.
field_type
public
Definition module.h:2242
ssize_t box_tuple_to_buf(box_tuple_t *tuple, char *buf, size_t size)
Dump raw MsgPack data to the memory buffer buf of size size.
box_tuple_iterator_t * box_tuple_iterator(box_tuple_t *tuple)
Allocate and initialize a new tuple iterator.
say_level
public
Definition module.h:509
ssize_t coio_call(ssize_t(*func)(va_list),...)
public
int64_t clock_thread64(void)
Same as clock_thread(), but returns the time as 64 bit signed integer.
box_tuple_format_t * box_tuple_format(box_tuple_t *tuple)
Return the associated format.
char * box_decimal_mp_encode(const box_decimal_t *dec, char *data)
Encode a decimal as msgpack.
box_ibuf_t * luaT_toibuf(struct lua_State *L, int idx)
Check if a value on L stack by index idx is an ibuf object.
void luaT_pusherror(struct lua_State *L, struct error *e)
Push error to a Lua stack.
public
Definition module.h:3312
uint64_t internal[8]
Decimal data.
Definition module.h:3322
Public representation of a key part definition.
Definition module.h:1965
char padding[BOX_KEY_PART_DEF_T_SIZE]
Padding to guarantee certain size across different tarantool versions.
Definition module.h:2000
const char * path
JSON path to point a nested field.
Definition module.h:1994
uint32_t flags
Flags, e.g.
Definition module.h:1970
uint32_t fieldno
Index of a tuple field (zero based).
Definition module.h:1968
const char * collation
Collation name for string comparisons.
Definition module.h:1974
const char * field_type
Type of the tuple field.
Definition module.h:1972