CUBRID Engine
latest
|
#include <stdlib.h>
#include <assert.h>
#include "config.h"
#include "storage_common.h"
#include "memory_alloc.h"
#include "error_manager.h"
#include "system_parameter.h"
#include "environment_variable.h"
#include "file_io.h"
#include "tz_support.h"
#include "db_date.h"
#include "dbtype.h"
Go to the source code of this file.
Macros | |
#define | RESERVED_SIZE_IN_PAGE (sizeof (FILEIO_PAGE_RESERVED) + sizeof (FILEIO_PAGE_WATERMARK)) |
Functions | |
static PGLENGTH | find_valid_page_size (PGLENGTH page_size) |
PGLENGTH | db_page_size (void) |
PGLENGTH | db_io_page_size (void) |
PGLENGTH | db_log_page_size (void) |
int | db_set_page_size (PGLENGTH io_page_size, PGLENGTH log_page_size) |
PGLENGTH | db_network_page_size (void) |
void | db_print_data (DB_TYPE type, DB_DATA *data, FILE *fd) |
int | recdes_allocate_data_area (RECDES *rec, int size) |
void | recdes_free_data_area (RECDES *rec) |
void | recdes_set_data_area (RECDES *rec, char *data, int size) |
char * | oid_to_string (char *buf, int buf_size, OID *oid) |
char * | vpid_to_string (char *buf, int buf_size, VPID *vpid) |
char * | vfid_to_string (char *buf, int buf_size, VFID *vfid) |
char * | hfid_to_string (char *buf, int buf_size, HFID *hfid) |
char * | btid_to_string (char *buf, int buf_size, BTID *btid) |
const char * | fcode_get_uppercase_name (FUNC_TYPE ftype) |
const char * | fcode_get_lowercase_name (FUNC_TYPE ftype) |
Variables | |
static PGLENGTH | db_Io_page_size = IO_DEFAULT_PAGE_SIZE |
static PGLENGTH | db_Log_page_size = IO_DEFAULT_PAGE_SIZE |
static PGLENGTH | db_User_page_size = IO_DEFAULT_PAGE_SIZE - RESERVED_SIZE_IN_PAGE |
#define RESERVED_SIZE_IN_PAGE (sizeof (FILEIO_PAGE_RESERVED) + sizeof (FILEIO_PAGE_WATERMARK)) |
Definition at line 43 of file storage_common.c.
Referenced by db_set_page_size().
char* btid_to_string | ( | char * | buf, |
int | buf_size, | ||
BTID * | btid | ||
) |
Definition at line 404 of file storage_common.c.
References vfid::fileid, btid::root_pageid, btid::vfid, and vfid::volid.
Referenced by btree_scan_for_show_index_capacity(), and btree_scan_for_show_index_header().
PGLENGTH db_io_page_size | ( | void | ) |
Definition at line 68 of file storage_common.c.
References db_Io_page_size.
PGLENGTH db_log_page_size | ( | void | ) |
Definition at line 79 of file storage_common.c.
References db_Log_page_size.
PGLENGTH db_network_page_size | ( | void | ) |
Definition at line 126 of file storage_common.c.
References db_Io_page_size.
Referenced by locator_allocate_copy_area_by_length(), and locator_repl_add_error_to_copyarea().
PGLENGTH db_page_size | ( | void | ) |
Definition at line 57 of file storage_common.c.
References db_User_page_size.
Referenced by createdb(), pgbuf_flush_victim_candidates(), and spage_boot().
Definition at line 197 of file storage_common.c.
References db_monetary::amount, db_data::bigint, db_data::d, db_data::date, db_datetimetz::datetime, db_data::datetime, db_data::datetimetz, DB_CURRENCY_AUSTRALIAN_DOLLAR, DB_CURRENCY_BRASILIAN_REAL, DB_CURRENCY_BRITISH_POUND, DB_CURRENCY_BULGARIAN_LEV, DB_CURRENCY_CAMBODIAN_RIEL, DB_CURRENCY_CANADIAN_DOLLAR, DB_CURRENCY_CHINESE_RENMINBI, DB_CURRENCY_CROATIAN_KUNA, DB_CURRENCY_CZECH_KORUNA, DB_CURRENCY_DANISH_KRONE, DB_CURRENCY_DOLLAR, DB_CURRENCY_EURO, DB_CURRENCY_INDIAN_RUPEE, DB_CURRENCY_NORWEGIAN_KRONE, DB_CURRENCY_POLISH_ZLOTY, DB_CURRENCY_ROMANIAN_LEU, DB_CURRENCY_RUSSIAN_RUBLE, DB_CURRENCY_SERBIAN_DINAR, DB_CURRENCY_SWEDISH_KRONA, DB_CURRENCY_SWISS_FRANC, DB_CURRENCY_TL, DB_CURRENCY_VIETNAMESE_DONG, DB_CURRENCY_WON, DB_CURRENCY_YEN, db_date_decode(), db_datetime_decode(), db_time_decode(), DB_TYPE_BIGINT, DB_TYPE_DATE, DB_TYPE_DATETIME, DB_TYPE_DATETIMELTZ, DB_TYPE_DATETIMETZ, DB_TYPE_DOUBLE, DB_TYPE_FLOAT, DB_TYPE_INTEGER, DB_TYPE_MONETARY, DB_TYPE_SHORT, DB_TYPE_TIME, DB_TYPE_TIMESTAMP, DB_TYPE_TIMESTAMPLTZ, DB_TYPE_TIMESTAMPTZ, db_data::f, db_data::i, db_data::money, db_data::sh, db_data::time, db_timestamptz::timestamp, db_data::timestamptz, db_monetary::type, db_timestamptz::tz_id, db_datetimetz::tz_id, and db_data::utime.
Definition at line 96 of file storage_common.c.
References assert, db_Io_page_size, db_Log_page_size, db_User_page_size, ER_FAILED, find_valid_page_size(), IO_MIN_PAGE_SIZE, NO_ERROR, and RESERVED_SIZE_IN_PAGE.
Referenced by boot_initialize_client(), boot_restart_client(), log_get_io_page_size(), log_initialize_internal(), logpb_delete(), logpb_find_header_parameters(), logpb_restore(), patchdb(), xboot_emergency_patch(), and xboot_initialize_server().
Definition at line 577 of file storage_common.c.
References F_BENCHMARK, F_CLASS_OF, F_ELT, F_INSERT_SUBSTRING, F_JSON_ARRAY, F_JSON_ARRAY_APPEND, F_JSON_ARRAY_INSERT, F_JSON_CONTAINS, F_JSON_CONTAINS_PATH, F_JSON_DEPTH, F_JSON_EXTRACT, F_JSON_GET_ALL_PATHS, F_JSON_INSERT, F_JSON_KEYS, F_JSON_LENGTH, F_JSON_MERGE, F_JSON_MERGE_PATCH, F_JSON_OBJECT, F_JSON_PRETTY, F_JSON_QUOTE, F_JSON_REMOVE, F_JSON_REPLACE, F_JSON_SEARCH, F_JSON_SET, F_JSON_TYPE, F_JSON_UNQUOTE, F_JSON_VALID, F_MULTISET, F_REGEXP_COUNT, F_REGEXP_INSTR, F_REGEXP_LIKE, F_REGEXP_REPLACE, F_REGEXP_SUBSTR, F_SEQUENCE, F_SET, F_TABLE_MULTISET, F_TABLE_SEQUENCE, F_TABLE_SET, F_VID, PT_AGG_BIT_AND, PT_AGG_BIT_OR, PT_AGG_BIT_XOR, PT_AVG, PT_COUNT, PT_COUNT_STAR, PT_CUME_DIST, PT_DENSE_RANK, PT_FIRST_VALUE, PT_GROUP_CONCAT, PT_GROUPBY_NUM, PT_JSON_ARRAYAGG, PT_JSON_OBJECTAGG, PT_LAG, PT_LAST_VALUE, PT_LEAD, PT_MAX, PT_MEDIAN, PT_MIN, PT_NTH_VALUE, PT_NTILE, PT_PERCENT_RANK, PT_PERCENTILE_CONT, PT_PERCENTILE_DISC, PT_RANK, PT_ROW_NUMBER, PT_STDDEV, PT_STDDEV_POP, PT_STDDEV_SAMP, PT_SUM, PT_VAR_POP, PT_VAR_SAMP, and PT_VARIANCE.
Referenced by func_type::Node::invalid_coll_error(), func_type::Node::preprocess(), pt_check_data_default(), pt_check_filter_index_expr_pre(), pt_check_function_collation(), pt_eval_function_type_new(), pt_eval_function_type_old(), pt_print_function(), and qo_plan_print_analytic_eval().
Definition at line 412 of file storage_common.c.
References F_BENCHMARK, F_CLASS_OF, F_ELT, F_GENERIC, F_INSERT_SUBSTRING, F_JSON_ARRAY, F_JSON_ARRAY_APPEND, F_JSON_ARRAY_INSERT, F_JSON_CONTAINS, F_JSON_CONTAINS_PATH, F_JSON_DEPTH, F_JSON_EXTRACT, F_JSON_GET_ALL_PATHS, F_JSON_INSERT, F_JSON_KEYS, F_JSON_LENGTH, F_JSON_MERGE, F_JSON_MERGE_PATCH, F_JSON_OBJECT, F_JSON_PRETTY, F_JSON_QUOTE, F_JSON_REMOVE, F_JSON_REPLACE, F_JSON_SEARCH, F_JSON_SET, F_JSON_TYPE, F_JSON_UNQUOTE, F_JSON_VALID, F_MIDXKEY, F_MULTISET, F_REGEXP_COUNT, F_REGEXP_INSTR, F_REGEXP_LIKE, F_REGEXP_REPLACE, F_REGEXP_SUBSTR, F_SEQUENCE, F_SET, F_TABLE_MULTISET, F_TABLE_SEQUENCE, F_TABLE_SET, F_TOP_TABLE_FUNC, F_VID, PT_AGG_BIT_AND, PT_AGG_BIT_OR, PT_AGG_BIT_XOR, PT_AVG, PT_COUNT, PT_COUNT_STAR, PT_CUME_DIST, PT_DENSE_RANK, PT_FIRST_VALUE, PT_GENERIC, PT_GROUP_CONCAT, PT_GROUPBY_NUM, PT_JSON_ARRAYAGG, PT_JSON_OBJECTAGG, PT_LAG, PT_LAST_VALUE, PT_LEAD, PT_MAX, PT_MEDIAN, PT_MIN, PT_NTH_VALUE, PT_NTILE, PT_PERCENT_RANK, PT_PERCENTILE_CONT, PT_PERCENTILE_DISC, PT_RANK, PT_ROW_NUMBER, PT_STDDEV, PT_STDDEV_POP, PT_STDDEV_SAMP, PT_SUM, PT_TOP_AGG_FUNC, PT_VAR_POP, PT_VAR_SAMP, and PT_VARIANCE.
Referenced by db_value_to_json_path(), pt_is_function_index_expr(), qdata_apply_interpolation_function_coercion(), qdata_evaluate_aggregate_list(), qdata_evaluate_analytic_func(), qdata_interpolation_function_values(), qdata_update_agg_interpolation_func_value_and_domain(), qdump_print_aggregate_expression(), qdump_print_function_value(), qexec_execute_analytic(), qexec_resolve_domains_for_aggregation(), and func_type::Node::type_checking().
Definition at line 142 of file storage_common.c.
References ARG_FILE_LINE, ER_DTSR_BAD_PAGESIZE, er_set(), ER_WARNING_SEVERITY, IO_MAX_PAGE_SIZE, IO_MIN_PAGE_SIZE, IS_POWER_OF_2, and page_size.
Referenced by db_set_page_size().
char* hfid_to_string | ( | char * | buf, |
int | buf_size, | ||
HFID * | hfid | ||
) |
Definition at line 396 of file storage_common.c.
References vfid::fileid, hfid::hpgid, hfid::vfid, and vfid::volid.
Referenced by disk_volume_header_next_scan().
char* oid_to_string | ( | char * | buf, |
int | buf_size, | ||
OID * | oid | ||
) |
Definition at line 372 of file storage_common.c.
References db_identifier::pageid, db_identifier::slotid, and db_identifier::volid.
Referenced by btree_scan_for_show_index_header(), heap_capacity_next_scan(), and heap_header_next_scan().
int recdes_allocate_data_area | ( | RECDES * | rec, |
int | size | ||
) |
Definition at line 342 of file storage_common.c.
References recdes::area_size, recdes::data, db_private_alloc, ER_FAILED, NO_ERROR, and NULL.
Referenced by catalog_add_class_info(), catalog_drop_all(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_helper(), catalog_drop_representation_item(), and catalog_put_representation_item().
void recdes_free_data_area | ( | RECDES * | rec | ) |
Definition at line 359 of file storage_common.c.
References recdes::data, db_private_free_and_init, and NULL.
Referenced by catalog_add_class_info(), catalog_drop_all(), catalog_drop_all_representation_and_class(), catalog_drop_old_representations(), catalog_drop_representation_helper(), catalog_drop_representation_item(), and catalog_put_representation_item().
void recdes_set_data_area | ( | RECDES * | rec, |
char * | data, | ||
int | size | ||
) |
Definition at line 365 of file storage_common.c.
References recdes::area_size, and recdes::data.
Referenced by catalog_get_class_info(), catalog_initialize_new_page(), catalog_put_representation_item(), catalog_rv_insert_redo(), catalog_rv_new_page_redo(), catalog_rv_update(), and catalog_update_class_info().
char* vfid_to_string | ( | char * | buf, |
int | buf_size, | ||
VFID * | vfid | ||
) |
Definition at line 388 of file storage_common.c.
References vfid::fileid, and vfid::volid.
Referenced by btree_scan_for_show_index_header(), and heap_header_next_scan().
char* vpid_to_string | ( | char * | buf, |
int | buf_size, | ||
VPID * | vpid | ||
) |
Definition at line 380 of file storage_common.c.
References vpid::pageid, and vpid::volid.
Referenced by heap_header_next_scan().
|
static |
Definition at line 45 of file storage_common.c.
Referenced by db_io_page_size(), db_network_page_size(), and db_set_page_size().
|
static |
Definition at line 46 of file storage_common.c.
Referenced by db_log_page_size(), and db_set_page_size().
|
static |
Definition at line 47 of file storage_common.c.
Referenced by db_page_size(), and db_set_page_size().