CUBRID Engine  latest
storage_common.c File Reference
#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"
Include dependency graph for storage_common.c:

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
 

Macro Definition Documentation

#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().

Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

const char* fcode_get_uppercase_name ( FUNC_TYPE  ftype)

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().

Here is the caller graph for this function:

static PGLENGTH find_valid_page_size ( PGLENGTH  page_size)
static

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void recdes_set_data_area ( RECDES rec,
char *  data,
int  size 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

Variable Documentation

PGLENGTH db_Io_page_size = IO_DEFAULT_PAGE_SIZE
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().

PGLENGTH db_Log_page_size = IO_DEFAULT_PAGE_SIZE
static

Definition at line 46 of file storage_common.c.

Referenced by db_log_page_size(), and db_set_page_size().

PGLENGTH db_User_page_size = IO_DEFAULT_PAGE_SIZE - RESERVED_SIZE_IN_PAGE
static

Definition at line 47 of file storage_common.c.

Referenced by db_page_size(), and db_set_page_size().