Skip to content

File dbtype.h

FileList > compat > dbtype.h

Go to the source code of this file

  • #include "config.h"
  • #include "system_parameter.h"
  • #include "error_manager.h"
  • #include "system.h"
  • #include "db_set.h"
  • #include "db_set_function.h"
  • #include "dbtype_def.h"
  • #include "elo.h"
  • #include "object_domain.h"
  • #include "oid.h"
  • #include "language_support.h"
  • #include "intl_support.h"
  • #include "memory_alloc.h"
  • #include "dbtype_function.i"

Public Functions

Type Name
int db_convert_json_into_scalar (const DB_VALUE * src, DB_VALUE * dest)
void db_date_decode (const DB_DATE * date, int * monthp, int * dayp, int * yearp)
int db_date_encode (DB_DATE * date, int month, int day, int year)
const char * db_default_expression_string (DB_DEFAULT_EXPR_TYPE default_expr_type)
DB_CURRENCY db_get_currency_default (void)
int db_get_deep_copy_of_json (const DB_JSON * src, DB_JSON * dst)
char * db_get_json_raw_body (const DB_VALUE * value)
int db_init_db_json_pointers (DB_JSON * val)
bool db_is_json_doc_type (DB_TYPE type)
bool db_is_json_value_type (DB_TYPE type)
int db_json_val_from_str (const char * raw_str, const int str_size, DB_VALUE * json_val)
int db_string_truncate (DB_VALUE * value, const int max_precision)
void db_time_decode (DB_TIME * timeval, int * hourp, int * minutep, int * secondp)
int db_time_encode (DB_TIME * timeval, int hour, int minute, int second)
DB_DOMAIN * db_type_to_db_domain (DB_TYPE type)
int db_value_alter_type (DB_VALUE * value, DB_TYPE type)
int db_value_clear (DB_VALUE * value)
int db_value_clear_array (DB_VALUE_ARRAY * value_array)
int db_value_clone (DB_VALUE * src, DB_VALUE * dest)
int db_value_coerce (const DB_VALUE * src, DB_VALUE * dest, const DB_DOMAIN * desired_domain)
int db_value_compare (const DB_VALUE * value1, const DB_VALUE * value2)
DB_VALUE * db_value_copy (DB_VALUE * value)
DB_VALUE * db_value_create (void)
int db_value_domain_default (DB_VALUE * value, const DB_TYPE type, const int precision, const int scale, const int codeset, const int collation_id, DB_ENUMERATION * enumeration)
int db_value_domain_init (DB_VALUE * value, DB_TYPE type, const int precision, const int scale)
void db_value_domain_init_default (DB_VALUE * value, const DB_TYPE type)
int db_value_domain_max (DB_VALUE * value, DB_TYPE type, const int precision, const int scale, const int codeset, const int collation_id, const DB_ENUMERATION * enumeration)
int db_value_domain_min (DB_VALUE * value, DB_TYPE type, const int precision, const int scale, const int codeset, const int collation_id, const DB_ENUMERATION * enumeration)
int db_value_domain_zero (DB_VALUE * value, const DB_TYPE type, const int precision, const int scale)
int db_value_equal (const DB_VALUE * value1, const DB_VALUE * value2)
void db_value_fprint (FILE * fp, const DB_VALUE * value)
int db_value_free (DB_VALUE * value)
double db_value_get_monetary_amount_as_double (const DB_VALUE * value)
DB_CURRENCY db_value_get_monetary_currency (const DB_VALUE * value)
bool db_value_is_corrupted (const DB_VALUE * value)
void db_value_print (const DB_VALUE * value)
int db_value_put (DB_VALUE * value, const DB_TYPE_C c_type, void * input, const int input_length)
int db_value_put_encoded_date (DB_VALUE * value, const DB_DATE * date_value)
int db_value_put_encoded_time (DB_VALUE * value, const DB_TIME * time_value)
int db_value_put_monetary_amount_as_double (DB_VALUE * value, const double amount)
int db_value_put_monetary_currency (DB_VALUE * value, const DB_CURRENCY type)
int db_value_put_null (DB_VALUE * value)
bool db_value_type_is_collection (const DB_VALUE * value)
void pr_share_value (DB_VALUE * src, DB_VALUE * dst)
DB_TYPE setobj_type (struct setobj * set)

