Skip to content

File set_object.c

FileList > cubrid > src > object > set_object.c

Go to the source code of this file

  • #include "config.h"
  • #include <stdio.h>
  • #include <assert.h>
  • #include "area_alloc.h"
  • #include "db_value_printer.hpp"
  • #include "dbtype.h"
  • #include "error_manager.h"
  • #include "object_primitive.h"
  • #include "object_representation.h"
  • #include "set_object.h"
  • #include "memory_wrapper.hpp"

Classes

Type Name
struct collect_block

Public Types

Type Name
typedef struct collect_block COL_BLOCK
typedef int(* SETOBJ_OP
typedef int(* SETOBJ_SORT_CMP_FUNC

Public Attributes

Type Name
AREA * Set_Obj_Area = [**NULL**](freelistheap_8h.md#define-null)
AREA * Set_Ref_Area = [**NULL**](freelistheap_8h.md#define-null)

Public Static Attributes

Type Name
long col_init = 0
long collection_quick_offset = 0
int debug_level = 0

Public Functions

Type Name
int col_add (COL * col, DB_VALUE * val)
int col_delete (COL * col, long colindex)
int col_drop (COL * col, DB_VALUE * val)
int col_drop_nulls (COL * col)
int col_expand (COL * col, long i)
long col_find (COL * col, long * found, DB_VALUE * val, int do_coerce)
int col_has_null (COL * col)
int col_insert (COL * col, long colindex, DB_VALUE * val)
COL * col_new (long size, int settype)
int col_permanent_oids (COL * col)
int col_put (COL * col, long colindex, DB_VALUE * val)
int col_sort (COL * col)
int col_value_compare (DB_VALUE * a, DB_VALUE * b)
int set_add_element (DB_COLLECTION * set, DB_VALUE * value)
int set_add_element_quick (DB_COLLECTION * set, DB_VALUE * value)
void set_area_final (void)
int set_area_init (void)
void set_area_reset ()
int set_cardinality (DB_COLLECTION * set)
DB_COLLECTION * set_change_owner (DB_COLLECTION * ref, MOP owner, int attid, TP_DOMAIN * domain)
TP_DOMAIN_STATUS set_check_domain (DB_COLLECTION * set, TP_DOMAIN * domain)
int set_clear (DB_COLLECTION * set)
DB_COLLECTION * set_coerce (DB_COLLECTION * set, TP_DOMAIN * domain, bool implicit_coercion)
DB_VALUE_COMPARE_RESULT set_compare (DB_COLLECTION * set1, DB_COLLECTION * set2, int do_coercion)
DB_VALUE_COMPARE_RESULT set_compare_order (DB_COLLECTION * set1, DB_COLLECTION * set2, int do_coercion, int total_order)
int set_connect (DB_COLLECTION * ref, MOP owner, int attid, TP_DOMAIN * domain)
int set_convert_oids_to_objects (DB_COLLECTION * set)
DB_COLLECTION * set_copy (DB_COLLECTION * set)
DB_COLLECTION * set_create (DB_TYPE type, int initial_size)
DB_COLLECTION * set_create_basic (void)
DB_COLLECTION * set_create_multi (void)
DB_COLLECTION * set_create_sequence (int size)
DB_COLLECTION * set_create_with_domain (TP_DOMAIN * domain, int initial_size)
int set_difference (DB_COLLECTION * collection1, DB_COLLECTION * collection2, DB_COLLECTION ** result, DB_DOMAIN * domain)
int set_disconnect (DB_COLLECTION * ref)
int set_drop_element (DB_COLLECTION * set, DB_VALUE * value, bool match_nulls)
int set_drop_seq_element (DB_COLLECTION * set, int index)
int set_filter (DB_COLLECTION * set)
void set_final (void)
int set_find_seq_element (DB_COLLECTION * set, DB_VALUE * value, int index)
void set_fprint (FILE * fp, DB_COLLECTION * set)
void set_free (DB_COLLECTION * set)
void set_free_block (DB_VALUE * in_block)
TP_DOMAIN * set_get_domain (DB_COLLECTION * set)
int set_get_element (DB_COLLECTION * set, int index, DB_VALUE * value)
int set_get_element_nocopy (DB_COLLECTION * set, int index, DB_VALUE * value)
int set_get_setobj (DB_COLLECTION * ref, COL ** setptr, int for_write)
DB_TYPE set_get_type (DB_COLLECTION * set)
bool set_has_null (DB_COLLECTION * set)
int set_insert_element (DB_COLLECTION * set, int index, DB_VALUE * value)
int set_intersection (DB_COLLECTION * collection1, DB_COLLECTION * collection2, DB_COLLECTION ** result, DB_DOMAIN * domain)
bool set_is_all_null (DB_COLLECTION * set)
bool set_isempty (DB_COLLECTION * set)
bool set_ismember (DB_COLLECTION * set, DB_VALUE * value)
SET_ITERATOR * set_iterate (DB_COLLECTION * set)
int set_iterator_finished (SET_ITERATOR * it)
void set_iterator_free (SET_ITERATOR * it)
int set_iterator_next (SET_ITERATOR * it)
DB_VALUE * set_iterator_value (SET_ITERATOR * it)
void set_make_collection (DB_VALUE * value, DB_COLLECTION * col)
DB_COLLECTION * set_make_reference (void)
DB_VALUE * set_new_element (DB_COLLECTION * ref)
int set_optimize (DB_COLLECTION * ref)
void set_print (DB_COLLECTION * set)
int set_put_element (DB_COLLECTION * set, int index, DB_VALUE * value)
DB_VALUE_COMPARE_RESULT set_seq_compare (DB_COLLECTION * set1, DB_COLLECTION * set2, int do_coercion, int total_order)
int set_size (DB_COLLECTION * set)
int set_tform_disk_set (DB_COLLECTION * ref, COL ** setptr)
int set_union (DB_COLLECTION * collection1, DB_COLLECTION * collection2, DB_COLLECTION ** result, DB_DOMAIN * domain)
int setobj_add_element (COL * col, DB_VALUE * value)
int setobj_build_domain_from_col (COL * col, TP_DOMAIN ** set_domain)
int setobj_cardinality (COL * col)
TP_DOMAIN_STATUS setobj_check_domain (COL * col, TP_DOMAIN * domain)
void setobj_clear (COL * col)
COL * setobj_coerce (COL * col, TP_DOMAIN * domain, bool implicit_coercion)
DB_VALUE_COMPARE_RESULT setobj_compare (COL * set1, COL * set2, int do_coercion)
DB_VALUE_COMPARE_RESULT setobj_compare_order (COL * set1, COL * set2, int do_coercion, int total_order)
int setobj_convert_oids_to_objects (COL * col)
COL * setobj_copy (COL * col)
COL * setobj_create (DB_TYPE collection_type, int size)
COL * setobj_create_with_domain (TP_DOMAIN * domain, int initial_size)
int setobj_difference (COL * set1, COL * set2, COL * result)
TP_DOMAIN * setobj_domain (COL * set)
int setobj_drop_element (COL * col, DB_VALUE * value, bool match_nulls)
int setobj_drop_seq_element (COL * col, int index)
int setobj_filter (COL * col, int filter, int * cardptr)
int setobj_find_seq_element (COL * col, DB_VALUE * value, int index)
void setobj_free (COL * col)
TP_DOMAIN * setobj_get_domain (COL * set)
int setobj_get_element (COL * set, int index, DB_VALUE * value)
int setobj_get_element_ptr (COL * col, int index, DB_VALUE ** result)
DB_COLLECTION * setobj_get_reference (COL * set)
int setobj_insert_element (COL * col, int index, DB_VALUE * value)
int setobj_intersection (COL * set1, COL * set2, COL * result)
bool setobj_isempty (COL * col)
bool setobj_ismember (COL * col, DB_VALUE * proposed_value, int check_null)
void setobj_print (FILE * fp, COL * col)
void setobj_put_domain (COL * set, TP_DOMAIN * domain)
int setobj_put_element (COL * col, int index, DB_VALUE * value)
int setobj_put_value (COL * col, int index, DB_VALUE * value)
int setobj_release (COL * set)
int setobj_size (COL * col)
int setobj_sort (COL * col)
DB_TYPE setobj_type (struct setobj * set)
int setobj_union (COL * set1, COL * set2, COL * result)
DB_VALUE_COMPARE_RESULT setvobj_compare (COL * set1, COL * set2, int do_coercion, int total_order)
void swizzle_value (DB_VALUE * val, int input)
DB_VALUE_COMPARE_RESULT vobj_compare (DB_COLLECTION * set1, DB_COLLECTION * set2, int do_coercion, int total_order)

Public Static Functions

Type Name
int assign_set_value (COL * set, DB_VALUE * src, DB_VALUE * dest, bool implicit_coercion)
int check_set_object (DB_VALUE * var, int * removed_ptr)
long col_bsearch (COL * col, long lower, long upper, long * found, DB_VALUE * val, int do_coerce)
void col_debug (COL * col)
int col_expand_array (COL * col, long blockindex)
int col_expand_blocks (COL * col, long blockindex, long blockoffset)
void col_initialize (void)
int col_is_all_null (COL * col)
void col_merge_run (COL * col, DB_VALUE ** runs, long run1start, long run1stop, long run2start, long run2stop)
void col_merge_runs (COL * col, DB_VALUE ** runs, long runsize, long top)
long col_move_nulls (COL * col)
void col_null_values (COL * col, long bottomvalue, long topvalue)
int col_successive_merge (COL * col, long top)
void free_iterator (SET_ITERATOR * it)
void free_set_reference (DB_COLLECTION * ref)
SET_ITERATOR * make_iterator (void)
DB_VALUE * new_block (long n)
long non_null_index (COL * col, long lower, long upper)
DB_VALUE * realloc_block (DB_VALUE * in_block, long n)
int set_op (DB_COLLECTION * collection1, DB_COLLECTION * collection2, DB_COLLECTION ** result, DB_DOMAIN * domain, SETOBJ_OP op)

Macros

Type Name
define CHECKNULL_ERR (thing) /* multi line expression */
define COL_ARRAY_SIZE (size) ((size + ([**COL\_BLOCK\_SIZE**](set__object_8h.md#define-col_block_size) - 1)) / [**COL\_BLOCK\_SIZE**](set__object_8h.md#define-col_block_size))
define SET_AREA_COUNT (1024)
define WS_MAX_QUICK_SIZE 1024

Public Types Documentation

typedef COL_BLOCK

typedef struct collect_block COL_BLOCK;

typedef SETOBJ_OP

typedef int(* SETOBJ_OP) (COL *set1, COL *set2, COL *result);

typedef SETOBJ_SORT_CMP_FUNC

typedef int(* SETOBJ_SORT_CMP_FUNC) (const void *, const void *);

Public Attributes Documentation

variable Set_Obj_Area

AREA* Set_Obj_Area;

variable Set_Ref_Area

AREA* Set_Ref_Area;

Public Static Attributes Documentation

variable col_init

long col_init;

variable collection_quick_offset

long collection_quick_offset;

variable debug_level

int debug_level;

Public Functions Documentation

function col_add

int col_add (
    COL * col,
    DB_VALUE * val
) 

function col_delete

int col_delete (
    COL * col,
    long colindex
) 

function col_drop

int col_drop (
    COL * col,
    DB_VALUE * val
) 

function col_drop_nulls

int col_drop_nulls (
    COL * col
) 

function col_expand

int col_expand (
    COL * col,
    long i
) 

function col_find

long col_find (
    COL * col,
    long * found,
    DB_VALUE * val,
    int do_coerce
) 

function col_has_null

int col_has_null (
    COL * col
) 

function col_insert

int col_insert (
    COL * col,
    long colindex,
    DB_VALUE * val
) 

function col_new

COL * col_new (
    long size,
    int settype
) 

function col_permanent_oids

int col_permanent_oids (
    COL * col
) 

function col_put

int col_put (
    COL * col,
    long colindex,
    DB_VALUE * val
) 

function col_sort

int col_sort (
    COL * col
) 

function col_value_compare

int col_value_compare (
    DB_VALUE * a,
    DB_VALUE * b
) 

function set_add_element

int set_add_element (
    DB_COLLECTION * set,
    DB_VALUE * value
) 

function set_add_element_quick

int set_add_element_quick (
    DB_COLLECTION * set,
    DB_VALUE * value
) 

function set_area_final

void set_area_final (
    void
) 

function set_area_init

int set_area_init (
    void
) 

function set_area_reset

void set_area_reset () 

function set_cardinality

int set_cardinality (
    DB_COLLECTION * set
) 

function set_change_owner

DB_COLLECTION * set_change_owner (
    DB_COLLECTION * ref,
    MOP owner,
    int attid,
    TP_DOMAIN * domain
) 

function set_check_domain

TP_DOMAIN_STATUS set_check_domain (
    DB_COLLECTION * set,
    TP_DOMAIN * domain
) 

function set_clear

int set_clear (
    DB_COLLECTION * set
) 

function set_coerce

DB_COLLECTION * set_coerce (
    DB_COLLECTION * set,
    TP_DOMAIN * domain,
    bool implicit_coercion
) 

function set_compare

DB_VALUE_COMPARE_RESULT set_compare (
    DB_COLLECTION * set1,
    DB_COLLECTION * set2,
    int do_coercion
) 

function set_compare_order

DB_VALUE_COMPARE_RESULT set_compare_order (
    DB_COLLECTION * set1,
    DB_COLLECTION * set2,
    int do_coercion,
    int total_order
) 

function set_connect

int set_connect (
    DB_COLLECTION * ref,
    MOP owner,
    int attid,
    TP_DOMAIN * domain
) 

function set_convert_oids_to_objects

int set_convert_oids_to_objects (
    DB_COLLECTION * set
) 

function set_copy

DB_COLLECTION * set_copy (
    DB_COLLECTION * set
) 

function set_create

DB_COLLECTION * set_create (
    DB_TYPE type,
    int initial_size
) 

function set_create_basic

DB_COLLECTION * set_create_basic (
    void
) 

function set_create_multi

DB_COLLECTION * set_create_multi (
    void
) 

function set_create_sequence

DB_COLLECTION * set_create_sequence (
    int size
) 

function set_create_with_domain

DB_COLLECTION * set_create_with_domain (
    TP_DOMAIN * domain,
    int initial_size
) 

function set_difference

int set_difference (
    DB_COLLECTION * collection1,
    DB_COLLECTION * collection2,
    DB_COLLECTION ** result,
    DB_DOMAIN * domain
) 

function set_disconnect

int set_disconnect (
    DB_COLLECTION * ref
) 

function set_drop_element

int set_drop_element (
    DB_COLLECTION * set,
    DB_VALUE * value,
    bool match_nulls
) 

function set_drop_seq_element

int set_drop_seq_element (
    DB_COLLECTION * set,
    int index
) 

function set_filter

int set_filter (
    DB_COLLECTION * set
) 

function set_final

void set_final (
    void
) 

function set_find_seq_element

int set_find_seq_element (
    DB_COLLECTION * set,
    DB_VALUE * value,
    int index
) 

function set_fprint

void set_fprint (
    FILE * fp,
    DB_COLLECTION * set
) 

function set_free

void set_free (
    DB_COLLECTION * set
) 

function set_free_block

void set_free_block (
    DB_VALUE * in_block
) 

function set_get_domain

TP_DOMAIN * set_get_domain (
    DB_COLLECTION * set
) 

function set_get_element

int set_get_element (
    DB_COLLECTION * set,
    int index,
    DB_VALUE * value
) 

function set_get_element_nocopy

int set_get_element_nocopy (
    DB_COLLECTION * set,
    int index,
    DB_VALUE * value
) 

function set_get_setobj

int set_get_setobj (
    DB_COLLECTION * ref,
    COL ** setptr,
    int for_write
) 

function set_get_type

DB_TYPE set_get_type (
    DB_COLLECTION * set
) 

function set_has_null

bool set_has_null (
    DB_COLLECTION * set
) 

function set_insert_element

int set_insert_element (
    DB_COLLECTION * set,
    int index,
    DB_VALUE * value
) 

function set_intersection

int set_intersection (
    DB_COLLECTION * collection1,
    DB_COLLECTION * collection2,
    DB_COLLECTION ** result,
    DB_DOMAIN * domain
) 

function set_is_all_null

bool set_is_all_null (
    DB_COLLECTION * set
) 

function set_isempty

bool set_isempty (
    DB_COLLECTION * set
) 

function set_ismember

bool set_ismember (
    DB_COLLECTION * set,
    DB_VALUE * value
) 

function set_iterate

SET_ITERATOR * set_iterate (
    DB_COLLECTION * set
) 

function set_iterator_finished

int set_iterator_finished (
    SET_ITERATOR * it
) 

function set_iterator_free

void set_iterator_free (
    SET_ITERATOR * it
) 

function set_iterator_next

int set_iterator_next (
    SET_ITERATOR * it
) 

function set_iterator_value

DB_VALUE * set_iterator_value (
    SET_ITERATOR * it
) 

function set_make_collection

void set_make_collection (
    DB_VALUE * value,
    DB_COLLECTION * col
) 

function set_make_reference

DB_COLLECTION * set_make_reference (
    void
) 

function set_new_element

DB_VALUE * set_new_element (
    DB_COLLECTION * ref
) 

function set_optimize

int set_optimize (
    DB_COLLECTION * ref
) 

function set_print

void set_print (
    DB_COLLECTION * set
) 

function set_put_element

int set_put_element (
    DB_COLLECTION * set,
    int index,
    DB_VALUE * value
) 

function set_seq_compare

DB_VALUE_COMPARE_RESULT set_seq_compare (
    DB_COLLECTION * set1,
    DB_COLLECTION * set2,
    int do_coercion,
    int total_order
) 

function set_size

int set_size (
    DB_COLLECTION * set
) 

function set_tform_disk_set

int set_tform_disk_set (
    DB_COLLECTION * ref,
    COL ** setptr
) 

function set_union

int set_union (
    DB_COLLECTION * collection1,
    DB_COLLECTION * collection2,
    DB_COLLECTION ** result,
    DB_DOMAIN * domain
) 

function setobj_add_element

int setobj_add_element (
    COL * col,
    DB_VALUE * value
) 

function setobj_build_domain_from_col

int setobj_build_domain_from_col (
    COL * col,
    TP_DOMAIN ** set_domain
) 

function setobj_cardinality

int setobj_cardinality (
    COL * col
) 

function setobj_check_domain

TP_DOMAIN_STATUS setobj_check_domain (
    COL * col,
    TP_DOMAIN * domain
) 

function setobj_clear

void setobj_clear (
    COL * col
) 

function setobj_coerce

COL * setobj_coerce (
    COL * col,
    TP_DOMAIN * domain,
    bool implicit_coercion
) 

function setobj_compare

DB_VALUE_COMPARE_RESULT setobj_compare (
    COL * set1,
    COL * set2,
    int do_coercion
) 

function setobj_compare_order

DB_VALUE_COMPARE_RESULT setobj_compare_order (
    COL * set1,
    COL * set2,
    int do_coercion,
    int total_order
) 

function setobj_convert_oids_to_objects

int setobj_convert_oids_to_objects (
    COL * col
) 

function setobj_copy

COL * setobj_copy (
    COL * col
) 

function setobj_create

COL * setobj_create (
    DB_TYPE collection_type,
    int size
) 

function setobj_create_with_domain

COL * setobj_create_with_domain (
    TP_DOMAIN * domain,
    int initial_size
) 

function setobj_difference

int setobj_difference (
    COL * set1,
    COL * set2,
    COL * result
) 

function setobj_domain

TP_DOMAIN * setobj_domain (
    COL * set
) 

function setobj_drop_element

int setobj_drop_element (
    COL * col,
    DB_VALUE * value,
    bool match_nulls
) 

function setobj_drop_seq_element

int setobj_drop_seq_element (
    COL * col,
    int index
) 

function setobj_filter

int setobj_filter (
    COL * col,
    int filter,
    int * cardptr
) 

function setobj_find_seq_element

int setobj_find_seq_element (
    COL * col,
    DB_VALUE * value,
    int index
) 

function setobj_free

void setobj_free (
    COL * col
) 

function setobj_get_domain

TP_DOMAIN * setobj_get_domain (
    COL * set
) 

function setobj_get_element

int setobj_get_element (
    COL * set,
    int index,
    DB_VALUE * value
) 

function setobj_get_element_ptr

int setobj_get_element_ptr (
    COL * col,
    int index,
    DB_VALUE ** result
) 

function setobj_get_reference

DB_COLLECTION * setobj_get_reference (
    COL * set
) 

function setobj_insert_element

int setobj_insert_element (
    COL * col,
    int index,
    DB_VALUE * value
) 

function setobj_intersection

int setobj_intersection (
    COL * set1,
    COL * set2,
    COL * result
) 

function setobj_isempty

bool setobj_isempty (
    COL * col
) 

function setobj_ismember

bool setobj_ismember (
    COL * col,
    DB_VALUE * proposed_value,
    int check_null
) 

function setobj_print

void setobj_print (
    FILE * fp,
    COL * col
) 

function setobj_put_domain

void setobj_put_domain (
    COL * set,
    TP_DOMAIN * domain
) 

function setobj_put_element

int setobj_put_element (
    COL * col,
    int index,
    DB_VALUE * value
) 

function setobj_put_value

int setobj_put_value (
    COL * col,
    int index,
    DB_VALUE * value
) 

function setobj_release

int setobj_release (
    COL * set
) 

function setobj_size

int setobj_size (
    COL * col
) 

function setobj_sort

int setobj_sort (
    COL * col
) 

function setobj_type

DB_TYPE setobj_type (
    struct  setobj * set
) 

function setobj_union

int setobj_union (
    COL * set1,
    COL * set2,
    COL * result
) 

function setvobj_compare

DB_VALUE_COMPARE_RESULT setvobj_compare (
    COL * set1,
    COL * set2,
    int do_coercion,
    int total_order
) 

function swizzle_value

void swizzle_value (
    DB_VALUE * val,
    int input
) 

function vobj_compare

DB_VALUE_COMPARE_RESULT vobj_compare (
    DB_COLLECTION * set1,
    DB_COLLECTION * set2,
    int do_coercion,
    int total_order
) 

Public Static Functions Documentation

function assign_set_value

static int assign_set_value (
    COL * set,
    DB_VALUE * src,
    DB_VALUE * dest,
    bool implicit_coercion
) 

function check_set_object

static int check_set_object (
    DB_VALUE * var,
    int * removed_ptr
) 

function col_bsearch

static long col_bsearch (
    COL * col,
    long lower,
    long upper,
    long * found,
    DB_VALUE * val,
    int do_coerce
) 

function col_debug

static void col_debug (
    COL * col
) 

function col_expand_array

static int col_expand_array (
    COL * col,
    long blockindex
) 

function col_expand_blocks

static int col_expand_blocks (
    COL * col,
    long blockindex,
    long blockoffset
) 

function col_initialize

static void col_initialize (
    void
) 

function col_is_all_null

static int col_is_all_null (
    COL * col
) 

function col_merge_run

static void col_merge_run (
    COL * col,
    DB_VALUE ** runs,
    long run1start,
    long run1stop,
    long run2start,
    long run2stop
) 

function col_merge_runs

static void col_merge_runs (
    COL * col,
    DB_VALUE ** runs,
    long runsize,
    long top
) 

function col_move_nulls

static long col_move_nulls (
    COL * col
) 

function col_null_values

static void col_null_values (
    COL * col,
    long bottomvalue,
    long topvalue
) 

function col_successive_merge

static int col_successive_merge (
    COL * col,
    long top
) 

function free_iterator

static void free_iterator (
    SET_ITERATOR * it
) 

function free_set_reference

static void free_set_reference (
    DB_COLLECTION * ref
) 

function make_iterator

static SET_ITERATOR * make_iterator (
    void
) 

function new_block

static DB_VALUE * new_block (
    long n
) 

function non_null_index

static long non_null_index (
    COL * col,
    long lower,
    long upper
) 

function realloc_block

static DB_VALUE * realloc_block (
    DB_VALUE * in_block,
    long n
) 

function set_op

static int set_op (
    DB_COLLECTION * collection1,
    DB_COLLECTION * collection2,
    DB_COLLECTION ** result,
    DB_DOMAIN * domain,
    SETOBJ_OP op
) 

Macro Definition Documentation

define CHECKNULL_ERR

#define CHECKNULL_ERR (
    thing
) `/* multi line expression */`

define COL_ARRAY_SIZE

#define COL_ARRAY_SIZE (
    size
) `((size + ( COL_BLOCK_SIZE - 1)) / COL_BLOCK_SIZE )`

define SET_AREA_COUNT

#define SET_AREA_COUNT `(1024)`

define WS_MAX_QUICK_SIZE

#define WS_MAX_QUICK_SIZE `1024`


The documentation for this class was generated from the following file cubrid/src/object/set_object.c