Skip to content

File string_opfunc.h

FileList > cubrid > src > query > string_opfunc.h

Go to the source code of this file

  • #include "config.h"
  • #include "dbtype_def.h"
  • #include "intl_support.h"
  • #include "language_support.h"
  • #include "numeric_opfunc.h"
  • #include "object_domain.h"
  • #include "thread_compat.hpp"
  • #include <functional>
  • #include "string_regex.hpp"

Public Types

Type Name
enum MISC_OPERAND
enum TIMESTAMP_FORMAT

Public Functions

Type Name
int bit_compare (const unsigned char * string1, int size1, const unsigned char * string2, int size2)
int char_compare (const unsigned char * string1, int size1, const unsigned char * string2, int size2)
int count_leap_years_up_to (int year)
int count_nonleap_years_up_to (int year)
int db_add_days_to_year (const DB_VALUE * src_year, const DB_VALUE * src_days, DB_VALUE * result)
int db_add_months (const DB_VALUE * src_date, const DB_VALUE * nmonth, DB_VALUE * result_date)
int db_add_time (const DB_VALUE * left, const DB_VALUE * right, DB_VALUE * result, const TP_DOMAIN * domain)
int db_ascii (const DB_VALUE * param, DB_VALUE * result)
int db_bigint_to_binary_string (const DB_VALUE * src_bigint, DB_VALUE * result)
int db_bit_string_coerce (const DB_VALUE * src_string, DB_VALUE * dest_string, DB_DATA_STATUS * data_status)
int db_bit_to_blob (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_blob_from_file (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_blob_length (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_blob_to_bit (const DB_VALUE * src_value, const DB_VALUE * length_value, DB_VALUE * result_value)
int db_char_string_coerce (const DB_VALUE * src_string, DB_VALUE * dest_string, DB_DATA_STATUS * data_status)
int db_char_to_blob (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_char_to_clob (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_clob_from_file (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_clob_length (const DB_VALUE * src_value, DB_VALUE * result_value)
int db_clob_to_char (const DB_VALUE * src_value, const DB_VALUE * codeset_value, DB_VALUE * result_value)
int db_compress_like_pattern (const DB_VALUE *const pattern, DB_VALUE * compressed_pattern, const bool has_escape_char, const char * escape_str)
int db_conv (const DB_VALUE * num, const DB_VALUE * from_base, const DB_VALUE * to_base, DB_VALUE * result)
int db_conv_tz (DB_VALUE * time_val, DB_VALUE * result_time)
int db_convert_sec_to_time (const DB_VALUE * src, DB_VALUE * result)
int db_convert_time_to_sec (const DB_VALUE * src_date, DB_VALUE * result)
int db_convert_to_time (const DB_VALUE * src_hour, const DB_VALUE * src_minute, const DB_VALUE * src_second, DB_VALUE * result)
int db_date_add_interval_days (DB_VALUE * result, const DB_VALUE * date, const DB_VALUE * days)
int db_date_add_interval_expr (DB_VALUE * result, const DB_VALUE * date, const DB_VALUE * expr, const int unit)
int db_date_dbval (DB_VALUE * result, const DB_VALUE * date_value, const TP_DOMAIN * domain)
int db_date_diff (const DB_VALUE * date_value1, const DB_VALUE * date_value2, DB_VALUE * result)
int db_date_format (const DB_VALUE * date_value, const DB_VALUE * format, const DB_VALUE * date_lang, DB_VALUE * result, const TP_DOMAIN * domain)
int db_date_sub_interval_days (DB_VALUE * result, const DB_VALUE * date, const DB_VALUE * days)
int db_date_sub_interval_expr (DB_VALUE * result, const DB_VALUE * date, const DB_VALUE * expr, const int unit)
int db_datetime_to_timestamp (const DB_VALUE * src_datetime, DB_VALUE * result_timestamp)
int db_find_string_in_in_set (const DB_VALUE * needle, const DB_VALUE * stack, DB_VALUE * result)
int db_format (const DB_VALUE * number_text, const DB_VALUE * decimals, const DB_VALUE * number_lang, DB_VALUE * result, const TP_DOMAIN * domain)
int db_from_tz (DB_VALUE * time_val, DB_VALUE * tz, DB_VALUE * time_val_with_tz)
int db_from_unixtime (const DB_VALUE * src_date, const DB_VALUE * format, const DB_VALUE * date_lang, DB_VALUE * result, const TP_DOMAIN * domain)
int db_get_cs_coll_info (DB_VALUE * result, const DB_VALUE * val, const int mode)
int db_get_date_dayofyear (const DB_VALUE * src_date, DB_VALUE * result)
int db_get_date_format (const DB_VALUE * format_str, TIMESTAMP_FORMAT * format)
int db_get_date_from_days (const DB_VALUE * src, DB_VALUE * result)
int db_get_date_quarter (const DB_VALUE * src_date, DB_VALUE * result)
int db_get_date_totaldays (const DB_VALUE * src_date, DB_VALUE * result)
int db_get_date_week (const DB_VALUE * src_date, const DB_VALUE * mode, DB_VALUE * result)
int db_get_datetime_from_dbvalue (const DB_VALUE * src_date, int * year, int * month, int * day, int * hour, int * minute, int * second, int * millisecond, const char ** endp)
int db_get_info_for_like_optimization (const DB_VALUE *const pattern, const bool has_escape_char, const char * escape_str, int *const num_logical_chars, int *const last_safe_logical_pos, int *const num_match_many, int *const num_match_one)
int db_get_like_optimization_bounds (const DB_VALUE *const pattern, DB_VALUE * bound, const bool has_escape_char, const char * escape_str, const bool compute_lower_bound, const int last_safe_logical_pos)
int db_get_string_length (const DB_VALUE * value)
int db_get_time_from_dbvalue (const DB_VALUE * src_date, int * hour, int * minute, int * second, int * millisecond)
int db_hex (const DB_VALUE * param, DB_VALUE * result)
int db_inet_aton (DB_VALUE * result_numbered_ip, const DB_VALUE * string)
int db_inet_ntoa (DB_VALUE * result_ip_string, const DB_VALUE * number)
int db_json_convert_to_utf8 (DB_VALUE * dbval)
int db_json_copy_and_convert_to_utf8 (const DB_VALUE * src_dbval, DB_VALUE * dest_dbval, const DB_VALUE ** json_str_dbval)
int db_last_day (const DB_VALUE * src_date, DB_VALUE * result_day)
int db_like_bound (const DB_VALUE *const src_pattern, const DB_VALUE *const src_escape, DB_VALUE *const result_bound, const bool compute_lower_bound)
int db_months_between (const DB_VALUE * start_mon, const DB_VALUE * end_mon, DB_VALUE * result_mon)
int db_new_time (DB_VALUE * time_val, DB_VALUE * tz_source, DB_VALUE * tz_dest, DB_VALUE * result_time)
int db_null_terminate_string (const DB_VALUE * src_value, char ** strp)
int db_str_to_date (const DB_VALUE * src_date, const DB_VALUE * src_format, const DB_VALUE * date_lang, DB_VALUE * result_date, TP_DOMAIN * domain)
int db_string_aes_decrypt (DB_VALUE const * src, DB_VALUE const * key, DB_VALUE * result)
int db_string_aes_encrypt (DB_VALUE const * src, DB_VALUE const * key, DB_VALUE * result)
int db_string_bit_length (const DB_VALUE * string, DB_VALUE * bit_count)
int db_string_byte_length (const DB_VALUE * string, DB_VALUE * byte_count)
int db_string_char_length (const DB_VALUE * string, DB_VALUE * char_count)
int db_string_chr (DB_VALUE * res, DB_VALUE * dbval1, DB_VALUE * dbval2)
int db_string_compare (const DB_VALUE * string1, const DB_VALUE * string2, DB_VALUE * result)
int db_string_concatenate (const DB_VALUE * string1, const DB_VALUE * string2, DB_VALUE * result, DB_DATA_STATUS * data_status)
int db_string_convert_to (const DB_VALUE * src_string, DB_VALUE * dest_string, INTL_CODESET dest_codeset, int dest_col)
int db_string_elt (DB_VALUE * result, DB_VALUE * args, int const num_args)
int db_string_escape_str (const char * src_str, size_t src_size, char ** res_string, size_t * dest_size)
int db_string_extract_dbval (const MISC_OPERAND extr_operand, DB_VALUE * dbval_p, DB_VALUE * result_p, TP_DOMAIN * domain_p)
int db_string_fix_string_size (DB_VALUE * src_string)
int db_string_from_base64 (DB_VALUE const * val, DB_VALUE * result)
int db_string_index_prefix (const DB_VALUE * string1, const DB_VALUE * string2, const DB_VALUE * index_type, DB_VALUE * prefix_index)
int db_string_insert_substring (DB_VALUE * src_string, const DB_VALUE * position, const DB_VALUE * length, DB_VALUE * sub_string, DB_VALUE * result)
int db_string_instr (const DB_VALUE * src_string, const DB_VALUE * sub_string, const DB_VALUE * start_pos, DB_VALUE * result)
int db_string_like (const DB_VALUE * src_string, const DB_VALUE * pattern, const DB_VALUE * esc_char, int * result)
int db_string_limit_size_string (DB_VALUE * src_string, DB_VALUE * result, const int new_size, int * spare_bytes)
int db_string_lower (const DB_VALUE * string, DB_VALUE * lower_string)
int db_string_make_empty_typed_string (DB_VALUE * db_val, const DB_TYPE db_type, int precision, int codeset, int collation_id)
int db_string_md5 (DB_VALUE const * val, DB_VALUE * result)
int db_string_pad (const MISC_OPERAND pad_operand, const DB_VALUE * src_string, const DB_VALUE * pad_length, const DB_VALUE * pad_charset, DB_VALUE * padded_string)
int db_string_position (const DB_VALUE * sub_string, const DB_VALUE * src_string, DB_VALUE * result)
int db_string_quote (const DB_VALUE * src_string, DB_VALUE * res)
int db_string_regexp_count (DB_VALUE * result, DB_VALUE * args, const int num_args, cub_compiled_regex ** comp_regex)
int db_string_regexp_instr (DB_VALUE * result, DB_VALUE * args, const int num_args, cub_compiled_regex ** comp_regex)
int db_string_regexp_like (DB_VALUE * result, DB_VALUE * args, const int num_args, cub_compiled_regex ** comp_regex)
int db_string_regexp_replace (DB_VALUE * result, DB_VALUE * args, const int num_args, cub_compiled_regex ** comp_regex)
int db_string_regexp_substr (DB_VALUE * result, DB_VALUE * args, const int num_args, cub_compiled_regex ** comp_regex)
int db_string_repeat (const DB_VALUE * src_string, const DB_VALUE * count, DB_VALUE * result)
int db_string_replace (const DB_VALUE * src_string, const DB_VALUE * srch_string, const DB_VALUE * repl_string, DB_VALUE * replaced_string)
int db_string_reverse (const DB_VALUE * src_str, DB_VALUE * result_str)
int db_string_rlike (const DB_VALUE * src_string, const DB_VALUE * pattern, const DB_VALUE * case_sensitive, cub_compiled_regex ** comp_regex, int * result)
int db_string_sha_one (DB_VALUE const * val, DB_VALUE * result)
int db_string_sha_two (DB_VALUE const * src, DB_VALUE const * len, DB_VALUE * result)
int db_string_space (DB_VALUE const * count, DB_VALUE * result)
int db_string_substring (const MISC_OPERAND substr_operand, const DB_VALUE * src_string, const DB_VALUE * start_position, const DB_VALUE * extraction_length, DB_VALUE * sub_string)
int db_string_substring_index (DB_VALUE * src_string, DB_VALUE * delim_string, const DB_VALUE * count, DB_VALUE * result)
int db_string_to_base64 (DB_VALUE const * val, DB_VALUE * result)
int db_string_translate (const DB_VALUE * src_string, const DB_VALUE * from_string, const DB_VALUE * to_string, DB_VALUE * transed_string)
int db_string_trim (const MISC_OPERAND tr_operand, const DB_VALUE * trim_charset, const DB_VALUE * src_string, DB_VALUE * trimmed_string)
int db_string_unique_prefix (const DB_VALUE * db_string1, const DB_VALUE * db_string2, DB_VALUE * db_result, TP_DOMAIN * key_domain)
int db_string_upper (const DB_VALUE * string, DB_VALUE * upper_string)
int db_sys_date (DB_VALUE * result_date)
int db_sys_date_and_epoch_time (DB_VALUE * dt_dbval, DB_VALUE * ts_dbval)
int db_sys_datetime (DB_VALUE * result_datetime)
int db_sys_time (DB_VALUE * result_time)
int db_sys_timestamp (DB_VALUE * result_timestamp)
int db_sys_timezone (DB_VALUE * result_timezone)
int db_time_dbval (DB_VALUE * result, const DB_VALUE * datetime_value, const TP_DOMAIN * domain)
int db_time_diff (const DB_VALUE * datetime_value1, const DB_VALUE * datetime_value2, DB_VALUE * result)
int db_time_format (const DB_VALUE * src_time, const DB_VALUE * src_format, const DB_VALUE * date_lang, DB_VALUE * result_time, const TP_DOMAIN * domain)
int db_timestamp (const DB_VALUE * src_datetime1, const DB_VALUE * src_time2, DB_VALUE * result_datetime)
int db_timestamp_to_datetime (const DB_VALUE * src_timestamp, DB_VALUE * result_datetime)
int db_to_char (const DB_VALUE * src_value, const DB_VALUE * format_or_length, const DB_VALUE * lang_str, DB_VALUE * result_str, const TP_DOMAIN * domain)
int db_to_date (const DB_VALUE * src_str, const DB_VALUE * format_str, const DB_VALUE * date_lang, DB_VALUE * result_date)
int db_to_datetime (const DB_VALUE * src_str, const DB_VALUE * format_str, const DB_VALUE * date_lang, const DB_TYPE type, DB_VALUE * result_datetime)
int db_to_number (const DB_VALUE * src_str, const DB_VALUE * format_str, const DB_VALUE * number_lang, DB_VALUE * result_num)
int db_to_time (const DB_VALUE * src_str, const DB_VALUE * format_str, const DB_VALUE * date_lang, const DB_TYPE type, DB_VALUE * result_time)
int db_to_timestamp (const DB_VALUE * src_str, const DB_VALUE * format_str, const DB_VALUE * date_lang, const DB_TYPE type, DB_VALUE * result_timestamp)
int db_tz_offset (const DB_VALUE * src_str, DB_VALUE * result_str, DB_DATETIME * date_time)
int db_unix_timestamp (const DB_VALUE * src_date, DB_VALUE * result_timestamp)
int db_value_to_enumeration_value (const DB_VALUE * src, DB_VALUE * result, const TP_DOMAIN * enum_domain)
int get_day (int month, int day, int year)
int get_last_day (int month, int year)
void init_builtin_calendar_names (LANG_LOCALE_DATA * lld)
int qstr_bin_to_hex (char * dest, int dest_size, const char * src, int src_size)
int qstr_bit_to_bin (char * dest, int dest_size, const char * src, int src_size)
void qstr_bit_to_hex_coerce (char * buffer, int buffer_size, const char * src, int src_length, int pad_flag, int * copy_size, int * truncation)
int qstr_compare (const unsigned char * string1, int size1, const unsigned char * string2, int size2)
int qstr_hex_to_bin (char * dest, int dest_size, const char * src, int src_size)
void qstr_make_typed_string (const DB_TYPE db_type, DB_VALUE * value, const int precision, DB_CONST_C_CHAR src, const int s_unit, const int codeset, const int collation_id)
unsigned char * qstr_pad_string (unsigned char * s, int length, INTL_CODESET codeset)
void qstr_trim_trailing (const unsigned char * trim_charset_ptr, int trim_charset_size, const unsigned char * src_ptr, DB_TYPE src_type, int src_length, int src_size, INTL_CODESET codeset, int * trail_trimmed_length, int * trail_trimmed_size, bool skip_spaces)
int varbit_compare (const unsigned char * string1, int size1, const unsigned char * string2, int size2)

Macros

Type Name
define DATETIMETZ_BUF_SIZE ([**DATETIME\_BUF\_SIZE**](string__opfunc_8h.md#define-datetime_buf_size) + [**TIMEZONE\_BUF\_SIZE**](string__opfunc_8h.md#define-timezone_buf_size))
define DATETIME_BUF_SIZE ([**TIMESTAMP\_BUF\_SIZE**](string__opfunc_8h.md#define-timestamp_buf_size) + 4)
define DATETIME_IS_NULL (dt) (([**dt**](broker__monitor_8c.md#function-timeout))-&gt;date == [**UINT\_MAX**](broker__monitor_8c.md#function-timeout) && ([**dt**](broker__monitor_8c.md#function-timeout))-&gt;time == [**UINT\_MAX**](broker__monitor_8c.md#function-timeout))
define DATETIME_NULL_VALUE { [**UINT\_MAX**](broker__monitor_8c.md#function-timeout), [**UINT\_MAX**](broker__monitor_8c.md#function-timeout) }
define DATE_BUF_SIZE 64
define LIKE_WILDCARD_MATCH_MANY '%'
define LIKE_WILDCARD_MATCH_ONE '[**\_**](broker__monitor_8c.md#function-timeout)'
define NUM_BUF_SIZE 64
define NUM_MISC_OPERANDS 12
define QSTR_CHAR_COMPARE (id, string1, size1, string2, size2, ti) [**QSTR\_COMPARE**](string__opfunc_8h.md#define-qstr_compare)([**id**](thread__worker__pool__impl_8hpp.md#enum-id), [**string1**](broker__monitor_8c.md#function-timeout), [**size1**](broker__monitor_8c.md#function-timeout), [**string2**](broker__monitor_8c.md#function-timeout), [**size2**](broker__monitor_8c.md#function-timeout), [**ti**](broker__monitor_8c.md#function-timeout))
define QSTR_COMPARE (id, string1, size1, string2, size2, ti) /* multi line expression */
define QSTR_DATETIME_LENGTH 26
define QSTR_IS_ANY_CHAR (s) ([**QSTR\_IS\_CHAR**](string__opfunc_8h.md#define-qstr_is_char)(s))
define QSTR_IS_ANY_CHAR_OR_BIT (s) ([**QSTR\_IS\_ANY\_CHAR**](string__opfunc_8h.md#define-qstr_is_any_char)(s) \|\| [**QSTR\_IS\_BIT**](string__opfunc_8h.md#define-qstr_is_bit)(s))
define QSTR_IS_BIT (s) (((s) == DB\_TYPE\_BIT) \|\| ((s) == DB\_TYPE\_VARBIT))
define QSTR_IS_CHAR (s) (((s) == DB\_TYPE\_CHAR) \|\| ((s) == DB\_TYPE\_VARCHAR))
define QSTR_IS_FIXED_LENGTH (s) (((s) == DB\_TYPE\_CHAR) \|\| ((s) == DB\_TYPE\_BIT))
define QSTR_IS_LIKE_WILDCARD_CHAR (ch) /* multi line expression */
define QSTR_IS_VARIABLE_LENGTH (s) (((s) == DB\_TYPE\_VARCHAR) \|\| ((s) == DB\_TYPE\_VARBIT))
define QSTR_MATCH (id, string1, size1, string2, size2, esc, has_last_escape, match_size) /* multi line expression */
define QSTR_NEXT_ALPHA_CHAR (id, cur_chr, size, next_chr, len) /* multi line expression */
define QSTR_NUM_BYTES (a) ((([**a**](broker__monitor_8c.md#function-timeout)) + 7) / 8)
define QSTR_SPLIT_KEY (id, is_desc, str1, size1, str2, size2, k, s, ti) /* multi line expression */
define TIMESTAMPTZ_BUF_SIZE ([**TIMESTAMP\_BUF\_SIZE**](string__opfunc_8h.md#define-timestamp_buf_size) + [**TIMEZONE\_BUF\_SIZE**](string__opfunc_8h.md#define-timezone_buf_size))
define TIMESTAMP_BUF_SIZE ([**TIME\_BUF\_SIZE**](broker__tester_8c.md#define-time_buf_size) + [**DATE\_BUF\_SIZE**](string__opfunc_8h.md#define-date_buf_size))
define TIMEZONE_BUF_SIZE 64
define TIME_BUF_SIZE 64

Public Types Documentation

enum MISC_OPERAND

enum MISC_OPERAND {
    LEADING,
    TRAILING,
    BOTH,
    YEAR,
    MONTH,
    DAY,
    HOUR,
    MINUTE,
    SECOND,
    MILLISECOND,
    SUBSTRING,
    SUBSTR
};

enum TIMESTAMP_FORMAT

enum TIMESTAMP_FORMAT {
    DT_END = -2,
    DT_INVALID = -1,
    DT_NORMAL,
    DT_YYYY,
    DT_YY,
    DT_MM,
    DT_MONTH,
    DT_MON,
    DT_DD,
    DT_CC,
    DT_Q,
    DT_DAY,
    DT_DY,
    DT_AM,
    DT_A_M,
    DT_PM,
    DT_P_M,
    DT_HH,
    DT_H,
    DT_HH12,
    DT_HH24,
    DT_MI,
    DT_SS,
    DT_MS,
    DT_TEXT,
    DT_PUNCTUATION,
    DT_D,
    DT_TZR,
    DT_TZD,
    DT_TZH,
    DT_TZM
};

Public Functions Documentation

function bit_compare

int bit_compare (
    const  unsigned  char * string1,
    int size1,
    const  unsigned  char * string2,
    int size2
) 

function char_compare

int char_compare (
    const  unsigned  char * string1,
    int size1,
    const  unsigned  char * string2,
    int size2
) 

function count_leap_years_up_to

int count_leap_years_up_to (
    int year
) 

function count_nonleap_years_up_to

int count_nonleap_years_up_to (
    int year
) 

function db_add_days_to_year

int db_add_days_to_year (
    const  DB_VALUE * src_year,
    const  DB_VALUE * src_days,
    DB_VALUE * result
) 

function db_add_months

int db_add_months (
    const  DB_VALUE * src_date,
    const  DB_VALUE * nmonth,
    DB_VALUE * result_date
) 

function db_add_time

int db_add_time (
    const  DB_VALUE * left,
    const  DB_VALUE * right,
    DB_VALUE * result,
    const  TP_DOMAIN * domain
) 

function db_ascii

int db_ascii (
    const  DB_VALUE * param,
    DB_VALUE * result
) 

function db_bigint_to_binary_string

int db_bigint_to_binary_string (
    const  DB_VALUE * src_bigint,
    DB_VALUE * result
) 

function db_bit_string_coerce

int db_bit_string_coerce (
    const  DB_VALUE * src_string,
    DB_VALUE * dest_string,
    DB_DATA_STATUS * data_status
) 

function db_bit_to_blob

int db_bit_to_blob (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_blob_from_file

int db_blob_from_file (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_blob_length

int db_blob_length (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_blob_to_bit

int db_blob_to_bit (
    const  DB_VALUE * src_value,
    const  DB_VALUE * length_value,
    DB_VALUE * result_value
) 

function db_char_string_coerce

int db_char_string_coerce (
    const  DB_VALUE * src_string,
    DB_VALUE * dest_string,
    DB_DATA_STATUS * data_status
) 

function db_char_to_blob

int db_char_to_blob (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_char_to_clob

int db_char_to_clob (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_clob_from_file

int db_clob_from_file (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_clob_length

int db_clob_length (
    const  DB_VALUE * src_value,
    DB_VALUE * result_value
) 

function db_clob_to_char

int db_clob_to_char (
    const  DB_VALUE * src_value,
    const  DB_VALUE * codeset_value,
    DB_VALUE * result_value
) 

function db_compress_like_pattern

int db_compress_like_pattern (
    const  DB_VALUE * const pattern,
    DB_VALUE * compressed_pattern,
    const  bool has_escape_char,
    const  char * escape_str
) 

function db_conv

int db_conv (
    const  DB_VALUE * num,
    const  DB_VALUE * from_base,
    const  DB_VALUE * to_base,
    DB_VALUE * result
) 

function db_conv_tz

int db_conv_tz (
    DB_VALUE * time_val,
    DB_VALUE * result_time
) 

function db_convert_sec_to_time

int db_convert_sec_to_time (
    const  DB_VALUE * src,
    DB_VALUE * result
) 

function db_convert_time_to_sec

int db_convert_time_to_sec (
    const  DB_VALUE * src_date,
    DB_VALUE * result
) 

function db_convert_to_time

int db_convert_to_time (
    const  DB_VALUE * src_hour,
    const  DB_VALUE * src_minute,
    const  DB_VALUE * src_second,
    DB_VALUE * result
) 

function db_date_add_interval_days

int db_date_add_interval_days (
    DB_VALUE * result,
    const  DB_VALUE * date,
    const  DB_VALUE * days
) 

function db_date_add_interval_expr

int db_date_add_interval_expr (
    DB_VALUE * result,
    const  DB_VALUE * date,
    const  DB_VALUE * expr,
    const  int unit
) 

function db_date_dbval

int db_date_dbval (
    DB_VALUE * result,
    const  DB_VALUE * date_value,
    const  TP_DOMAIN * domain
) 

function db_date_diff

int db_date_diff (
    const  DB_VALUE * date_value1,
    const  DB_VALUE * date_value2,
    DB_VALUE * result
) 

function db_date_format

int db_date_format (
    const  DB_VALUE * date_value,
    const  DB_VALUE * format,
    const  DB_VALUE * date_lang,
    DB_VALUE * result,
    const  TP_DOMAIN * domain
) 

function db_date_sub_interval_days

int db_date_sub_interval_days (
    DB_VALUE * result,
    const  DB_VALUE * date,
    const  DB_VALUE * days
) 

function db_date_sub_interval_expr

int db_date_sub_interval_expr (
    DB_VALUE * result,
    const  DB_VALUE * date,
    const  DB_VALUE * expr,
    const  int unit
) 

function db_datetime_to_timestamp

int db_datetime_to_timestamp (
    const  DB_VALUE * src_datetime,
    DB_VALUE * result_timestamp
) 

function db_find_string_in_in_set

int db_find_string_in_in_set (
    const  DB_VALUE * needle,
    const  DB_VALUE * stack,
    DB_VALUE * result
) 

function db_format

int db_format (
    const  DB_VALUE * number_text,
    const  DB_VALUE * decimals,
    const  DB_VALUE * number_lang,
    DB_VALUE * result,
    const  TP_DOMAIN * domain
) 

function db_from_tz

int db_from_tz (
    DB_VALUE * time_val,
    DB_VALUE * tz,
    DB_VALUE * time_val_with_tz
) 

function db_from_unixtime

int db_from_unixtime (
    const  DB_VALUE * src_date,
    const  DB_VALUE * format,
    const  DB_VALUE * date_lang,
    DB_VALUE * result,
    const  TP_DOMAIN * domain
) 

function db_get_cs_coll_info

int db_get_cs_coll_info (
    DB_VALUE * result,
    const  DB_VALUE * val,
    const  int mode
) 

function db_get_date_dayofyear

int db_get_date_dayofyear (
    const  DB_VALUE * src_date,
    DB_VALUE * result
) 

function db_get_date_format

int db_get_date_format (
    const  DB_VALUE * format_str,
    TIMESTAMP_FORMAT * format
) 

function db_get_date_from_days

int db_get_date_from_days (
    const  DB_VALUE * src,
    DB_VALUE * result
) 

function db_get_date_quarter

int db_get_date_quarter (
    const  DB_VALUE * src_date,
    DB_VALUE * result
) 

function db_get_date_totaldays

int db_get_date_totaldays (
    const  DB_VALUE * src_date,
    DB_VALUE * result
) 

function db_get_date_week

int db_get_date_week (
    const  DB_VALUE * src_date,
    const  DB_VALUE * mode,
    DB_VALUE * result
) 

function db_get_datetime_from_dbvalue

int db_get_datetime_from_dbvalue (
    const  DB_VALUE * src_date,
    int * year,
    int * month,
    int * day,
    int * hour,
    int * minute,
    int * second,
    int * millisecond,
    const  char ** endp
) 

function db_get_info_for_like_optimization

int db_get_info_for_like_optimization (
    const  DB_VALUE * const pattern,
    const  bool has_escape_char,
    const  char * escape_str,
    int * const num_logical_chars,
    int * const last_safe_logical_pos,
    int * const num_match_many,
    int * const num_match_one
) 

function db_get_like_optimization_bounds

int db_get_like_optimization_bounds (
    const  DB_VALUE * const pattern,
    DB_VALUE * bound,
    const  bool has_escape_char,
    const  char * escape_str,
    const  bool compute_lower_bound,
    const  int last_safe_logical_pos
) 

function db_get_string_length

int db_get_string_length (
    const  DB_VALUE * value
) 

function db_get_time_from_dbvalue

int db_get_time_from_dbvalue (
    const  DB_VALUE * src_date,
    int * hour,
    int * minute,
    int * second,
    int * millisecond
) 

function db_hex

int db_hex (
    const  DB_VALUE * param,
    DB_VALUE * result
) 

function db_inet_aton

int db_inet_aton (
    DB_VALUE * result_numbered_ip,
    const  DB_VALUE * string
) 

function db_inet_ntoa

int db_inet_ntoa (
    DB_VALUE * result_ip_string,
    const  DB_VALUE * number
) 

function db_json_convert_to_utf8

int db_json_convert_to_utf8 (
    DB_VALUE * dbval
) 

function db_json_copy_and_convert_to_utf8

int db_json_copy_and_convert_to_utf8 (
    const  DB_VALUE * src_dbval,
    DB_VALUE * dest_dbval,
    const  DB_VALUE ** json_str_dbval
) 

function db_last_day

int db_last_day (
    const  DB_VALUE * src_date,
    DB_VALUE * result_day
) 

function db_like_bound

int db_like_bound (
    const  DB_VALUE * const src_pattern,
    const  DB_VALUE * const src_escape,
    DB_VALUE * const result_bound,
    const  bool compute_lower_bound
) 

function db_months_between

int db_months_between (
    const  DB_VALUE * start_mon,
    const  DB_VALUE * end_mon,
    DB_VALUE * result_mon
) 

function db_new_time

int db_new_time (
    DB_VALUE * time_val,
    DB_VALUE * tz_source,
    DB_VALUE * tz_dest,
    DB_VALUE * result_time
) 

function db_null_terminate_string

int db_null_terminate_string (
    const  DB_VALUE * src_value,
    char ** strp
) 

function db_str_to_date

int db_str_to_date (
    const  DB_VALUE * src_date,
    const  DB_VALUE * src_format,
    const  DB_VALUE * date_lang,
    DB_VALUE * result_date,
    TP_DOMAIN * domain
) 

function db_string_aes_decrypt

int db_string_aes_decrypt (
    DB_VALUE  const * src,
    DB_VALUE  const * key,
    DB_VALUE * result
) 

function db_string_aes_encrypt

int db_string_aes_encrypt (
    DB_VALUE  const * src,
    DB_VALUE  const * key,
    DB_VALUE * result
) 

function db_string_bit_length

int db_string_bit_length (
    const  DB_VALUE * string,
    DB_VALUE * bit_count
) 

function db_string_byte_length

int db_string_byte_length (
    const  DB_VALUE * string,
    DB_VALUE * byte_count
) 

function db_string_char_length

int db_string_char_length (
    const  DB_VALUE * string,
    DB_VALUE * char_count
) 

function db_string_chr

int db_string_chr (
    DB_VALUE * res,
    DB_VALUE * dbval1,
    DB_VALUE * dbval2
) 

function db_string_compare

int db_string_compare (
    const  DB_VALUE * string1,
    const  DB_VALUE * string2,
    DB_VALUE * result
) 

function db_string_concatenate

int db_string_concatenate (
    const  DB_VALUE * string1,
    const  DB_VALUE * string2,
    DB_VALUE * result,
    DB_DATA_STATUS * data_status
) 

function db_string_convert_to

int db_string_convert_to (
    const  DB_VALUE * src_string,
    DB_VALUE * dest_string,
    INTL_CODESET dest_codeset,
    int dest_col
) 

function db_string_elt

int db_string_elt (
    DB_VALUE * result,
    DB_VALUE * args,
    int  const num_args
) 

function db_string_escape_str

int db_string_escape_str (
    const  char * src_str,
    size_t src_size,
    char ** res_string,
    size_t * dest_size
) 

function db_string_extract_dbval

int db_string_extract_dbval (
    const  MISC_OPERAND extr_operand,
    DB_VALUE * dbval_p,
    DB_VALUE * result_p,
    TP_DOMAIN * domain_p
) 

function db_string_fix_string_size

int db_string_fix_string_size (
    DB_VALUE * src_string
) 

function db_string_from_base64

int db_string_from_base64 (
    DB_VALUE  const * val,
    DB_VALUE * result
) 

function db_string_index_prefix

int db_string_index_prefix (
    const  DB_VALUE * string1,
    const  DB_VALUE * string2,
    const  DB_VALUE * index_type,
    DB_VALUE * prefix_index
) 

function db_string_insert_substring

int db_string_insert_substring (
    DB_VALUE * src_string,
    const  DB_VALUE * position,
    const  DB_VALUE * length,
    DB_VALUE * sub_string,
    DB_VALUE * result
) 

function db_string_instr

int db_string_instr (
    const  DB_VALUE * src_string,
    const  DB_VALUE * sub_string,
    const  DB_VALUE * start_pos,
    DB_VALUE * result
) 

function db_string_like

int db_string_like (
    const  DB_VALUE * src_string,
    const  DB_VALUE * pattern,
    const  DB_VALUE * esc_char,
    int * result
) 

function db_string_limit_size_string

int db_string_limit_size_string (
    DB_VALUE * src_string,
    DB_VALUE * result,
    const  int new_size,
    int * spare_bytes
) 

function db_string_lower

int db_string_lower (
    const  DB_VALUE * string,
    DB_VALUE * lower_string
) 

function db_string_make_empty_typed_string

int db_string_make_empty_typed_string (
    DB_VALUE * db_val,
    const  DB_TYPE db_type,
    int precision,
    int codeset,
    int collation_id
) 

function db_string_md5

int db_string_md5 (
    DB_VALUE  const * val,
    DB_VALUE * result
) 

function db_string_pad

int db_string_pad (
    const  MISC_OPERAND pad_operand,
    const  DB_VALUE * src_string,
    const  DB_VALUE * pad_length,
    const  DB_VALUE * pad_charset,
    DB_VALUE * padded_string
) 

function db_string_position

int db_string_position (
    const  DB_VALUE * sub_string,
    const  DB_VALUE * src_string,
    DB_VALUE * result
) 

function db_string_quote

int db_string_quote (
    const  DB_VALUE * src_string,
    DB_VALUE * res
) 

function db_string_regexp_count

int db_string_regexp_count (
    DB_VALUE * result,
    DB_VALUE * args,
    const  int num_args,
    cub_compiled_regex ** comp_regex
) 

function db_string_regexp_instr

int db_string_regexp_instr (
    DB_VALUE * result,
    DB_VALUE * args,
    const  int num_args,
    cub_compiled_regex ** comp_regex
) 

function db_string_regexp_like

int db_string_regexp_like (
    DB_VALUE * result,
    DB_VALUE * args,
    const  int num_args,
    cub_compiled_regex ** comp_regex
) 

function db_string_regexp_replace

int db_string_regexp_replace (
    DB_VALUE * result,
    DB_VALUE * args,
    const  int num_args,
    cub_compiled_regex ** comp_regex
) 

function db_string_regexp_substr

int db_string_regexp_substr (
    DB_VALUE * result,
    DB_VALUE * args,
    const  int num_args,
    cub_compiled_regex ** comp_regex
) 

function db_string_repeat

int db_string_repeat (
    const  DB_VALUE * src_string,
    const  DB_VALUE * count,
    DB_VALUE * result
) 

function db_string_replace

int db_string_replace (
    const  DB_VALUE * src_string,
    const  DB_VALUE * srch_string,
    const  DB_VALUE * repl_string,
    DB_VALUE * replaced_string
) 

function db_string_reverse

int db_string_reverse (
    const  DB_VALUE * src_str,
    DB_VALUE * result_str
) 

function db_string_rlike

int db_string_rlike (
    const  DB_VALUE * src_string,
    const  DB_VALUE * pattern,
    const  DB_VALUE * case_sensitive,
    cub_compiled_regex ** comp_regex,
    int * result
) 

function db_string_sha_one

int db_string_sha_one (
    DB_VALUE  const * val,
    DB_VALUE * result
) 

function db_string_sha_two

int db_string_sha_two (
    DB_VALUE  const * src,
    DB_VALUE  const * len,
    DB_VALUE * result
) 

function db_string_space

int db_string_space (
    DB_VALUE  const * count,
    DB_VALUE * result
) 

function db_string_substring

int db_string_substring (
    const  MISC_OPERAND substr_operand,
    const  DB_VALUE * src_string,
    const  DB_VALUE * start_position,
    const  DB_VALUE * extraction_length,
    DB_VALUE * sub_string
) 

function db_string_substring_index

int db_string_substring_index (
    DB_VALUE * src_string,
    DB_VALUE * delim_string,
    const  DB_VALUE * count,
    DB_VALUE * result
) 

function db_string_to_base64

int db_string_to_base64 (
    DB_VALUE  const * val,
    DB_VALUE * result
) 

function db_string_translate

int db_string_translate (
    const  DB_VALUE * src_string,
    const  DB_VALUE * from_string,
    const  DB_VALUE * to_string,
    DB_VALUE * transed_string
) 

function db_string_trim

int db_string_trim (
    const  MISC_OPERAND tr_operand,
    const  DB_VALUE * trim_charset,
    const  DB_VALUE * src_string,
    DB_VALUE * trimmed_string
) 

function db_string_unique_prefix

int db_string_unique_prefix (
    const  DB_VALUE * db_string1,
    const  DB_VALUE * db_string2,
    DB_VALUE * db_result,
    TP_DOMAIN * key_domain
) 

function db_string_upper

int db_string_upper (
    const  DB_VALUE * string,
    DB_VALUE * upper_string
) 

function db_sys_date

int db_sys_date (
    DB_VALUE * result_date
) 

function db_sys_date_and_epoch_time

int db_sys_date_and_epoch_time (
    DB_VALUE * dt_dbval,
    DB_VALUE * ts_dbval
) 

function db_sys_datetime

int db_sys_datetime (
    DB_VALUE * result_datetime
) 

function db_sys_time

int db_sys_time (
    DB_VALUE * result_time
) 

function db_sys_timestamp

int db_sys_timestamp (
    DB_VALUE * result_timestamp
) 

function db_sys_timezone

int db_sys_timezone (
    DB_VALUE * result_timezone
) 

function db_time_dbval

int db_time_dbval (
    DB_VALUE * result,
    const  DB_VALUE * datetime_value,
    const  TP_DOMAIN * domain
) 

function db_time_diff

int db_time_diff (
    const  DB_VALUE * datetime_value1,
    const  DB_VALUE * datetime_value2,
    DB_VALUE * result
) 

function db_time_format

int db_time_format (
    const  DB_VALUE * src_time,
    const  DB_VALUE * src_format,
    const  DB_VALUE * date_lang,
    DB_VALUE * result_time,
    const  TP_DOMAIN * domain
) 

function db_timestamp

int db_timestamp (
    const  DB_VALUE * src_datetime1,
    const  DB_VALUE * src_time2,
    DB_VALUE * result_datetime
) 

function db_timestamp_to_datetime

int db_timestamp_to_datetime (
    const  DB_VALUE * src_timestamp,
    DB_VALUE * result_datetime
) 

function db_to_char

int db_to_char (
    const  DB_VALUE * src_value,
    const  DB_VALUE * format_or_length,
    const  DB_VALUE * lang_str,
    DB_VALUE * result_str,
    const  TP_DOMAIN * domain
) 

function db_to_date

int db_to_date (
    const  DB_VALUE * src_str,
    const  DB_VALUE * format_str,
    const  DB_VALUE * date_lang,
    DB_VALUE * result_date
) 

function db_to_datetime

int db_to_datetime (
    const  DB_VALUE * src_str,
    const  DB_VALUE * format_str,
    const  DB_VALUE * date_lang,
    const  DB_TYPE type,
    DB_VALUE * result_datetime
) 

function db_to_number

int db_to_number (
    const  DB_VALUE * src_str,
    const  DB_VALUE * format_str,
    const  DB_VALUE * number_lang,
    DB_VALUE * result_num
) 

function db_to_time

int db_to_time (
    const  DB_VALUE * src_str,
    const  DB_VALUE * format_str,
    const  DB_VALUE * date_lang,
    const  DB_TYPE type,
    DB_VALUE * result_time
) 

function db_to_timestamp

int db_to_timestamp (
    const  DB_VALUE * src_str,
    const  DB_VALUE * format_str,
    const  DB_VALUE * date_lang,
    const  DB_TYPE type,
    DB_VALUE * result_timestamp
) 

function db_tz_offset

int db_tz_offset (
    const  DB_VALUE * src_str,
    DB_VALUE * result_str,
    DB_DATETIME * date_time
) 

function db_unix_timestamp

int db_unix_timestamp (
    const  DB_VALUE * src_date,
    DB_VALUE * result_timestamp
) 

function db_value_to_enumeration_value

int db_value_to_enumeration_value (
    const  DB_VALUE * src,
    DB_VALUE * result,
    const  TP_DOMAIN * enum_domain
) 

function get_day

int get_day (
    int month,
    int day,
    int year
) 

function get_last_day

int get_last_day (
    int month,
    int year
) 

function init_builtin_calendar_names

void init_builtin_calendar_names (
    LANG_LOCALE_DATA * lld
) 

function qstr_bin_to_hex

int qstr_bin_to_hex (
    char * dest,
    int dest_size,
    const  char * src,
    int src_size
) 

function qstr_bit_to_bin

int qstr_bit_to_bin (
    char * dest,
    int dest_size,
    const  char * src,
    int src_size
) 

function qstr_bit_to_hex_coerce

void qstr_bit_to_hex_coerce (
    char * buffer,
    int buffer_size,
    const  char * src,
    int src_length,
    int pad_flag,
    int * copy_size,
    int * truncation
) 

function qstr_compare

int qstr_compare (
    const  unsigned  char * string1,
    int size1,
    const  unsigned  char * string2,
    int size2
) 

function qstr_hex_to_bin

int qstr_hex_to_bin (
    char * dest,
    int dest_size,
    const  char * src,
    int src_size
) 

function qstr_make_typed_string

void qstr_make_typed_string (
    const  DB_TYPE db_type,
    DB_VALUE * value,
    const  int precision,
    DB_CONST_C_CHAR src,
    const  int s_unit,
    const  int codeset,
    const  int collation_id
) 

function qstr_pad_string

unsigned  char * qstr_pad_string (
    unsigned  char * s,
    int length,
    INTL_CODESET codeset
) 

function qstr_trim_trailing

void qstr_trim_trailing (
    const  unsigned  char * trim_charset_ptr,
    int trim_charset_size,
    const  unsigned  char * src_ptr,
    DB_TYPE src_type,
    int src_length,
    int src_size,
    INTL_CODESET codeset,
    int * trail_trimmed_length,
    int * trail_trimmed_size,
    bool skip_spaces
) 

function varbit_compare

int varbit_compare (
    const  unsigned  char * string1,
    int size1,
    const  unsigned  char * string2,
    int size2
) 

Macro Definition Documentation

define DATETIMETZ_BUF_SIZE

#define DATETIMETZ_BUF_SIZE `( DATETIME_BUF_SIZE + TIMEZONE_BUF_SIZE )`

define DATETIME_BUF_SIZE

#define DATETIME_BUF_SIZE `( TIMESTAMP_BUF_SIZE + 4)`

define DATETIME_IS_NULL

#define DATETIME_IS_NULL (
    dt
) `(( dt )->date == UINT_MAX && ( dt )->time == UINT_MAX )`

define DATETIME_NULL_VALUE

#define DATETIME_NULL_VALUE `{ UINT_MAX , UINT_MAX }`

define DATE_BUF_SIZE

#define DATE_BUF_SIZE `64`

define LIKE_WILDCARD_MATCH_MANY

#define LIKE_WILDCARD_MATCH_MANY `'%'`

define LIKE_WILDCARD_MATCH_ONE

#define LIKE_WILDCARD_MATCH_ONE `' _ '`

define NUM_BUF_SIZE

#define NUM_BUF_SIZE `64`

define NUM_MISC_OPERANDS

#define NUM_MISC_OPERANDS `12`

define QSTR_CHAR_COMPARE

#define QSTR_CHAR_COMPARE (
    id,
    string1,
    size1,
    string2,
    size2,
    ti
) `QSTR_COMPARE ( id , string1 , size1 , string2 , size2 , ti )`

define QSTR_COMPARE

#define QSTR_COMPARE (
    id,
    string1,
    size1,
    string2,
    size2,
    ti
) `/* multi line expression */`

define QSTR_DATETIME_LENGTH

#define QSTR_DATETIME_LENGTH `26`

define QSTR_IS_ANY_CHAR

#define QSTR_IS_ANY_CHAR (
    s
) `( QSTR_IS_CHAR (s))`

define QSTR_IS_ANY_CHAR_OR_BIT

#define QSTR_IS_ANY_CHAR_OR_BIT (
    s
) `( QSTR_IS_ANY_CHAR (s) || QSTR_IS_BIT (s))`

define QSTR_IS_BIT

#define QSTR_IS_BIT (
    s
) `(((s) == DB_TYPE_BIT )  || ((s) == DB_TYPE_VARBIT ))`

define QSTR_IS_CHAR

#define QSTR_IS_CHAR (
    s
) `(((s) == DB_TYPE_CHAR ) || ((s) == DB_TYPE_VARCHAR ))`

define QSTR_IS_FIXED_LENGTH

#define QSTR_IS_FIXED_LENGTH (
    s
) `(((s) == DB_TYPE_CHAR )    || ((s) == DB_TYPE_BIT ))`

define QSTR_IS_LIKE_WILDCARD_CHAR

#define QSTR_IS_LIKE_WILDCARD_CHAR (
    ch
) `/* multi line expression */`

define QSTR_IS_VARIABLE_LENGTH

#define QSTR_IS_VARIABLE_LENGTH (
    s
) `(((s) == DB_TYPE_VARCHAR ) || ((s) == DB_TYPE_VARBIT ))`

define QSTR_MATCH

#define QSTR_MATCH (
    id,
    string1,
    size1,
    string2,
    size2,
    esc,
    has_last_escape,
    match_size
) `/* multi line expression */`

define QSTR_NEXT_ALPHA_CHAR

#define QSTR_NEXT_ALPHA_CHAR (
    id,
    cur_chr,
    size,
    next_chr,
    len
) `/* multi line expression */`

define QSTR_NUM_BYTES

#define QSTR_NUM_BYTES (
    a
) `((( a ) + 7) / 8)`

define QSTR_SPLIT_KEY

#define QSTR_SPLIT_KEY (
    id,
    is_desc,
    str1,
    size1,
    str2,
    size2,
    k,
    s,
    ti
) `/* multi line expression */`

define TIMESTAMPTZ_BUF_SIZE

#define TIMESTAMPTZ_BUF_SIZE `( TIMESTAMP_BUF_SIZE + TIMEZONE_BUF_SIZE )`

define TIMESTAMP_BUF_SIZE

#define TIMESTAMP_BUF_SIZE `( TIME_BUF_SIZE + DATE_BUF_SIZE )`

define TIMEZONE_BUF_SIZE

#define TIMEZONE_BUF_SIZE `64`

define TIME_BUF_SIZE

#define TIME_BUF_SIZE `64`


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