Macros

Type Name
define DB_CURRENCY_DEFAULT [**db\_get\_currency\_default**](db__macro_8c.md#function-db_get_currency_default)()
define DB_GET_BIT_PRECISION (v) ((v)->domain.char\_info.length)
define DB_GET_COMPRESSED_STRING (v) (([**DB\_VALUE\_DOMAIN\_TYPE**](dbtype_8h.md#define-db_value_domain_type)(v) != DB\_TYPE\_VARCHAR) ? [**NULL**](freelistheap_8h.md#define-null) : (v)->data.ch.medium.compressed\_buf)
define DB_GET_ENUMERATION (v) ((v)->data.enumeration)
define DB_GET_ENUM_ELEM_CODESET (elem) ((elem)->str\_val.info.codeset)
define DB_GET_ENUM_ELEM_DBCHAR (elem) ((elem)->str\_val)
define DB_GET_ENUM_ELEM_SHORT (elem) ((elem)->short\_val)
define DB_GET_ENUM_ELEM_STRING (elem) ((elem)->str\_val.medium.buf)
define DB_GET_ENUM_ELEM_STRING_SIZE (elem) ((elem)->str\_val.medium.size)
define DB_GET_JSON_SCHEMA (v) ((v)->data.json.schema\_raw)
define DB_GET_NUMERIC_PRECISION (val) ((val)->domain.numeric\_info.precision)
define DB_GET_NUMERIC_SCALE (val) ((val)->domain.numeric\_info.scale)
define DB_GET_STRING_PRECISION (v) ((v)->domain.char\_info.length)
define DB_GET_STRING_SAFE (v) /* multi line expression */
define DB_IS_NULL (value) [**db\_value\_is\_null**](dbtype__function_8h.md#function-db_value_is_null)(value)
define DB_IS_STRING (value) /* multi line expression */
define DB_NEED_CLEAR (v) /* multi line expression */
define DB_SET_COMPRESSED_STRING (value, compressed_string, compressed_size, compressed_need_clear) [**db\_set\_compressed\_string**](dbtype__function_8h.md#function-db_set_compressed_string)(value, [**compressed\_string**](broker__monitor_8c.md#function-timeout), compressed\_size, compressed\_need\_clear)
define DB_SET_ENUM_ELEM_CODESET (elem, cs) ((elem)->str\_val.info.codeset = ([**cs**](broker__monitor_8c.md#function-timeout)))
define DB_SET_ENUM_ELEM_SHORT (elem, sv) ((elem)->short\_val = ([**sv**](broker__monitor_8c.md#function-timeout)))
define DB_SET_ENUM_ELEM_STRING (elem, str) /* multi line expression */
define DB_SET_ENUM_ELEM_STRING_SIZE (elem, sz) ((elem)->str\_val.medium.size = ([**sz**](broker__monitor_8c.md#function-timeout)))
define DB_TRIED_COMPRESSION (value) ([**db\_get\_compressed\_size**](dbtype__function_8h.md#function-db_get_compressed_size)(value) != [**DB\_NOT\_YET\_COMPRESSED**](dbtype__def_8h.md#define-db_not_yet_compressed))
define DB_VALUE_CLONE_AS_NULL (src_value, dest_value) /* multi line expression */
define DB_VALUE_DOMAIN_TYPE (value) [**db\_value\_domain\_type**](dbtype__function_8h.md#function-db_value_domain_type)(value)
define DB_VALUE_PRECISION (value) [**db\_value\_precision**](dbtype__function_8h.md#function-db_value_precision)(value)
define DB_VALUE_SCALE (value) [**db\_value\_scale**](dbtype__function_8h.md#function-db_value_scale)(value)
define DB_VALUE_TYPE (value) [**db\_value\_type**](dbtype__function_8h.md#function-db_value_type)(value)
define db_get_collection [**db\_get\_set**](dbtype__function_8h.md#function-db_get_set)
define db_get_json_schema (v) [**DB\_GET\_JSON\_SCHEMA**](dbtype_8h.md#define-db_get_json_schema)(v)
define db_get_utime [**db\_get\_timestamp**](dbtype__function_8h.md#function-db_get_timestamp)
define db_make_utime [**db\_make\_timestamp**](dbtype__function_8h.md#function-db_make_timestamp)

Public Functions Documentation

function db_convert_json_into_scalar

int db_convert_json_into_scalar (
    const  DB_VALUE * src,
    DB_VALUE * dest
) 

function db_date_decode

void db_date_decode (
    const  DB_DATE * date,
    int * monthp,
    int * dayp,
    int * yearp
) 

function db_date_encode

int db_date_encode (
    DB_DATE * date,
    int month,
    int day,
    int year
) 

function db_default_expression_string

const  char * db_default_expression_string (
    DB_DEFAULT_EXPR_TYPE default_expr_type
) 

function db_get_currency_default

DB_CURRENCY db_get_currency_default (
    void
) 

function db_get_deep_copy_of_json

int db_get_deep_copy_of_json (
    const  DB_JSON * src,
    DB_JSON * dst
) 

function db_get_json_raw_body

char * db_get_json_raw_body (
    const  DB_VALUE * value
) 

function db_init_db_json_pointers

int db_init_db_json_pointers (
    DB_JSON * val
) 

function db_is_json_doc_type

bool db_is_json_doc_type (
    DB_TYPE type
) 

function db_is_json_value_type

bool db_is_json_value_type (
    DB_TYPE type
) 

function db_json_val_from_str

int db_json_val_from_str (
    const  char * raw_str,
    const  int str_size,
    DB_VALUE * json_val
) 

function db_string_truncate

int db_string_truncate (
    DB_VALUE * value,
    const  int max_precision
) 

function db_time_decode

void db_time_decode (
    DB_TIME * timeval,
    int * hourp,
    int * minutep,
    int * secondp
) 

function db_time_encode

int db_time_encode (
    DB_TIME * timeval,
    int hour,
    int minute,
    int second
) 

function db_type_to_db_domain

DB_DOMAIN * db_type_to_db_domain (
    DB_TYPE type
) 

function db_value_alter_type

int db_value_alter_type (
    DB_VALUE * value,
    DB_TYPE type
) 

function db_value_clear

int db_value_clear (
    DB_VALUE * value
) 

function db_value_clear_array

int db_value_clear_array (
    DB_VALUE_ARRAY * value_array
) 

function db_value_clone

int db_value_clone (
    DB_VALUE * src,
    DB_VALUE * dest
) 

function db_value_coerce

int db_value_coerce (
    const  DB_VALUE * src,
    DB_VALUE * dest,
    const  DB_DOMAIN * desired_domain
) 

function db_value_compare

int db_value_compare (
    const  DB_VALUE * value1,
    const  DB_VALUE * value2
) 

function db_value_copy

DB_VALUE * db_value_copy (
    DB_VALUE * value
) 

function db_value_create

DB_VALUE * db_value_create (
    void
) 

function db_value_domain_default

int db_value_domain_default (
    DB_VALUE * value,
    const  DB_TYPE type,
    const  int precision,
    const  int scale,
    const  int codeset,
    const  int collation_id,
    DB_ENUMERATION * enumeration
) 

function db_value_domain_init

int db_value_domain_init (
    DB_VALUE * value,
    DB_TYPE type,
    const  int precision,
    const  int scale
) 

function db_value_domain_init_default

void db_value_domain_init_default (
    DB_VALUE * value,
    const  DB_TYPE type
) 

function db_value_domain_max

int db_value_domain_max (
    DB_VALUE * value,
    DB_TYPE type,
    const  int precision,
    const  int scale,
    const  int codeset,
    const  int collation_id,
    const  DB_ENUMERATION * enumeration
) 

function db_value_domain_min

int db_value_domain_min (
    DB_VALUE * value,
    DB_TYPE type,
    const  int precision,
    const  int scale,
    const  int codeset,
    const  int collation_id,
    const  DB_ENUMERATION * enumeration
) 

function db_value_domain_zero

int db_value_domain_zero (
    DB_VALUE * value,
    const  DB_TYPE type,
    const  int precision,
    const  int scale
) 

function db_value_equal

int db_value_equal (
    const  DB_VALUE * value1,
    const  DB_VALUE * value2
) 

function db_value_fprint

void db_value_fprint (
    FILE * fp,
    const  DB_VALUE * value
) 

function db_value_free

int db_value_free (
    DB_VALUE * value
) 

function db_value_get_monetary_amount_as_double

double db_value_get_monetary_amount_as_double (
    const  DB_VALUE * value
) 

function db_value_get_monetary_currency

DB_CURRENCY db_value_get_monetary_currency (
    const  DB_VALUE * value
) 

function db_value_is_corrupted

bool db_value_is_corrupted (
    const  DB_VALUE * value
) 

function db_value_print

void db_value_print (
    const  DB_VALUE * value
) 

function db_value_put

int db_value_put (
    DB_VALUE * value,
    const  DB_TYPE_C c_type,
    void * input,
    const  int input_length
) 

function db_value_put_encoded_date

int db_value_put_encoded_date (
    DB_VALUE * value,
    const  DB_DATE * date_value
) 

function db_value_put_encoded_time

int db_value_put_encoded_time (
    DB_VALUE * value,
    const  DB_TIME * time_value
) 

function db_value_put_monetary_amount_as_double

int db_value_put_monetary_amount_as_double (
    DB_VALUE * value,
    const  double amount
) 

function db_value_put_monetary_currency

int db_value_put_monetary_currency (
    DB_VALUE * value,
    const  DB_CURRENCY type
) 

function db_value_put_null

int db_value_put_null (
    DB_VALUE * value
) 

function db_value_type_is_collection

bool db_value_type_is_collection (
    const  DB_VALUE * value
) 

function pr_share_value

inline void pr_share_value (
    DB_VALUE * src,
    DB_VALUE * dst
) 

function setobj_type

DB_TYPE setobj_type (
    struct  setobj * set
) 

Macro Definition Documentation

define DB_CURRENCY_DEFAULT

#define DB_CURRENCY_DEFAULT `db_get_currency_default ()`

define DB_GET_BIT_PRECISION

#define DB_GET_BIT_PRECISION (
    v
) `((v)->domain.char_info.length)`

define DB_GET_COMPRESSED_STRING

#define DB_GET_COMPRESSED_STRING (
    v
) `(( DB_VALUE_DOMAIN_TYPE (v) != DB_TYPE_VARCHAR ) ? NULL : (v)->data.ch.medium.compressed_buf)`

define DB_GET_ENUMERATION

#define DB_GET_ENUMERATION (
    v
) `((v)->data.enumeration)`

define DB_GET_ENUM_ELEM_CODESET

#define DB_GET_ENUM_ELEM_CODESET (
    elem
) `((elem)->str_val.info.codeset)`

define DB_GET_ENUM_ELEM_DBCHAR

#define DB_GET_ENUM_ELEM_DBCHAR (
    elem
) `((elem)->str_val)`

define DB_GET_ENUM_ELEM_SHORT

#define DB_GET_ENUM_ELEM_SHORT (
    elem
) `((elem)->short_val)`

define DB_GET_ENUM_ELEM_STRING

#define DB_GET_ENUM_ELEM_STRING (
    elem
) `((elem)->str_val.medium.buf)`

define DB_GET_ENUM_ELEM_STRING_SIZE

#define DB_GET_ENUM_ELEM_STRING_SIZE (
    elem
) `((elem)->str_val.medium.size)`

define DB_GET_JSON_SCHEMA

#define DB_GET_JSON_SCHEMA (
    v
) `((v)->data.json.schema_raw)`

define DB_GET_NUMERIC_PRECISION

#define DB_GET_NUMERIC_PRECISION (
    val
) `((val)->domain.numeric_info.precision)`

define DB_GET_NUMERIC_SCALE

#define DB_GET_NUMERIC_SCALE (
    val
) `((val)->domain.numeric_info.scale)`

define DB_GET_STRING_PRECISION

#define DB_GET_STRING_PRECISION (
    v
) `((v)->domain.char_info.length)`

define DB_GET_STRING_SAFE

#define DB_GET_STRING_SAFE (
    v
) `/* multi line expression */`

define DB_IS_NULL

#define DB_IS_NULL (
    value
) `db_value_is_null (value)`

define DB_IS_STRING

#define DB_IS_STRING (
    value
) `( db_value_type (value) == DB_TYPE_VARCHAR || \ db_value_type (value) == DB_TYPE_CHAR )`

define DB_NEED_CLEAR

#define DB_NEED_CLEAR (
    v
) `/* multi line expression */`

define DB_SET_COMPRESSED_STRING

#define DB_SET_COMPRESSED_STRING (
    value,
    compressed_string,
    compressed_size,
    compressed_need_clear
) `db_set_compressed_string (value, compressed_string , compressed_size, compressed_need_clear)`

define DB_SET_ENUM_ELEM_CODESET

#define DB_SET_ENUM_ELEM_CODESET (
    elem,
    cs
) `((elem)->str_val.info.codeset = ( cs ))`

define DB_SET_ENUM_ELEM_SHORT

#define DB_SET_ENUM_ELEM_SHORT (
    elem,
    sv
) `((elem)->short_val = ( sv ))`

define DB_SET_ENUM_ELEM_STRING

#define DB_SET_ENUM_ELEM_STRING (
    elem,
    str
) `/* multi line expression */`

define DB_SET_ENUM_ELEM_STRING_SIZE

#define DB_SET_ENUM_ELEM_STRING_SIZE (
    elem,
    sz
) `((elem)->str_val.medium.size = ( sz ))`

define DB_TRIED_COMPRESSION

#define DB_TRIED_COMPRESSION (
    value
) `( db_get_compressed_size (value) != DB_NOT_YET_COMPRESSED )`

define DB_VALUE_CLONE_AS_NULL

#define DB_VALUE_CLONE_AS_NULL (
    src_value,
    dest_value
) `/* multi line expression */`

define DB_VALUE_DOMAIN_TYPE

#define DB_VALUE_DOMAIN_TYPE (
    value
) `db_value_domain_type (value)`

define DB_VALUE_PRECISION

#define DB_VALUE_PRECISION (
    value
) `db_value_precision (value)`

define DB_VALUE_SCALE

#define DB_VALUE_SCALE (
    value
) `db_value_scale (value)`

define DB_VALUE_TYPE

#define DB_VALUE_TYPE (
    value
) `db_value_type (value)`

define db_get_collection

#define db_get_collection `db_get_set`

define db_get_json_schema

#define db_get_json_schema (
    v
) `DB_GET_JSON_SCHEMA (v)`

define db_get_utime

#define db_get_utime `db_get_timestamp`

define db_make_utime

#define db_make_utime `db_make_timestamp`


The documentation for this class was generated from the following file cubrid/src/compat/dbtype.h