33 #if !defined (SERVER_MODE) 35 #endif // not SERVER_MODE 43 #if !defined(SERVER_MODE) 58 #if !defined(SERVER_MODE) 76 #define COL_ARRAY_SIZE(size) ((size + (COL_BLOCK_SIZE - 1)) / COL_BLOCK_SIZE) 78 #define SET_AREA_COUNT (1024) 100 #define CHECKNULL_ERR(thing) \ 101 if ((thing) == NULL) \ 103 er_set(ER_ERROR_SEVERITY, ARG_FILE_LINE, ER_OBJ_INVALID_ARGUMENTS, 0); \ 104 return(ER_OBJ_INVALID_ARGUMENTS); \ 113 static void col_merge_run (
COL * col,
DB_VALUE ** runs,
long run1start,
long run1stop,
long run2start,
long run2stop);
124 #if defined(ENABLE_UNUSED_FUNCTION) 125 static int col_is_all_null (
COL * col);
129 #if !defined(SERVER_MODE) 154 if (Set_Ref_Area ==
NULL)
157 if (Set_Ref_Area ==
NULL)
163 if (Set_Obj_Area ==
NULL)
166 if (Set_Obj_Area ==
NULL)
191 if (Set_Ref_Area !=
NULL)
197 if (Set_Obj_Area !=
NULL)
207 Set_Ref_Area = Set_Obj_Area =
NULL;
233 return &(block->
val[0]);
264 return &(block->
val[0]);
338 long secondblockfull;
340 long freeblocksindex;
348 runs[freeblocksindex] =
NULL;
351 while (run1start <= run1stop || run2start <= run2stop)
355 if (run1start > run1stop)
357 smallest = run2start++;
359 else if (run2start > run2stop)
361 smallest = run1start++;
365 smallest = run1start++;
369 smallest = run2start++;
371 thisblock[tempindex++] = *
INDEX (col, smallest);
377 runs[freeblocksindex++] = col->
array[
BLOCK (smallest)];
383 if (thisblock == block1)
406 runs[freeblocksindex++] = col->
array[
BLOCK (run2stop)];
414 secondblock = (thisblock == block1) ? block2 : block1;
420 memcpy (runs[runsindex++], thisblock, tempindex *
sizeof (
DB_VALUE));
425 if (runsindex != freeblocksindex)
427 printf (
"set_object.c: col_merge_run internal error\n");
446 long in1start, in1stop, in2start, in2stop, inblock, topblock;
452 while (in1stop < top)
454 in2start = in1stop + 1;
464 topblock =
BLOCK (in2stop);
465 in1start = in2stop + 1;
473 while (inblock <= topblock)
475 col->
array[inblock] = runs[inblock];
492 long nblocks, runsize;
494 nblocks =
BLOCK (top) + 1;
504 while (runsize < nblocks)
507 runsize = 2 * runsize;
549 temp = *
INDEX (col, top);
551 *
INDEX (col, bottom) = temp;
572 long i, top, topblock;
575 if (!col || !col->
size)
589 topblock =
BLOCK (top);
592 for (i = 0; i < topblock; i++)
603 printf (
"col_sort: ");
627 if (blockindex <= col->arraytop)
666 for (; bottomvalue <= topvalue; bottomvalue++)
717 topfullblock = blockindex;
723 topfullblock = blockindex - 1;
731 col->
array[blockindex] = block;
748 topfullblock = blockindex - 1;
756 col->
array[blockindex] = block;
784 if (!(err < 0) && i >= col->
size)
810 if (Set_Obj_Area ==
NULL)
888 long lowblock, highblock, midblock, offset;
907 lowblock =
BLOCK (lower);
908 highblock =
BLOCK (upper);
909 while (lowblock < highblock)
911 midblock = (lowblock + highblock) / 2;
915 highblock = midblock - 1;
920 lowblock = midblock + 1;
925 lowblock = highblock = midblock;
965 long lowblock, highblock, midblock, offset, midoffset, compare;
967 if (!col || !found || !val)
973 lowblock =
BLOCK (lower);
974 highblock =
BLOCK (upper);
975 while (lowblock < highblock)
977 midblock = (lowblock + highblock) / 2;
981 highblock = midblock - 1;
986 lowblock = midblock + 1;
992 lowblock = highblock = midblock;
999 if (lowblock ==
BLOCK (upper))
1001 midoffset =
OFFSET (upper);
1008 while (offset <= midoffset && compare > 0)
1037 if (!col || col->
size == 0)
1049 for (i = 0; i < col->
size; i++)
1060 #if defined(ENABLE_UNUSED_FUNCTION) 1074 col_is_all_null (
COL * col)
1083 if (!col || col->
size == 0)
1098 for (i = 0; i < col->
size; i++)
1136 long insertindex, rightindex, temp;
1151 insertindex = col->
size;
1164 #if !defined(SERVER_MODE) 1189 if (insertindex < 0)
1205 else if (compare > 0)
1208 if (rightindex == insertindex)
1216 insertindex =
col_bsearch (col, insertindex, rightindex, found, val, do_coerce);
1219 else if (compare < 0)
1222 insertindex =
col_bsearch (col, 0, insertindex, found, val, do_coerce);
1234 while (insertindex < rightindex - 1)
1236 temp = (insertindex + rightindex) / 2;
1255 while (insertindex < col->size)
1288 long offset, blockindex;
1291 if (!col || colindex < 0 || !val)
1306 blockindex =
BLOCK (colindex);
1307 offset =
OFFSET (colindex);
1312 #if defined (SERVER_MODE) 1326 col->
array[blockindex][offset] = *
val;
1346 #if defined(CUBRID_DEBUG) 1351 #define WS_MAX_QUICK_SIZE 1024 1385 long offset, blockindex, topblock, topblockcount, topoffset, fillblock;
1393 if (!col || colindex < 0 || !val)
1399 if (colindex > col->
size)
1412 blockindex =
BLOCK (colindex);
1413 offset =
OFFSET (colindex);
1420 if (fillblock < topblock)
1422 topblock = fillblock;
1426 if (topblock > blockindex)
1429 while (topblock > blockindex)
1431 memmove (&col->
array[topblock][1], &col->
array[topblock][0], topblockcount * sizeof (
DB_VALUE));
1443 while (topoffset > offset)
1445 col->
array[blockindex][topoffset] = col->
array[blockindex][topoffset - 1];
1452 #if defined (SERVER_MODE) 1466 col->
array[blockindex][offset] = *
val;
1486 long offset, blockindex, topblock, topblockcount, topoffset, fillblock;
1494 if (!col || colindex < 0)
1500 blockindex =
BLOCK (colindex);
1501 offset =
OFFSET (colindex);
1507 if (blockindex < topblock)
1515 while (offset < topoffset)
1517 col->
array[blockindex][offset] = col->
array[blockindex][offset + 1];
1521 if (fillblock > blockindex)
1524 while (blockindex < fillblock)
1528 if (blockindex < topblock)
1536 memmove (&col->
array[blockindex][0], &col->
array[blockindex][1], topblockcount * sizeof (
DB_VALUE));
1606 i =
col_find (col, &found, val, 1);
1637 i =
col_find (col, &found, val, 0);
1693 long i, found, do_coerce;
1702 i =
col_find (col, &found, val, do_coerce);
1744 for (i = col->
size - 1; i >= 0; i--)
1760 for (i = col->
size - 1; i >= 0; i--)
1782 #if !defined(SERVER_MODE) 1803 for (i = 0; i < col->
size && !
error; i++)
1805 val =
INDEX (col, i);
1833 if (!error && tcount)
1902 printf (
"Malformed VOBJ(s) sent to setvobj_compare in set_object.c\n");
1940 if (Set_Ref_Area ==
NULL)
2052 #if !defined(SERVER_MODE) 2095 if (set->references ==
NULL)
2097 set->references = ref;
2190 #if !defined(SERVER_MODE) 2199 set = *(
COL **) mem;
2311 #if !defined(SERVER_MODE) 2312 COL *current, *newset;
2321 if (ref ==
NULL || current ==
NULL)
2475 COL *srcobj, *newobj;
2477 #if !defined(SERVER_MODE) 2489 #if !defined(SERVER_MODE) 2490 pin =
ws_pin (set->owner, 1);
2506 #if !defined(SERVER_MODE) 2507 (void)
ws_pin (set->owner, pin);
2520 #if defined (ENABLE_UNUSED_FUNCTION) 2526 #if !defined(SERVER_MODE) 2541 #if !defined(SERVER_MODE) 2542 pin =
ws_pin (set->owner, 1);
2545 #if !defined(SERVER_MODE) 2546 (void)
ws_pin (set->owner, pin);
2579 #if !defined(SERVER_MODE) 2593 #if !defined(SERVER_MODE) 2594 pin =
ws_pin (set->owner, 1);
2597 #if !defined(SERVER_MODE) 2598 (void)
ws_pin (set->owner, pin);
2645 #if !defined(SERVER_MODE) 2654 #if !defined(SERVER_MODE) 2655 pin =
ws_pin (set->owner, 1);
2657 if (set->owner ==
NULL)
2662 #if !defined(SERVER_MODE) 2666 #if !defined (NDEBUG) 2671 || (class_mop !=
NULL 2683 #if !defined(SERVER_MODE) 2684 (void)
ws_pin (set->owner, pin);
2693 #if defined (ENABLE_UNUSED_FUNCTION) 2723 #if !defined(SERVER_MODE) 2734 #if !defined(SERVER_MODE) 2735 pin =
ws_pin (set->owner, 1);
2737 if (set->owner ==
NULL)
2742 #if !defined(SERVER_MODE) 2746 #if !defined (NDEBUG) 2751 || (class_mop !=
NULL 2763 #if !defined(SERVER_MODE) 2764 (void)
ws_pin (set->owner, pin);
2785 #if !defined(SERVER_MODE) 2797 #if !defined(SERVER_MODE) 2798 pin =
ws_pin (set->owner, 1);
2800 if (set->owner ==
NULL)
2805 #if !defined(SERVER_MODE) 2808 #if !defined (NDEBUG) 2813 || (class_mop !=
NULL 2825 #if !defined(SERVER_MODE) 2826 (void)
ws_pin (set->owner, pin);
2846 #if !defined(SERVER_MODE) 2857 #if !defined(SERVER_MODE) 2858 pin =
ws_pin (set->owner, 1);
2860 if (set->owner ==
NULL)
2865 #if !defined(SERVER_MODE) 2868 #if !defined (NDEBUG) 2873 || (class_mop !=
NULL 2885 #if !defined(SERVER_MODE) 2886 (void)
ws_pin (set->owner, pin);
2906 #if !defined(SERVER_MODE) 2917 #if !defined(SERVER_MODE) 2918 pin =
ws_pin (set->owner, 1);
2920 if (set->owner ==
NULL)
2925 #if !defined(SERVER_MODE) 2928 #if !defined (NDEBUG) 2933 || (class_mop !=
NULL 2945 #if !defined(SERVER_MODE) 2946 (void)
ws_pin (set->owner, pin);
2967 #if !defined(SERVER_MODE) 2979 #if !defined(SERVER_MODE) 2980 pin =
ws_pin (set->owner, 1);
2983 #if !defined(SERVER_MODE) 2984 (void)
ws_pin (set->owner, pin);
3004 #if !defined(SERVER_MODE) 3018 #if !defined(SERVER_MODE) 3019 pin =
ws_pin (set->owner, 1);
3022 #if !defined(SERVER_MODE) 3023 (void)
ws_pin (set->owner, pin);
3041 #if !defined(SERVER_MODE) 3056 #if !defined(SERVER_MODE) 3057 pin =
ws_pin (set->owner, 1);
3060 #if !defined(SERVER_MODE) 3061 (void)
ws_pin (set->owner, pin);
3077 bool isempty =
true;
3079 #if !defined(SERVER_MODE) 3093 #if !defined(SERVER_MODE) 3094 pin =
ws_pin (set->owner, 1);
3097 #if !defined(SERVER_MODE) 3098 (void)
ws_pin (set->owner, pin);
3104 #if defined(ENABLE_UNUSED_FUNCTION) 3123 bool isallnull =
true;
3125 #if !defined(SERVER_MODE) 3140 #if !defined(SERVER_MODE) 3141 pin =
ws_pin (set->owner, 1);
3143 isallnull = col_is_all_null (obj);
3144 #if !defined(SERVER_MODE) 3145 (void)
ws_pin (set->owner, pin);
3163 bool hasnull =
true;
3165 #if !defined(SERVER_MODE) 3180 #if !defined(SERVER_MODE) 3181 pin =
ws_pin (set->owner, 1);
3184 #if !defined(SERVER_MODE) 3185 (void)
ws_pin (set->owner, pin);
3202 bool ismember =
false;
3204 #if !defined(SERVER_MODE) 3219 #if !defined(SERVER_MODE) 3220 pin =
ws_pin (set->owner, 1);
3223 #if !defined(SERVER_MODE) 3224 (void)
ws_pin (set->owner, pin);
3229 #if !defined (SERVER_MODE) 3258 pin =
ws_pin (set->owner, 1);
3260 (void)
ws_pin (set->owner, pin);
3277 #if !defined(SERVER_MODE) 3289 #if !defined(SERVER_MODE) 3290 pin =
ws_pin (set->owner, 1);
3292 if (set->owner ==
NULL)
3296 #if !defined(SERVER_MODE) 3303 #if !defined(SERVER_MODE) 3304 (void)
ws_pin (set->owner, pin);
3324 #if !defined(SERVER_MODE) 3339 #if !defined(SERVER_MODE) 3340 pin =
ws_pin (set->owner, 1);
3343 #if !defined(SERVER_MODE) 3344 (void)
ws_pin (set->owner, pin);
3364 #if !defined(SERVER_MODE) 3378 #if !defined(SERVER_MODE) 3385 #if !defined(SERVER_MODE) 3391 #if !defined(SERVER_MODE) 3396 #if !defined(SERVER_MODE) 3416 #if !defined(SERVER_MODE) 3430 #if !defined(SERVER_MODE) 3437 #if !defined(SERVER_MODE) 3443 #if !defined(SERVER_MODE) 3448 #if !defined(SERVER_MODE) 3469 #if !defined(SERVER_MODE) 3483 #if !defined(SERVER_MODE) 3490 #if !defined(SERVER_MODE) 3495 #if !defined(SERVER_MODE) 3500 #if !defined(SERVER_MODE) 3523 #if !defined(SERVER_MODE) 3536 #if !defined(SERVER_MODE) 3543 #if !defined(SERVER_MODE) 3547 #if !defined(SERVER_MODE) 3552 #if !defined(SERVER_MODE) 3572 #if !defined(SERVER_MODE) 3585 #if !defined(SERVER_MODE) 3586 pin =
ws_pin (set->owner, 1);
3589 #if !defined(SERVER_MODE) 3590 (void)
ws_pin (set->owner, pin);
3610 #if !defined(SERVER_MODE) 3625 #if !defined(SERVER_MODE) 3626 pin =
ws_pin (set->owner, 1);
3629 #if !defined(SERVER_MODE) 3630 (void)
ws_pin (set->owner, pin);
3647 COL *srcobj, *newobj;
3650 #if !defined(SERVER_MODE) 3664 #if !defined(SERVER_MODE) 3665 pin =
ws_pin (set->owner, 1);
3681 #if !defined(SERVER_MODE) 3682 (void)
ws_pin (set->owner, pin);
3701 #if !defined(SERVER_MODE) 3714 #if !defined(SERVER_MODE) 3715 pin =
ws_pin (set->owner, 1);
3718 #if !defined(SERVER_MODE) 3719 (void)
ws_pin (set->owner, pin);
3748 #if !defined(SERVER_MODE) 3762 #if !defined(SERVER_MODE) 3763 pin =
ws_pin (set->owner, 1);
3767 #if !defined(SERVER_MODE) 3768 (void)
ws_pin (set->owner, pin);
3797 #if !defined(SERVER_MODE) 3818 #if !defined(SERVER_MODE) 3825 if (*result ==
NULL)
3861 error = (*op) (col1, col2, (*result)->set);
3864 #if !defined(SERVER_MODE) 3870 if (col1 != collection1->
set)
3874 if (col2 != collection2->
set)
3878 if (error < 0 && *result)
4005 #if !defined(SERVER_MODE) 4019 #if !defined(SERVER_MODE) 4026 #if !defined(SERVER_MODE) 4153 if (
set ==
NULL || set->owner !=
NULL)
4213 #if defined(ENABLE_UNUSED_FUNCTION) 4296 return col_new (size, collection_type);
4316 for (i = 0; i < col->
size; i++)
4320 for (i = 0; i <= col->
topblock; i++)
4413 for (i = 0; i < col->
size && new_; i++)
4464 #if !defined(SERVER_MODE) 4465 #if defined(ENABLE_UNUSED_FUNCTION) 4497 for (i = 0; i < col->
size && !
error; i++)
4499 val =
INDEX (col, i);
4521 error = setobj_find_temporary_oids (ref->
set, oidset);
4607 if (set->domain !=
NULL)
4613 switch (set->coltype)
4682 #if !defined(SERVER_MODE) 4718 #if !defined (SERVER_MODE) 4733 #if !defined(SERVER_MODE) 4799 #if !defined(SERVER_MODE) 4852 *removed_ptr = removed;
4878 int i, card, removed = 0;
4884 for (i = col->
size - 1; i >= 0; i--)
4886 var =
INDEX (col, i);
4915 if (cardptr ==
NULL)
5030 if (!col || !proposed_value)
5049 value = proposed_value;
5058 value = &coerced_value;
5084 (void)
col_find (col, &found, value, coerce);
5112 long set1_could_be_subset, set2_could_be_subset;
5113 long index1, index2;
5123 if (set1->
size > 0 || set2->
size > 0)
5125 if (set1->
size == 0)
5129 else if (set2->
size == 0)
5140 if (!error && !set2->
sorted)
5151 set1_could_be_subset = 1;
5152 set2_could_be_subset = 1;
5155 while (index1 < set1->size && index2 < set2->size && (set1_could_be_subset || set2_could_be_subset)
5167 set1_could_be_subset = 0;
5171 set2_could_be_subset = 0;
5179 if (index1 < set1->size)
5182 set1_could_be_subset = 0;
5184 if (index2 < set2->size)
5187 set2_could_be_subset = 0;
5189 if (status ==
DB_EQ)
5192 if (set1_could_be_subset && set2_could_be_subset)
5196 else if (set1_could_be_subset)
5200 else if (set2_could_be_subset)
5262 if (!error && !set2->
sorted)
5273 for (i = 0; i < set1->
size; i++)
5305 if (!error && !set2->
sorted)
5313 while (index1 < set1->size && index2 < set2->size && !(error <
NO_ERROR))
5315 val1 =
INDEX (set1, index1);
5316 val2 =
INDEX (set2, index2);
5358 while (index1 < set1->size && !(error <
NO_ERROR))
5360 val1 =
INDEX (set1, index1);
5393 if (!error && !set2->
sorted)
5401 for (index1 = 0; index1 < set1->
size && !(error <
NO_ERROR); index1++)
5403 val1 =
INDEX (set1, index1);
5406 for (index2 = 0; index2 < set2->
size && !(error <
NO_ERROR); index2++)
5408 val2 =
INDEX (set2, index2);
5417 while (index1 < set1->size && index2 < set2->size && !(error <
NO_ERROR))
5419 val1 =
INDEX (set1, index1);
5420 val2 =
INDEX (set2, index2);
5458 while (index1 < set1->size && !(error <
NO_ERROR))
5460 val1 =
INDEX (set1, index1);
5465 while (index2 < set2->size && !(error <
NO_ERROR))
5467 val2 =
INDEX (set2, index2);
5496 if (!error && !set2->
sorted)
5504 while (index1 < set1->size && index2 < set2->size && !(error <
NO_ERROR))
5506 val1 =
INDEX (set1, index1);
5507 val2 =
INDEX (set2, index2);
5553 #if !defined (SERVER_MODE) 5579 for (i = 0; i <
set->size; i++)
5590 if (status ==
DB_EQ)
5596 if (status !=
DB_EQ)
5608 if (status ==
DB_GT)
5614 if (status ==
DB_LT)
5652 #if !defined(SERVER_MODE) 5665 var =
INDEX (col, i);
5715 if (index >= 0 && index < col->size)
5717 *result =
INDEX (col, index);
5852 if (index < col->size)
5964 if (index < 0 || index >= col->
size)
6002 if (index >= col->
size || index < 0)
6009 for (found = -1; index < col->
size && found == -1; index++)
6011 valp =
INDEX (col, index);
6060 for (i = 0; i < col->
size && new_ !=
NULL; i++)
6062 val =
INDEX (col, i);
6096 val =
INDEX (new_, i);
6128 fprintf (fp,
"set");
6132 fprintf (fp,
"multiset");
6135 for (i = 0; i < col->
size; i++)
6138 if (i < col->size - 1)
6143 fprintf (fp,
"}\n");
6162 return set->coltype;
6197 set->domain = domain;
6221 error =
col_put (col, index, value);
6256 if (set->references !=
NULL)
6258 ref =
set->references;
6293 if (set->references ==
NULL)
6322 for (i = 0; i < col->
size; i++)
6334 return error_status;
6339 return error_status;
static int col_expand_array(COL *col, long blockindex)
int set_tform_disk_set(DB_COLLECTION *ref, COL **setptr)
DB_VALUE_COMPARE_RESULT set_compare_order(DB_COLLECTION *set1, DB_COLLECTION *set2, int do_coercion, int total_order)
int set_difference(DB_COLLECTION *collection1, DB_COLLECTION *collection2, DB_COLLECTION **result, DB_DOMAIN *domain)
static long collection_quick_offset
TP_DOMAIN_STATUS tp_value_coerce(const DB_VALUE *src, DB_VALUE *dest, const TP_DOMAIN *desired_domain)
DB_COLLECTION * set_create(DB_TYPE type, int initial_size)
DB_COLLECTION * set_create_multi(void)
#define WS_IS_DELETED(mop)
int set_get_element_nocopy(DB_COLLECTION *set, int index, DB_VALUE *value)
int db_value_put_null(DB_VALUE *value)
int set_drop_seq_element(DB_COLLECTION *set, int index)
int col_put(COL *col, long colindex, DB_VALUE *val)
DB_COLLECTION * db_get_set(const DB_VALUE *value)
int(* SETOBJ_SORT_CMP_FUNC)(const void *, const void *)
TP_DOMAIN_STATUS setobj_check_domain(COL *col, TP_DOMAIN *domain)
TP_DOMAIN_STATUS tp_domain_check(const TP_DOMAIN *domain, const DB_VALUE *value, TP_MATCH exact_match)
DB_VALUE_COMPARE_RESULT tp_value_compare(const DB_VALUE *value1, const DB_VALUE *value2, int allow_coercion, int total_order)
int tp_domain_compatible(const TP_DOMAIN *src, const TP_DOMAIN *dest)
MOP ws_mop(const OID *oid, MOP class_mop)
void area_destroy(AREA *area)
int col_add(COL *col, DB_VALUE *val)
int set_issome(DB_VALUE *value, DB_COLLECTION *set, PT_OP_TYPE op, int do_coercion)
void swizzle_value(DB_VALUE *val, int input)
#define TP_IS_SET_TYPE(typenum)
void set_free(DB_COLLECTION *set)
COL * setobj_create_with_domain(TP_DOMAIN *domain, int initial_size)
int setobj_put_element(COL *col, int index, DB_VALUE *value)
#define ER_REFERENCE_TO_NON_REFERABLE_NOT_ALLOWED
int tp_value_equal(const DB_VALUE *value1, const DB_VALUE *value2, int do_coercion)
#define BLOCK(collection_index)
void set_iterator_free(SET_ITERATOR *it)
DB_COLLECTION * set_copy(DB_COLLECTION *set)
struct tp_domain * setdomain
#define ER_SET_DOMAIN_CONFLICT
bool setobj_ismember(COL *col, DB_VALUE *proposed_value, int check_null)
static long col_move_nulls(COL *col)
struct tp_domain * domain
void set_make_collection(DB_VALUE *value, DB_COLLECTION *col)
COL * setobj_coerce(COL *col, TP_DOMAIN *domain, bool implicit_coercion)
#define ASSERT_ERROR_AND_SET(error_code)
#define assert_release(e)
int db_make_object(DB_VALUE *value, DB_C_OBJECT *obj)
DB_COLLECTION * set_create_sequence(int size)
unsigned may_have_temporary_oids
int setobj_get_element_ptr(COL *col, int index, DB_VALUE **result)
DB_COLLECTION * setobj_get_reference(COL *set)
static void col_initialize(void)
void setobj_put_domain(COL *set, TP_DOMAIN *domain)
COL * setobj_copy(COL *col)
static void free_set_reference(DB_COLLECTION *ref)
int setobj_get_element(COL *set, int index, DB_VALUE *value)
static DB_VALUE * realloc_block(DB_VALUE *in_block, long n)
int setobj_drop_element(COL *col, DB_VALUE *value, bool match_nulls)
struct collect_block * next
int col_drop(COL *col, DB_VALUE *val)
TP_DOMAIN * tp_domain_resolve_value(const DB_VALUE *val, TP_DOMAIN *dbuf)
int set_iterator_next(SET_ITERATOR *it)
TP_DOMAIN * tp_domain_copy(const TP_DOMAIN *domain, bool check_cache)
long col_find(COL *col, long *found, DB_VALUE *val, int do_coerce)
int col_delete(COL *col, long colindex)
void set_free_block(DB_VALUE *in_block)
int setobj_cardinality(COL *col)
DB_VALUE_COMPARE_RESULT set_seq_compare(DB_COLLECTION *set1, DB_COLLECTION *set2, int do_coercion, int total_order)
DB_COLLECTION * set_create_with_domain(TP_DOMAIN *domain, int initial_size)
int set_size(DB_COLLECTION *set)
enum tp_domain_status TP_DOMAIN_STATUS
int col_drop_nulls(COL *col)
int setobj_filter(COL *col, int filter, int *cardptr)
bool ws_is_same_object(MOP mop1, MOP mop2)
int setobj_build_domain_from_col(COL *col, TP_DOMAIN **set_domain)
static int check_set_object(DB_VALUE *var, int *removed_ptr)
AREA * area_create(const char *name, size_t element_size, size_t alloc_count)
DB_ELO * db_get_elo(const DB_VALUE *value)
LC_OIDMAP * locator_add_oidset_object(LC_OIDSET *oidset, MOP obj_mop)
#define ER_SEQ_ELEMENT_NOT_FOUND
TP_DOMAIN * setobj_get_domain(COL *set)
#define OFFSET(collection_index)
bool set_ismember(DB_COLLECTION *set, DB_VALUE *value)
#define EXPAND(blockindex)
#define BLOCK_START(block)
int setobj_find_seq_element(COL *col, DB_VALUE *value, int index)
int set_union(DB_COLLECTION *collection1, DB_COLLECTION *collection2, DB_COLLECTION **result, DB_DOMAIN *domain)
DB_COLLECTION * set_coerce(DB_COLLECTION *set, TP_DOMAIN *domain, bool implicit_coercion)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
struct set_iterator * next
DB_TYPE setobj_type(struct setobj *set)
int set_get_setobj(DB_COLLECTION *ref, COL **setptr, int for_write)
int set_add_element(DB_COLLECTION *set, DB_VALUE *value)
int set_filter(DB_COLLECTION *set)
struct collect_block COL_BLOCK
bool setobj_isempty(COL *col)
int setobj_sort(COL *col)
int obj_lock(MOP op, int for_write)
int ws_pin(MOP mop, int pin)
static void col_null_values(COL *col, long bottomvalue, long topvalue)
static int set_op(DB_COLLECTION *collection1, DB_COLLECTION *collection2, DB_COLLECTION **result, DB_DOMAIN *domain, SETOBJ_OP op)
TP_DOMAIN * setobj_domain(COL *set)
int setobj_insert_element(COL *col, int index, DB_VALUE *value)
COL * setobj_create(DB_TYPE collection_type, int size)
need_clear_type need_clear
#define DB_VALUE_DOMAIN_TYPE(value)
static int col_successive_merge(COL *col, long top)
int col_has_null(COL *col)
#define WS_MAX_QUICK_SIZE
#define CHECKNULL_ERR(thing)
unsigned int db_on_server
int col_permanent_oids(COL *col)
DB_VALUE_COMPARE_RESULT setobj_compare(COL *set1, COL *set2, int do_coercion)
DB_OBJECT * db_get_object(const DB_VALUE *value)
MOP ws_class_mop(MOP mop)
static void merge_set_references(COL *set, DB_COLLECTION *ref)
TP_DOMAIN_STATUS tp_value_cast(const DB_VALUE *src, DB_VALUE *dest, const TP_DOMAIN *desired_domain, bool implicit_coercion)
static void col_merge_runs(COL *col, DB_VALUE **runs, long runsize, long top)
#define TP_DOMAIN_TYPE(dom)
#define WS_SET_DELETED(mop)
int locator_assign_oidset(LC_OIDSET *oidset, LC_OIDMAP_CALLBACK callback)
LOCK ws_get_lock(MOP mop)
const char * pr_type_name(DB_TYPE id)
#define ER_SEQ_OUT_OF_BOUNDS
int setobj_put_value(COL *col, int index, DB_VALUE *value)
int pt_is_reference_to_reusable_oid(DB_VALUE *val)
void setobj_free(COL *col)
DB_COLLECTION * set_change_owner(DB_COLLECTION *ref, MOP owner, int attid, TP_DOMAIN *domain)
#define db_private_free_and_init(thrd, ptr)
void PRIM_SET_NULL(DB_VALUE *value)
static long non_null_index(COL *col, long lower, long upper)
#define TM_TRAN_READ_FETCH_VERSION()
LC_OIDSET * locator_make_oid_set(void)
DB_VALUE_COMPARE_RESULT set_compare(DB_COLLECTION *set1, DB_COLLECTION *set2, int do_coercion)
void or_init(OR_BUF *buf, char *data, int length)
#define db_private_alloc(thrd, size)
#define ER_SET_INVALID_DOMAIN
int set_connect(DB_COLLECTION *ref, MOP owner, int attid, TP_DOMAIN *domain)
int set_get_element(DB_COLLECTION *set, int index, DB_VALUE *value)
int tp_domain_add(TP_DOMAIN **dlist, TP_DOMAIN *domain)
int pr_clear_value(DB_VALUE *value)
int vid_vobj_to_object(const DB_VALUE *vobj, DB_OBJECT **mop)
void locator_free_oid_set(THREAD_ENTRY *thread_p, LC_OIDSET *oidset)
void set_fprint(FILE *fp, DB_COLLECTION *set)
setobj * or_get_set(OR_BUF *buf, struct tp_domain *domain)
#define ER_SET_INVALID_INDEX
void set_area_final(void)
struct db_domain_info::general_info general_info
int col_value_compare(DB_VALUE *a, DB_VALUE *b)
#define INDEX(collection, index)
static int assign_set_value(COL *set, DB_VALUE *src, DB_VALUE *dest, bool implicit_coercion)
int set_cardinality(DB_COLLECTION *set)
int set_put_element(DB_COLLECTION *set, int index, DB_VALUE *value)
static void error(const char *msg)
static void free_iterator(SET_ITERATOR *it)
static DB_VALUE * new_block(long n)
TP_DOMAIN * set_get_domain(DB_COLLECTION *set)
int setobj_add_element(COL *col, DB_VALUE *value)
#define OBJECT_HAS_TEMP_OID(obj)
#define DB_DEFAULT_PRECISION
int locator_does_exist_object(MOP mop, DB_FETCH_MODE purpose)
bool db_value_is_null(const DB_VALUE *value)
DB_VALUE_COMPARE_RESULT setvobj_compare(COL *set1, COL *set2, int do_coercion, int total_order)
int obj_locate_attribute(MOP op, int attid, int for_write, char **memp, SM_ATTRIBUTE **attp)
#define SET_DUPLICATE_VALUE
int pr_clone_value(const DB_VALUE *src, DB_VALUE *dest)
OID * db_get_oid(const DB_VALUE *value)
bool set_isempty(DB_COLLECTION *set)
TP_DOMAIN_STATUS set_check_domain(DB_COLLECTION *set, TP_DOMAIN *domain)
void db_fprint_value(FILE *fp, const db_value *value)
int setobj_union(COL *set1, COL *set2, COL *result)
DB_VALUE_COMPARE_RESULT setobj_compare_order(COL *set1, COL *set2, int do_coercion, int total_order)
#define ER_OBJ_INVALID_ARGUMENTS
int setobj_release(COL *set)
DB_COLLECTION * set_make_reference(void)
void set_print(DB_COLLECTION *set)
void * area_alloc(AREA *area)
int area_free(AREA *area, void *ptr)
int set_intersection(DB_COLLECTION *collection1, DB_COLLECTION *collection2, DB_COLLECTION **result, DB_DOMAIN *domain)
int col_insert(COL *col, long colindex, DB_VALUE *val)
DB_VALUE * set_iterator_value(SET_ITERATOR *it)
bool set_has_null(DB_COLLECTION *set)
int set_optimize(DB_COLLECTION *ref)
#define DB_VALUE_TYPE(value)
int db_make_null(DB_VALUE *value)
#define DB_IS_NULL(value)
COL * col_new(long size, int settype)
int col_expand(COL *col, long i)
int setobj_intersection(COL *set1, COL *set2, COL *result)
int set_find_seq_element(DB_COLLECTION *set, DB_VALUE *value, int index)
TP_DOMAIN tp_Sequence_domain
int au_fetch_instance(MOP op, MOBJ *obj_ptr, AU_FETCHMODE mode, LC_FETCH_VERSION_TYPE fetch_version_type, DB_AUTH type)
int set_disconnect(DB_COLLECTION *ref)
DB_TYPE set_get_type(DB_COLLECTION *set)
DB_VALUE * set_new_element(DB_COLLECTION *ref)
int set_insert_element(DB_COLLECTION *set, int index, DB_VALUE *value)
static void col_merge_run(COL *col, DB_VALUE **runs, long run1start, long run1stop, long run2start, long run2stop)
int setobj_drop_seq_element(COL *col, int index)
DB_COLLECTION * references
int(* SETOBJ_OP)(COL *set1, COL *set2, COL *result)
int setobj_convert_oids_to_objects(COL *col)
static SET_ITERATOR * make_iterator(void)
#define db_private_realloc(thrd, ptr, size)
DB_VALUE_COMPARE_RESULT vobj_compare(DB_COLLECTION *set1, DB_COLLECTION *set2, int do_coercion, int total_order)
int setobj_size(COL *col)
void setobj_clear(COL *col)
static void col_debug(COL *col)
int set_convert_oids_to_objects(DB_COLLECTION *set)
static int col_expand_blocks(COL *col, long blockindex, long blockoffset)
TP_DOMAIN tp_Multiset_domain
static long col_bsearch(COL *col, long lower, long upper, long *found, DB_VALUE *val, int do_coerce)
SET_ITERATOR * set_iterate(DB_COLLECTION *set)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
int set_drop_element(DB_COLLECTION *set, DB_VALUE *value, bool match_nulls)
int setobj_difference(COL *set1, COL *set2, COL *result)
int db_value_domain_init(DB_VALUE *value, const DB_TYPE type, const int precision, const int scale)
void setobj_print(FILE *fp, COL *col)
DB_COLLECTION * set_create_basic(void)
int setobj_issome(DB_VALUE *value, COL *set, PT_OP_TYPE op, int do_coercion)