54 #if defined (SUPPRESS_STRLEN_WARNING) 55 #define strlen(s1) ((int) strlen(s1)) 218 #if defined(ENABLE_UNUSED_FUNCTION) 279 error = setobj_find_temporary_oids (col, oidset);
408 #define TF_FIXUP_REFERENCE_QUANT 32 475 buf_size = t->
refsize *
sizeof (
void *);
630 for (a = class_->
fixed_count; a < class_->att_count; a++)
670 for (a = class_->
fixed_count; a < class_->att_count; a++)
723 pad = (int) (buf->
ptr - start);
724 if (pad < class_->fixed_size)
772 bool has_index =
false;
773 unsigned int repid_bits;
775 volatile int expected_size;
776 volatile int offset_size;
802 expected_size =
object_size (class_, obj, (
int *) &offset_size);
805 record->
length = -expected_size;
817 switch (_setjmp (buf->
env))
841 repid_bits = class_->
repid;
892 record->
length = -expected_size;
908 *index_flag = has_index;
928 char *obj, *mem, *start;
930 int i, j, offset, offset2, pad;
949 vars[
i] = offset2 - offset;
961 obj = *obj_ptr =
obj_alloc (class_, (bound_bit_flag) ? 0 : 1);
983 pad = (int) (buf->
ptr - start);
984 if (pad < class_->fixed_size)
997 for (i = class_->
fixed_count, j = 0; i < class_->att_count && j < class_->variable_count; i++, j++)
1109 char *obj, *bits, *start;
1111 int i, total, offset, offset2, bytes, att_index, padded_size, fixed_size;
1127 obj = *obj_ptr =
obj_alloc (class_, (bound_bit_flag) ? 0 : 1);
1155 vars[
i] = offset2 - offset;
1207 if (attmap[i] ==
NULL)
1217 fixed_size = (int) (buf->
ptr - start);
1219 or_advance (buf, (padded_size - fixed_size));
1240 for (i = 0; i < oldrep->
fixed_count && rat !=
NULL && attmap !=
NULL; i++, rat = rat->next)
1242 if (attmap[i] !=
NULL)
1272 if (attmap[att_index] ==
NULL)
1328 unsigned int repid_bits;
1329 int repid, convert, chn, bound_bit_flag;
1338 switch (_setjmp (buf->
env))
1375 if (repid == class_->
repid)
1377 obj =
get_current (buf, class_, &obj, bound_bit_flag, offset_size);
1381 obj =
get_old (buf, class_, &obj, repid, bound_bit_flag, offset_size);
1391 *convertp = convert;
1419 return ((
char *) malloc (size));
1481 str_length =
strlen (
string);
1516 char *
string =
NULL;
1564 str_length =
strlen (
string);
1609 for (count = 0, l = list; l !=
NULL; l = l->
next)
1671 for (count = 0, l = list; l !=
NULL; l = l->
next)
1693 for (l = list; l !=
NULL; l = l->
next)
1728 for (i = 0; i <
count; i++)
1776 for (l = list; l !=
NULL; l = l->
next, count++)
1778 size += (*function) (l);
1823 for (l = list; l !=
NULL; l = l->
next, count++);
1838 offset_ptr = buf->
ptr;
1851 for (l = list; l !=
NULL; l = l->
next)
1888 for (i = 0; i <
count; i++)
1890 obj = (*reader) (buf);
1925 for (i = 0, p = list; i < count && p !=
NULL; i++, p = p->
next)
1945 if (properties !=
NULL)
1970 if (properties ==
NULL)
2011 if (properties ==
NULL)
2027 return (properties);
2112 if (start + offset != buf->
ptr)
2200 if (schema_raw ==
NULL)
2293 if (start + offset != buf->
ptr)
2408 if (start + offset != buf->
ptr)
2453 const char *fname, *fix;
2480 if (fname !=
NULL && fname[0] ==
'_')
2558 if (start + offset != buf->
ptr)
2679 if (start + offset != buf->
ptr)
2788 if (start + offset != buf->
ptr)
2840 if (statement ==
NULL)
2947 if (start + offset != buf->
ptr)
3079 if (triggers !=
NULL)
3102 DB_VALUE def_expr_op, def_expr_type, def_expr_format;
3103 const char *def_expr_format_str;
3133 #if !defined (NDEBUG) 3178 int offset, name_space;
3202 if (start + offset != buf->
ptr)
3334 if (start + offset != buf->
ptr)
3463 if (start + offset != buf->
ptr)
3660 #if !defined(NDEBUG) 3673 or_put_oid (buf, &(class_->header.ch_rep_dir));
3675 or_put_int (buf, class_->header.ch_heap.vfid.fileid);
3676 or_put_int (buf, class_->header.ch_heap.vfid.volid);
3677 or_put_int (buf, class_->header.ch_heap.hpgid);
3687 or_put_int (buf, class_->class_method_count);
3688 or_put_int (buf, class_->class_attribute_count);
3694 or_put_int (buf, (
int) class_->collation_id);
3848 #if defined(ENABLE_UNUSED_FUNCTION) 3856 tf_dump_class_size (
MOBJ classobj)
3872 fprintf (stdout,
"Fixed size %d\n", size);
3875 fprintf (stdout,
"Header name %d\n", s);
3879 fprintf (stdout,
"Loader commands %d\n", s);
3883 fprintf (stdout,
"Representations %d\n", s);
3887 fprintf (stdout,
"Users %d\n", s);
3891 fprintf (stdout,
"Inheritance %d\n", s);
3895 fprintf (stdout,
"Attributes %d\n", s);
3899 fprintf (stdout,
"Shared attributes %d\n", s);
3903 fprintf (stdout,
"Class attributes %d\n", s);
3907 fprintf (stdout,
"Methods %d\n", s);
3911 fprintf (stdout,
"Class methods %d\n", s);
3915 fprintf (stdout,
"Method files %d\n", s);
3919 fprintf (stdout,
"Resolutions %d\n", s);
3923 fprintf (stdout,
"Query_Spec statements %d\n", s);
3928 fprintf (stdout,
"Triggers %d\n", s);
3932 fprintf (stdout,
"Properties %d\n", s);
3936 fprintf (stdout,
"Comment %d\n", s);
3939 fprintf (stdout,
"TOTAL: %d\n", size);
3960 for (c = components; c !=
NULL; c = c->
next)
3985 MOP serial_class_mop =
NULL, serial_mop;
4012 #if !defined(NDEBUG) 4020 class_->variable_count =
or_get_int (buf, &rc);
4024 class_->object_size = 0;
4025 class_->shared_count =
or_get_int (buf, &rc);
4026 class_->method_count =
or_get_int (buf, &rc);
4027 class_->class_method_count =
or_get_int (buf, &rc);
4028 class_->class_attribute_count =
or_get_int (buf, &rc);
4035 class_->collation_id =
or_get_int (buf, &rc);
4037 class_->tde_algorithm =
or_get_int (buf, &rc);
4047 class_->representations =
4057 if (class_->att_count && class_->attributes ==
NULL)
4064 if (class_->shared_count && class_->shared ==
NULL)
4070 class_->class_attributes =
4072 if (class_->class_attribute_count && class_->class_attributes ==
NULL)
4079 if (class_->method_count && class_->methods ==
NULL)
4086 if (class_->class_method_count && class_->class_methods ==
NULL)
4119 class_->method_files =
4123 class_->resolutions =
4127 class_->query_spec =
4132 if (triggers !=
NULL)
4156 if (serial_class_mop ==
NULL)
4159 if (serial_class_mop ==
NULL)
4172 if (serial_mop ==
NULL)
4239 or_put_int (buf, (
int) root->header.ch_heap.vfid.fileid);
4240 or_put_int (buf, (
int) root->header.ch_heap.vfid.volid);
4241 or_put_int (buf, (
int) root->header.ch_heap.hpgid);
4308 sm_Root_class.header.ch_heap.vfid.volid = (
VOLID)
or_get_int (buf, &rc);
4347 unsigned int repid, chn;
4349 MOBJ volatile class_;
4366 switch (_setjmp (buf->
env))
4392 ((
SM_CLASS *) class_)->header.ch_obj_header.chn = chn;
4432 volatile int expected_size;
4437 volatile int prop_free = 0;
4479 rc = _setjmp (buf->
env);
4488 repid = class_->
repid;
4512 if (record->
length != expected_size)
4528 record->
length = -expected_size;
4617 enumeration->
count = 0;
4638 if (attr_list ==
NULL)
4668 if (default_expr_sequence ==
NULL)
4702 default_expr_sequence =
NULL;
4734 db_make_int (&default_expr_value, update_default);
4749 #if defined(ENABLE_UNUSED_FUNCTION) 4762 tf_set_size (
DB_SET *
set)
4768 if (
set ==
NULL || set->set ==
NULL)
4779 size = (*(
tp_Set.lengthval)) (&value, 1);
4801 tf_pack_set (
DB_SET *
set,
char *buffer,
int buffer_size,
int *actual_bytes)
4807 if (
set ==
NULL || set->set ==
NULL)
4809 if (actual_bytes !=
NULL)
4818 or_init (buf, buffer, buffer_size);
4821 switch (_setjmp (buf->
env))
4832 (*(
tp_Set.writeval)) (buf, &value);
4834 if (actual_bytes !=
NULL)
4836 *actual_bytes = (int) (buf->
ptr - buf->
buffer);
4847 if (actual_bytes !=
NULL)
4851 *actual_bytes = (*(
tp_Set.lengthval)) (&value, 1);
4910 if (start + offset != buf->
ptr)
4971 if (partition_info ==
NULL)
5009 return (partition_info);
struct tr_schema_cache * triggers
SM_REPRESENTATION * classobj_find_representation(SM_CLASS *class_, int id)
#define OR_SET_VAR_OFFSET_SIZE(val, offset_size)
int data_readval(struct or_buf *buf, DB_VALUE *value, const tp_domain *domain, int size, bool copy, char *copy_buf, int copy_buf_len) const
#define OR_PUT_OFFSET(ptr, val)
int ml_append(DB_OBJLIST **list, MOP mop, int *added_ptr)
#define OR_PUT_OID(ptr, oid)
#define WS_IS_DELETED(mop)
int set_get_element_nocopy(DB_COLLECTION *set, int index, DB_VALUE *value)
int or_get_enumeration(OR_BUF *buf, DB_ENUMERATION *e)
int db_value_put_null(DB_VALUE *value)
DB_COLLECTION * db_get_set(const DB_VALUE *value)
#define LANG_SYS_COLLATION
char * obj_alloc(SM_CLASS *class_, int bound_bit_status)
SM_CLASS * classobj_make_class(const char *name)
void classobj_initialize_attributes(SM_ATTRIBUTE *attributes)
int or_packed_value_size(const DB_VALUE *value, int collapse_null, int include_domain, int include_domain_classoids)
void sm_bump_global_schema_version(void)
int or_put_oid(OR_BUF *buf, const OID *oid)
void or_abort(OR_BUF *buf)
MOP ws_mop(const OID *oid, MOP class_mop)
int data_writeval(struct or_buf *buf, const DB_VALUE *value) const
int or_get_json_schema(OR_BUF *buf, REFPTR(char, schema))
#define TP_IS_SET_TYPE(typenum)
#define ER_TF_BUFFER_OVERFLOW
int or_put_domain(OR_BUF *buf, struct tp_domain *domain, int include_classoids, int is_null)
void set_free(DB_COLLECTION *set)
int db_get_int(const DB_VALUE *value)
#define OR_MVCC_REPID_MASK
void initval(DB_VALUE *value, int precision, int scale) const
struct tp_domain * setdomain
void classobj_initialize_methods(SM_METHOD *methods)
int classobj_get_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
SM_ATTRIBUTE * attributes
int or_get_oid(OR_BUF *buf, OID *oid)
#define OR_MVCC_FLAG_VALID_INSID
#define assert_release(e)
int db_make_object(DB_VALUE *value, DB_C_OBJECT *obj)
DB_COLLECTION * set_create_sequence(int size)
#define OBJ_HEADER_BOUND_BITS_OFFSET
SM_DEFAULT_VALUE default_value
#define OR_MVCC_FLAG_VALID_DELID
struct sm_component * next
int or_packed_enumeration_size(const DB_ENUMERATION *e)
#define OR_MVCC_FLAG_SHIFT_BITS
TP_DOMAIN tp_Object_domain
void data_readmem(struct or_buf *buf, void *memptr, const tp_domain *domain, int size) const
int db_make_sequence(DB_VALUE *value, DB_C_SET *set)
bool classobj_class_has_indexes(SM_CLASS *class_)
SM_METHOD_ARGUMENT * value
int or_put_value(OR_BUF *buf, DB_VALUE *value, int collapse_null, int include_domain, int include_domain_classoids)
#define OR_BOUND_BIT_BYTES(count)
#define PTR_ALIGN(addr, boundary)
int set_size(DB_COLLECTION *set)
SM_METHOD_ARGUMENT * classobj_make_method_arg(int index)
void db_ws_free(void *ptr)
void ws_free_string(const char *str)
#define OR_MVCC_MAX_HEADER_SIZE
LC_OIDMAP * locator_add_oidset_object(LC_OIDSET *oidset, MOP obj_mop)
LC_CLASS_OIDSET * classes
int or_skip_set_header(OR_BUF *buf)
DB_DEFAULT_EXPR_TYPE default_expr_type
#define OR_VAR_TABLE_SIZE(vars)
int db_make_string(DB_VALUE *value, DB_CONST_C_CHAR str)
INTL_CODESET lang_charset(void)
DB_DEFAULT_EXPR default_expr
void data_writemem(struct or_buf *buf, const void *memptr, const tp_domain *domain) const
int or_put_set_header(OR_BUF *buf, DB_TYPE set_type, int size, int domain, int bound_bits, int offset_table, int element_tags, int common_sub_header)
int setmem(void *memptr, const tp_domain *domain, const DB_VALUE *value) const
PR_TYPE * pr_type_from_id(DB_TYPE id)
void classobj_initialize_default_expr(DB_DEFAULT_EXPR *default_expr)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
const char * sm_ch_name(const MOBJ clobj)
#define OR_MVCC_FLAG_VALID_PREV_VERSION
#define NULL_DEFAULT_EXPRESSION_OPERATOR
#define ER_TF_SIZE_MISMATCH
SM_METHOD_SIGNATURE * classobj_make_method_signature(const char *name)
#define OR_MVCC_FLAG_MASK
int db_make_set(DB_VALUE *value, DB_C_SET *set)
SM_PARTITION * classobj_make_partition_info(void)
int setobj_sort(COL *col)
int or_mvcc_get_repid_and_flags(OR_BUF *buf, int *error)
struct db_object * class_mop
#define OR_SET_HEADER_SIZE
void obj_free_memory(SM_CLASS *class_, MOBJ obj)
#define ER_OUT_OF_VIRTUAL_MEMORY
DB_TYPE db_value_type(const DB_VALUE *value)
const char * db_json_get_schema_raw_from_validator(JSON_VALIDATOR *val)
void classobj_free_class(SM_CLASS *class_)
#define DOM_GET_ENUMERATION(dom)
SM_QUERY_SPEC * classobj_make_query_spec(const char *specification)
HFID * sm_ch_heap(MOBJ clobj)
DB_SEQ * db_seq_copy(DB_SEQ *source)
int or_put_int(OR_BUF *buf, int num)
bool oid_is_root(const OID *oid)
int or_put_bigint(OR_BUF *buf, DB_BIGINT num)
int or_overflow(OR_BUF *buf)
int or_put_offset(OR_BUF *buf, int num)
DB_OBJECT * db_get_object(const DB_VALUE *value)
#define OR_MVCC_PREV_VERSION_LSA_SIZE
const char * function_name
#define TP_DOMAIN_TYPE(dom)
#define OR_MVCC_INSERT_HEADER_SIZE
SM_REPR_ATTRIBUTE * classobj_make_repattribute(int attid, DB_TYPE type_id, TP_DOMAIN *domain)
int locator_assign_oidset(LC_OIDSET *oidset, LC_OIDMAP_CALLBACK callback)
#define OR_SUB_HEADER_SIZE
int or_put_offset_internal(OR_BUF *buf, int num, int offset_size)
SM_METHOD_SIGNATURE * signatures
void initmem(void *memptr, const tp_domain *domain) const
struct sm_repr_attribute * next
#define DB_ATT_ALIGN(offset)
#define OBJ_SET_BOUND_BIT(obj, element)
#define ER_OBJ_CANT_ASSIGN_OID
OID * sm_ch_rep_dir(MOBJ clobj)
TP_DOMAIN * tp_domain_cache(TP_DOMAIN *transient)
struct lc_class_oidset * next
#define db_private_free_and_init(thrd, ptr)
#define ER_TF_OUT_OF_SYNC
#define ER_OBJ_INVALID_ATTRIBUTE
LC_OIDSET * locator_make_oid_set(void)
void or_init(OR_BUF *buf, char *data, int length)
#define BIG_VAR_OFFSET_SIZE
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
int pr_clear_value(DB_VALUE *value)
void locator_free_oid_set(THREAD_ENTRY *thread_p, LC_OIDSET *oidset)
SM_CONSTRAINT * constraints
#define WS_LIST_APPEND(lst, element)
int or_put_enumeration(OR_BUF *buf, const DB_ENUMERATION *e)
int or_get_offset_internal(OR_BUF *buf, int *error, int offset_size)
DB_ENUMERATION enumeration
#define TP_IS_CHAR_TYPE(typeid)
TP_DOMAIN_COLL_ACTION collation_flag
int set_put_element(DB_COLLECTION *set, int index, DB_VALUE *value)
static void error(const char *msg)
DB_DEFAULT_EXPR_TYPE on_update_default_expr
SM_REPR_ATTRIBUTE * attributes
#define HFID_IS_NULL(hfid)
bool db_value_is_null(const DB_VALUE *value)
OID * locator_assign_permanent_oid(MOP mop)
const char * sql_definition
const char * default_expr_format
int tr_get_cache_objects(TR_SCHEMA_CACHE *cache, DB_OBJLIST **list)
SM_METHOD_FILE * classobj_make_method_file(const char *name)
void classobj_free_partition_info(SM_PARTITION *partition_info)
#define free_and_init(ptr)
DB_ENUM_ELEMENT * elements
#define OR_VAR_TABLE_SIZE_INTERNAL(vars, offset_size)
SM_RESOLUTION * classobj_make_resolution(MOP class_mop, const char *name, const char *alias, SM_NAME_SPACE name_space)
void classobj_free_prop(DB_SEQ *properties)
#define OR_SUB_DOMAIN_SIZE
JSON_VALIDATOR * json_validator
int db_json_load_validator(const char *json_schema_raw, JSON_VALIDATOR *&validator)
#define OR_NON_MVCC_HEADER_SIZE
int pr_clear_compressed_string(DB_VALUE *value)
OR_VARINFO * or_get_var_table_internal(OR_BUF *buf, int nvars, char *(*allocator)(int), int offset_size)
void * db_ws_alloc(size_t size)
SM_METHOD_ARGUMENT * args
int db_make_varnchar(DB_VALUE *value, const int max_nchar_length, DB_CONST_C_NCHAR str, const int nchar_str_byte_size, const int codeset, const int collation_id)
TR_SCHEMA_CACHE * tr_make_schema_cache(TR_CACHE_TYPE type, DB_OBJLIST *objects)
int or_put_data(OR_BUF *buf, const char *data, int length)
#define TP_FLOATING_PRECISION_VALUE
const char * specification
#define DB_VALUE_TYPE(value)
int db_make_null(DB_VALUE *value)
#define OR_OFFSET_SIZE_FLAG
#define DB_IS_NULL(value)
#define OR_GET_OFFSET_SIZE(ptr)
#define STATIC_CAST(dest_type, expr)
static WHEN_DESC on_error
int or_get_data(OR_BUF *buf, char *data, int length)
DB_SEQ * classobj_make_prop()
#define DB_MAX_VARNCHAR_PRECISION
struct sm_attribute * order_link
int db_value_clear(DB_VALUE *value)
int setval(DB_VALUE *dest, const DB_VALUE *src, bool copy) const
int db_make_int(DB_VALUE *value, const int num)
struct db_object * class_mop
int or_put_sub_domain(OR_BUF *buf)
MOP sm_find_class(const char *name)
#define OR_BOUND_BIT_FLAG
int or_get_int(OR_BUF *buf, int *error)
char * ws_copy_string(const char *str)
int or_get_value(OR_BUF *buf, DB_VALUE *value, struct tp_domain *domain, int expected, bool copy)
int get_disk_size_of_mem(const void *mem, const tp_domain *domain=NULL) const
int or_pad(OR_BUF *buf, int length)
MOP do_get_serial_obj_id(DB_IDENTIFIER *serial_obj_id, DB_OBJECT *serial_class_mop, const char *serial_name)
DB_LIST * classobj_alloc_threaded_array(int size, int count)
TP_DOMAIN * tp_domain_new(DB_TYPE type)
void classobj_fixup_loaded_class(SM_CLASS *class_)
#define ER_TF_INVALID_REPRESENTATION
SM_REPRESENTATION * classobj_make_representation()
void tp_domain_free(TP_DOMAIN *dom)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
int or_advance(OR_BUF *buf, int offset)
int pr_complete_enum_value(DB_VALUE *value, struct tp_domain *domain)
#define OR_GET_BOUND_BIT(bitptr, element)
int get_disk_size_of_value(const DB_VALUE *value) const
int classobj_drop_prop(DB_SEQ *properties, const char *name)
int classobj_put_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
#define TP_DOMAIN_COLLATION_FLAG(dom)