CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "query_manager.h"
#include "file_manager.h"
#include "compile_context.h"
#include "log_append.hpp"
#include "object_primitive.h"
#include "object_representation.h"
#include "xserver_interface.h"
#include "query_executor.h"
#include "stream_to_xasl.h"
#include "session.h"
#include "filter_pred_cache.h"
#include "crypt_opfunc.h"
#include "thread_entry.hpp"
#include "xasl_cache.h"
#include "xasl_unpack_info.hpp"
Go to the source code of this file.
Classes | |
struct | oid_block_list |
struct | qmgr_tran_entry |
struct | qmgr_temp_file_list |
struct | qmgr_query_table |
Macros | |
#define | pthread_mutex_init(a, b) |
#define | pthread_mutex_destroy(a) |
#define | pthread_mutex_lock(a) 0 |
#define | pthread_mutex_unlock(a) |
#define | IS_IN_METHOD_OR_JSP_CALL() (method_Num_method_jsp_calls > 0) |
#define | QMGR_MAX_QUERY_ENTRY_PER_TRAN 100 |
#define | QMGR_TEMP_FILE_FREE_LIST_SIZE 100 |
#define | QMGR_NUM_TEMP_FILE_LISTS (TEMP_FILE_MEMBUF_NUM_TYPES) |
#define | QMGR_SQL_ID_LENGTH 13 |
#define | QMGR_IS_VALID_MEMBUF_TYPE(m) ((m) == TEMP_FILE_MEMBUF_NORMAL || (m) == TEMP_FILE_MEMBUF_KEY_BUFFER) |
#define | OID_BLOCK_ARRAY_SIZE 10 |
Typedefs | |
typedef enum qmgr_page_type | QMGR_PAGE_TYPE |
typedef struct oid_block_list | OID_BLOCK_LIST |
typedef struct qmgr_tran_entry | QMGR_TRAN_ENTRY |
typedef struct qmgr_temp_file_list | QMGR_TEMP_FILE_LIST |
typedef struct qmgr_query_table | QMGR_QUERY_TABLE |
Enumerations | |
enum | qmgr_page_type { QMGR_UNKNOWN_PAGE, QMGR_MEMBUF_PAGE, QMGR_TEMP_FILE_PAGE } |
Variables | |
int | method_Num_method_jsp_calls |
QMGR_QUERY_TABLE | qmgr_Query_table |
static struct drand48_data | qmgr_rand_buf |
#define IS_IN_METHOD_OR_JSP_CALL | ( | ) | (method_Num_method_jsp_calls > 0) |
Definition at line 58 of file query_manager.c.
Referenced by xqmgr_execute_query().
#define OID_BLOCK_ARRAY_SIZE 10 |
Definition at line 88 of file query_manager.c.
Referenced by qmgr_add_modified_class().
#define pthread_mutex_destroy | ( | a | ) |
Definition at line 54 of file query_manager.c.
Referenced by qmgr_finalize_temp_file_list().
#define pthread_mutex_init | ( | a, | |
b | |||
) |
Definition at line 53 of file query_manager.c.
Referenced by qmgr_initialize_temp_file_list().
#define pthread_mutex_lock | ( | a | ) | 0 |
Definition at line 55 of file query_manager.c.
Referenced by qmgr_get_temp_file_from_list(), qmgr_initialize_temp_file_list(), and qmgr_put_temp_file_into_list().
#define pthread_mutex_unlock | ( | a | ) |
Definition at line 56 of file query_manager.c.
Referenced by qmgr_get_temp_file_from_list(), qmgr_initialize_temp_file_list(), and qmgr_put_temp_file_into_list().
#define QMGR_IS_VALID_MEMBUF_TYPE | ( | m | ) | ((m) == TEMP_FILE_MEMBUF_NORMAL || (m) == TEMP_FILE_MEMBUF_KEY_BUFFER) |
Definition at line 71 of file query_manager.c.
Referenced by qmgr_create_new_temp_file(), qmgr_initialize_temp_file_list(), and qmgr_put_temp_file_into_list().
#define QMGR_MAX_QUERY_ENTRY_PER_TRAN 100 |
Definition at line 62 of file query_manager.c.
Referenced by qmgr_allocate_query_entry(), xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
#define QMGR_NUM_TEMP_FILE_LISTS (TEMP_FILE_MEMBUF_NUM_TYPES) |
Definition at line 66 of file query_manager.c.
Referenced by qmgr_finalize().
#define QMGR_SQL_ID_LENGTH 13 |
Definition at line 68 of file query_manager.c.
Referenced by qmgr_get_sql_id().
#define QMGR_TEMP_FILE_FREE_LIST_SIZE 100 |
Definition at line 64 of file query_manager.c.
Referenced by qmgr_initialize_temp_file_list(), and qmgr_put_temp_file_into_list().
typedef struct oid_block_list OID_BLOCK_LIST |
typedef enum qmgr_page_type QMGR_PAGE_TYPE |
Definition at line 79 of file query_manager.c.
typedef struct qmgr_query_table QMGR_QUERY_TABLE |
Definition at line 122 of file query_manager.c.
typedef struct qmgr_temp_file_list QMGR_TEMP_FILE_LIST |
Definition at line 110 of file query_manager.c.
typedef struct qmgr_tran_entry QMGR_TRAN_ENTRY |
Definition at line 96 of file query_manager.c.
enum qmgr_page_type |
Enumerator | |
---|---|
QMGR_UNKNOWN_PAGE | |
QMGR_MEMBUF_PAGE | |
QMGR_TEMP_FILE_PAGE |
Definition at line 73 of file query_manager.c.
|
static |
Definition at line 1674 of file query_manager.c.
References ARG_FILE_LINE, log_tdes::bind_history, db_change_private_heap(), db_private_alloc, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), i, LOG_FIND_CURRENT_TDES(), MAX_NUM_EXEC_QUERY_HISTORY, NO_ERROR, NULL, log_tdes::num_exec_queries, pr_clone_value(), db_value_array::size, and db_value_array::vals.
Referenced by xqmgr_execute_query().
void qmgr_add_modified_class | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid_p | ||
) |
Definition at line 2280 of file query_manager.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), i, oid_block_list::last_oid_idx, LOG_FIND_THREAD_TRAN_INDEX, qmgr_tran_entry::modified_classes_p, oid_block_list::next, NULL, oid_block_list::oid_array, OID_BLOCK_ARRAY_SIZE, oid_compare(), and qmgr_query_table::tran_entries_p.
Referenced by locator_delete_force_internal(), locator_insert_force(), locator_update_force(), qexec_execute_delete(), qexec_execute_increment(), qexec_execute_insert(), and qexec_execute_update().
|
static |
Definition at line 452 of file query_manager.c.
References LOG_FIND_THREAD_TRAN_INDEX, qmgr_query_entry::next, NULL_TRAN_INDEX, QMGR_TRAN_NULL, QMGR_TRAN_RUNNING, QMGR_TRAN_TERMINATED, qmgr_tran_entry::query_entry_list_p, qmgr_query_table::tran_entries_p, and qmgr_tran_entry::trans_stat.
Referenced by qmgr_get_query_entry(), xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
|
static |
|
static |
Definition at line 269 of file query_manager.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, qmgr_query_entry::er_msg, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), qmgr_query_entry::errid, qmgr_tran_entry::free_query_entry_list_p, i, qmgr_query_entry::includes_tde_class, qmgr_query_entry::is_holdable, qmgr_query_entry::list_ent, qmgr_query_entry::list_id, qmgr_query_entry::next, NO_ERROR, NULL, qmgr_tran_entry::num_query_entries, qmgr_query_entry::num_tmp, qmgr_free_query_entry(), QMGR_MAX_QUERY_ENTRY_PER_TRAN, qmgr_query_entry::query_flag, qmgr_query_entry::query_id, qmgr_tran_entry::query_id_generator, session_is_queryid_idle(), qmgr_query_entry::temp_vfid, qmgr_query_entry::total_count, qmgr_query_entry::xasl_ent, qmgr_query_entry::xasl_id, and XASL_ID_SET_NULL.
Referenced by qmgr_get_query_entry(), xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
|
static |
Definition at line 2597 of file query_manager.c.
References ARG_FILE_LINE, DB_ALIGN, DB_PAGESIZE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), MAX_ALIGNMENT, and NULL.
Referenced by qmgr_create_new_temp_file(), and qmgr_initialize_temp_file_list().
int qmgr_allocate_tran_entries | ( | THREAD_ENTRY * | thread_p, |
int | num_new_entries | ||
) |
Definition at line 629 of file query_manager.c.
References ARG_FILE_LINE, csect_enter, csect_exit, CSECT_QPROC_QUERY_TABLE, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), for(), i, INF_WAIT, MAX_NTRANS, NO_ERROR, NULL, qmgr_query_table::num_trans, qmgr_initialize_tran_entry(), and qmgr_query_table::tran_entries_p.
Referenced by logtb_expand_trantable(), and qmgr_initialize().
|
static |
|
static |
|
static |
Definition at line 2050 of file query_manager.c.
References ARG_FILE_LINE, er_log_debug, i, oid_block_list::last_oid_idx, qmgr_tran_entry::modified_classes_p, oid_block_list::next, NO_ERROR, oid_block_list::oid_array, db_identifier::pageid, db_identifier::slotid, db_identifier::volid, and xcache_invalidate_qcaches().
Referenced by qmgr_clear_trans_wakeup().
void qmgr_clear_trans_wakeup | ( | THREAD_ENTRY * | thread_p, |
int | tran_index, | ||
bool | is_tran_died, | ||
bool | is_abort | ||
) |
Definition at line 2122 of file query_manager.c.
References ARG_FILE_LINE, assert, er_log_debug, qmgr_query_entry::is_holdable, qmgr_query_entry::list_ent, qmgr_query_entry::list_id, LOG_FIND_THREAD_TRAN_INDEX, LOG_SYSTEM_TRAN_INDEX, qmgr_tran_entry::modified_classes_p, qmgr_query_entry::next, NULL, qmgr_query_table::num_trans, qfile_close_list(), qfile_end_use_of_list_cache_entry(), QFILE_FREE_AND_INIT_LIST_ID, qfile_has_no_cache_entries(), QFILE_IS_LIST_CACHE_DISABLED, qmgr_clear_relative_cache_entries(), qmgr_free_oid_block(), qmgr_free_query_entry(), qmgr_free_query_temp_file_helper(), QMGR_TRAN_TERMINATED, QUERY_COMPLETED, qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_id, qmgr_query_entry::query_status, SERVER_MODE, qmgr_query_entry::temp_vfid, qmgr_query_table::tran_entries_p, qmgr_tran_entry::trans_stat, qmgr_query_entry::xasl_ent, qmgr_query_entry::xasl_id, XASL_ID_SET_NULL, xsession_clear_query_entry_info(), and xsession_store_query_entry_info().
Referenced by log_abort_local(), log_commit_local(), and logtb_release_tran_index().
QMGR_TEMP_FILE* qmgr_create_new_temp_file | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id, | ||
QMGR_TEMP_FILE_MEMBUF_TYPE | membuf_type | ||
) |
Definition at line 2623 of file query_manager.c.
References ARG_FILE_LINE, assert, DB_ALIGN, DB_PAGESIZE, ER_ERROR_SEVERITY, ER_QPROC_UNKNOWN_QUERYID, er_set(), FILE_TEMP, free_and_init, i, qmgr_query_entry::includes_tde_class, LOG_FIND_THREAD_TRAN_INDEX, MAX_ALIGNMENT, qmgr_temp_file::membuf, qmgr_temp_file::membuf_last, qmgr_temp_file::membuf_npages, qmgr_temp_file::membuf_type, qmgr_temp_file::next, NULL, NULL_PAGEID, NULL_VOLID, qmgr_query_entry::num_tmp, qmgr_temp_file::preserved, qmgr_temp_file::prev, prm_get_integer_value(), PRM_ID_INDEX_SCAN_KEY_BUFFER_PAGES, PRM_ID_TEMP_MEM_BUFFER_PAGES, qmgr_allocate_tempfile_with_buffer(), qmgr_find_query_entry(), qmgr_get_temp_file_from_list(), QMGR_IS_VALID_MEMBUF_TYPE, qmgr_put_page_header(), qmgr_tran_entry::query_entry_list_p, qmgr_temp_file::tde_encrypted, qmgr_query_table::temp_file_list, TEMP_FILE_MEMBUF_NORMAL, qmgr_temp_file::temp_file_type, qmgr_temp_file::temp_vfid, qmgr_query_entry::temp_vfid, qmgr_query_table::tran_entries_p, and VFID_SET_NULL.
Referenced by qexec_setup_list_id(), qfile_get_first_page(), and qfile_open_list().
QMGR_TEMP_FILE* qmgr_create_result_file | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id | ||
) |
Definition at line 2731 of file query_manager.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, ER_QPROC_UNKNOWN_QUERYID, er_set(), file_apply_tde_algorithm(), file_create_query_area(), FILE_QUERY_AREA, file_temp_preserve(), file_temp_retire(), free_and_init, qmgr_query_entry::includes_tde_class, LOG_FIND_THREAD_TRAN_INDEX, qmgr_temp_file::membuf, qmgr_temp_file::membuf_last, qmgr_temp_file::membuf_npages, qmgr_temp_file::membuf_type, qmgr_temp_file::next, NO_ERROR, NULL, qmgr_query_entry::num_tmp, qmgr_temp_file::preserved, qmgr_temp_file::prev, prm_get_integer_value(), PRM_ID_TDE_DEFAULT_ALGORITHM, PRM_ID_TEMP_MEM_BUFFER_PAGES, qmgr_find_query_entry(), qmgr_is_allowed_result_cache(), qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_flag, TDE_ALGORITHM_NONE, qmgr_temp_file::tde_encrypted, TEMP_FILE_MEMBUF_NONE, qmgr_temp_file::temp_file_type, qmgr_temp_file::temp_vfid, qmgr_query_entry::temp_vfid, qmgr_query_table::tran_entries_p, and VFID_SET_NULL.
Referenced by qfile_open_list().
|
static |
Definition at line 396 of file query_manager.c.
References oid_block_list::next.
Referenced by qmgr_free_tran_entries().
|
static |
Definition at line 417 of file query_manager.c.
References qmgr_query_entry::er_msg, free_and_init, qmgr_query_entry::list_id, qmgr_query_entry::next, p, and QFILE_FREE_AND_INIT_LIST_ID.
Referenced by qmgr_free_tran_entries().
|
static |
Definition at line 560 of file query_manager.c.
References LOG_FIND_THREAD_TRAN_INDEX, qmgr_query_entry::next, NULL, NULL_TRAN_INDEX, qmgr_free_query_entry(), QMGR_TRAN_TERMINATED, qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_id, qmgr_query_table::tran_entries_p, and qmgr_tran_entry::trans_stat.
Referenced by xqmgr_end_query(), xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
void qmgr_finalize | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 911 of file query_manager.c.
References assert, csect_enter, csect_exit, CSECT_QPROC_QUERY_TABLE, i, INF_WAIT, NO_ERROR, NULL, qmgr_query_table::num_trans, qfile_finalize(), qmgr_finalize_temp_file_list(), qmgr_free_tran_entries(), QMGR_NUM_TEMP_FILE_LISTS, scan_finalize(), qmgr_query_table::temp_file_list, and qmgr_query_table::tran_entries_p.
Referenced by boot_server_all_finalize().
|
static |
Definition at line 3248 of file query_manager.c.
References assert, qmgr_temp_file_list::count, free_and_init, qmgr_temp_file_list::list, qmgr_temp_file_list::mutex, qmgr_temp_file::next, NULL, and pthread_mutex_destroy.
Referenced by qmgr_finalize(), and qmgr_initialize().
|
static |
Definition at line 475 of file query_manager.c.
References qmgr_query_entry::next, and qmgr_query_entry::query_id.
Referenced by qmgr_create_new_temp_file(), qmgr_create_result_file(), qmgr_free_list_temp_file(), qmgr_get_query_entry(), and xqmgr_end_query().
int qmgr_free_list_temp_file | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id, | ||
QMGR_TEMP_FILE * | tfile_vfid_p | ||
) |
Definition at line 2969 of file query_manager.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_FAILED, qmgr_query_entry::er_msg, er_msg(), ER_QPROC_UNKNOWN_QUERYID, er_set(), er_set_area_error(), qmgr_query_entry::errid, FILE_QUERY_AREA, file_temp_retire(), file_temp_retire_preserved(), free_and_init, LOG_FIND_THREAD_TRAN_INDEX, logtb_get_check_interrupt(), logtb_is_interrupted_tran(), qmgr_temp_file::next, NO_ERROR, NULL, OR_INT_SIZE, or_pack_int(), p, qmgr_temp_file::preserved, qmgr_temp_file::prev, qmgr_find_query_entry(), qmgr_put_temp_file_into_list(), qmgr_tran_entry::query_entry_list_p, rc, rv, strlen, qmgr_temp_file::temp_file_type, qmgr_temp_file::temp_vfid, qmgr_query_entry::temp_vfid, qmgr_query_table::tran_entries_p, VFID_ISNULL, and VFID_SET_NULL.
Referenced by qfile_destroy_list().
|
static |
Definition at line 2264 of file query_manager.c.
References oid_block_list::last_oid_idx, oid_block_list::next, and p.
Referenced by qmgr_clear_trans_wakeup().
void qmgr_free_old_page | ( | THREAD_ENTRY * | thread_p, |
PAGE_PTR | page_p, | ||
QMGR_TEMP_FILE * | tfile_vfid_p | ||
) |
Definition at line 2411 of file query_manager.c.
References assert, NULL, pgbuf_unfix, qmgr_get_page_type(), QMGR_MEMBUF_PAGE, QMGR_TEMP_FILE_PAGE, and QMGR_UNKNOWN_PAGE.
|
static |
Definition at line 368 of file query_manager.c.
References qmgr_query_entry::er_msg, free_and_init, qmgr_tran_entry::free_query_entry_list_p, qmgr_query_entry::list_id, qmgr_query_entry::next, NULL, and QFILE_FREE_AND_INIT_LIST_ID.
Referenced by qmgr_allocate_query_entry(), qmgr_clear_trans_wakeup(), qmgr_delete_query_entry(), and qmgr_get_query_entry().
|
static |
Definition at line 2933 of file query_manager.c.
References LOG_FIND_THREAD_TRAN_INDEX, NO_ERROR, NULL, NULL_TRAN_INDEX, qmgr_free_query_temp_file_helper(), rc, qmgr_query_entry::temp_vfid, and qmgr_query_table::tran_entries_p.
Referenced by xqmgr_end_query(), xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
|
static |
Definition at line 2902 of file query_manager.c.
References assert, qmgr_query_entry::errid, qmgr_temp_file::next, NO_ERROR, NULL, qmgr_temp_file::prev, qmgr_free_temp_file_list(), qmgr_query_entry::query_id, rc, and qmgr_query_entry::temp_vfid.
Referenced by qmgr_clear_trans_wakeup(), and qmgr_free_query_temp_file().
int qmgr_free_temp_file_list | ( | THREAD_ENTRY * | thread_p, |
QMGR_TEMP_FILE * | tfile_vfid_p, | ||
QUERY_ID | query_id, | ||
bool | is_error | ||
) |
Definition at line 2843 of file query_manager.c.
References assert, ASSERT_ERROR, ER_FAILED, FILE_QUERY_AREA, file_temp_retire(), file_temp_retire_preserved(), free_and_init, qmgr_temp_file::next, NO_ERROR, NULL, qmgr_temp_file::preserved, qmgr_temp_file::prev, qmgr_put_temp_file_into_list(), rc, qmgr_temp_file::temp_file_type, qmgr_temp_file::temp_vfid, and VFID_ISNULL.
Referenced by qmgr_free_query_temp_file_helper(), and session_free_sentry_data().
|
static |
Definition at line 693 of file query_manager.c.
References CACHE_TIME_AS_ARGS, qfile_tuple_value_type_list::domp, qfile_list_id::first_vpid, free_and_init, qmgr_tran_entry::free_query_entry_list_p, i, qfile_list_id::last_offset, qfile_list_id::last_pgptr, qfile_list_id::last_vpid, qfile_list_id::lasttpl_len, qmgr_query_entry::list_id, qmgr_tran_entry::modified_classes_p, qmgr_temp_file::next, qmgr_query_entry::next, NULL, qmgr_query_table::num_trans, qfile_list_id::page_cnt, vpid::pageid, qmgr_deallocate_oid_blocks(), qmgr_deallocate_query_entries(), qmgr_dump(), QMGR_TRAN_DELAYED_START, QMGR_TRAN_NULL, QMGR_TRAN_RESUME_DUE_DEADLOCK, QMGR_TRAN_RESUME_TO_DEALLOCATE, QMGR_TRAN_RUNNING, QMGR_TRAN_TERMINATED, QMGR_TRAN_WAITING, qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_id, xasl_id::sha1, SHA1_AS_ARGS, qmgr_query_entry::temp_vfid, xasl_id::time_stored, qmgr_query_table::tran_entries_p, qmgr_tran_entry::trans_stat, qfile_list_id::tuple_cnt, qfile_tuple_value_type_list::type_cnt, qfile_list_id::type_list, vpid::volid, and qmgr_query_entry::xasl_id.
Referenced by qmgr_finalize().
QUERY_ID qmgr_get_current_query_id | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 3503 of file query_manager.c.
References LOG_FIND_THREAD_TRAN_INDEX, NULL, qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_id, and qmgr_query_table::tran_entries_p.
Referenced by pgbuf_bcb_flush_with_wal(), pgbuf_claim_bcb_for_fix(), and pgbuf_flush_page_and_neighbors_fb().
|
static |
Definition at line 2581 of file query_manager.c.
References assert, ASSERT_ERROR, file_alloc(), NO_ERROR, NULL, PAGE_QRESULT, pgbuf_get_page_ptype(), qmgr_init_external_file_page(), qmgr_temp_file::temp_vfid, and VPID_SET_NULL.
Referenced by qmgr_get_new_page().
PAGE_PTR qmgr_get_new_page | ( | THREAD_ENTRY * | thread_p, |
VPID * | vpid_p, | ||
QMGR_TEMP_FILE * | tfile_vfid_p | ||
) |
Definition at line 2491 of file query_manager.c.
References ARG_FILE_LINE, ASSERT_ERROR, er_errid(), ER_ERROR_SEVERITY, ER_FILE_NOT_ENOUGH_PAGES_IN_VOLUME, ER_QPROC_INVALID_TEMP_FILE, ER_QPROC_OUT_OF_TEMP_SPACE, er_set(), file_apply_tde_algorithm(), file_create_temp(), FILE_TEMP, file_temp_retire(), LOG_FIND_THREAD_TRAN_INDEX, qmgr_temp_file::membuf, qmgr_temp_file::membuf_last, qmgr_temp_file::membuf_npages, NO_ERROR, NULL, NULL_PAGEID, NULL_VOLID, vpid::pageid, prm_get_integer_value(), PRM_ID_TDE_DEFAULT_ALGORITHM, qmgr_get_external_file_page(), TDE_ALGORITHM_NONE, qmgr_temp_file::tde_encrypted, qmgr_temp_file::temp_file_type, qmgr_temp_file::temp_vfid, VFID_ISNULL, VFID_SET_NULL, and vpid::volid.
Referenced by qfile_allocate_new_ovf_page(), qfile_allocate_new_page(), qfile_copy_list_pages(), and qfile_get_first_page().
PAGE_PTR qmgr_get_old_page | ( | THREAD_ENTRY * | thread_p, |
VPID * | vpid_p, | ||
QMGR_TEMP_FILE * | tfile_vfid_p | ||
) |
Definition at line 2351 of file query_manager.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_INTERRUPTED, ER_QPROC_INVALID_TEMP_FILE, er_set(), LOG_FIND_THREAD_TRAN_INDEX, logtb_get_check_interrupt(), logtb_is_interrupted_tran(), qmgr_temp_file::membuf, qmgr_temp_file::membuf_last, NULL, NULL_VOLID, OLD_PAGE, PAGE_QRESULT, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_WRITE, PGBUF_UNCONDITIONAL_LATCH, and vpid::volid.
Referenced by qexec_analytic_put_next(), qexec_gby_put_next(), qexec_hash_gby_put_next(), qexec_ordby_put_next(), qfile_add_overflow_tuple_to_list(), qfile_copy_list_pages(), qfile_get_tuple(), qfile_jump_scan_tuple_position(), qfile_overwrite_tuple(), qfile_put_next_sort_item(), qfile_scan_next(), qfile_scan_prev(), qfile_set_tuple_column_value(), qfile_start_scan_fix(), sqmgr_execute_query(), sqmgr_prepare_and_execute_query(), and xqfile_get_list_file_page().
|
static |
Definition at line 194 of file query_manager.c.
References assert, DB_ALIGN, DB_PAGESIZE, MAX_ALIGNMENT, qmgr_temp_file::membuf, qmgr_temp_file::membuf_last, qmgr_temp_file::membuf_npages, NULL, QMGR_MEMBUF_PAGE, QMGR_TEMP_FILE_PAGE, and QMGR_UNKNOWN_PAGE.
Referenced by qmgr_free_old_page(), and qmgr_set_dirty_page().
QMGR_QUERY_ENTRY* qmgr_get_query_entry | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id, | ||
int | tran_index | ||
) |
Definition at line 498 of file query_manager.c.
References LOG_FIND_THREAD_TRAN_INDEX, NO_ERROR, NULL, NULL_TRAN_INDEX, qmgr_add_query_entry(), qmgr_allocate_query_entry(), qmgr_find_query_entry(), qmgr_free_query_entry(), qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_id, qmgr_query_table::tran_entries_p, and xsession_load_query_entry_info().
Referenced by qmgr_get_query_sql_user_text(), qmgr_set_query_error(), and xqfile_get_list_file_page().
char* qmgr_get_query_sql_user_text | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id, | ||
int | tran_index | ||
) |
Definition at line 3528 of file query_manager.c.
References NULL, qmgr_get_query_entry(), xasl_cache_ent::sql_info, execution_info::sql_user_text, and qmgr_query_entry::xasl_ent.
Referenced by qexec_execute_query().
struct drand48_data* qmgr_get_rand_buf | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 3488 of file query_manager.c.
References qmgr_rand_buf.
Referenced by fetch_peek_arith(), and qexec_execute_query().
int qmgr_get_sql_id | ( | THREAD_ENTRY * | thread_p, |
char ** | sql_id_buf, | ||
char * | query, | ||
size_t | sql_len | ||
) |
Definition at line 3450 of file query_manager.c.
References ARG_FILE_LINE, assert_release, crypt_md5_buffer_hex(), ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), NO_ERROR, NULL, and QMGR_SQL_ID_LENGTH.
Referenced by er_log_slow_query(), sqmgr_execute_query(), xcache_dump(), and xlogtb_get_pack_tran_table().
|
static |
Definition at line 3274 of file query_manager.c.
References assert, qmgr_temp_file_list::count, qmgr_temp_file_list::list, qmgr_temp_file_list::mutex, qmgr_temp_file::next, NULL, qmgr_temp_file::prev, pthread_mutex_lock, pthread_mutex_unlock, and rv.
Referenced by qmgr_create_new_temp_file().
int qmgr_get_temp_file_membuf_pages | ( | QMGR_TEMP_FILE * | temp_file_p | ) |
Definition at line 3350 of file query_manager.c.
References assert, LOG_FIND_TDES(), log_get_clock_msec(), qmgr_temp_file::membuf_npages, NULL, log_tdes::query_start_time, query_timeout, log_tdes::query_timeout, log_tdes::tran_start_time, log_tdes::xasl_id, XASL_ID_COPY, and XASL_ID_SET_NULL.
Referenced by scan_init_indx_coverage().
|
static |
Definition at line 2559 of file query_manager.c.
References DONT_FREE, NO_ERROR, PAGE_QRESULT, pgbuf_set_dirty(), pgbuf_set_page_ptype(), QFILE_PAGE_HEADER_INITIALIZER, and qmgr_put_page_header().
Referenced by qmgr_get_external_file_page().
int qmgr_initialize | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 850 of file query_manager.c.
References csect_enter, csect_exit, CSECT_QPROC_QUERY_TABLE, ER_FAILED, INF_WAIT, qmgr_temp_file_list::list, logtb_get_number_of_total_tran_indices(), NO_ERROR, NULL, qfile_initialize(), qmgr_allocate_tran_entries(), qmgr_finalize_temp_file_list(), qmgr_initialize_temp_file_list(), qmgr_rand_buf, scan_initialize(), qmgr_query_table::temp_file_list, TEMP_FILE_MEMBUF_KEY_BUFFER, TEMP_FILE_MEMBUF_NORMAL, and qmgr_query_table::tran_entries_p.
Referenced by boot_create_all_volumes(), and boot_restart_server().
|
static |
Definition at line 3203 of file query_manager.c.
References assert, qmgr_temp_file_list::count, i, qmgr_temp_file_list::list, qmgr_temp_file::membuf_npages, qmgr_temp_file::membuf_type, qmgr_temp_file_list::mutex, qmgr_temp_file::next, NULL, qmgr_temp_file::prev, prm_get_integer_value(), PRM_ID_INDEX_SCAN_KEY_BUFFER_PAGES, PRM_ID_TEMP_MEM_BUFFER_PAGES, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, qmgr_allocate_tempfile_with_buffer(), QMGR_IS_VALID_MEMBUF_TYPE, QMGR_TEMP_FILE_FREE_LIST_SIZE, rv, and TEMP_FILE_MEMBUF_NORMAL.
Referenced by qmgr_initialize().
|
static |
Definition at line 610 of file query_manager.c.
References qmgr_tran_entry::free_query_entry_list_p, qmgr_tran_entry::modified_classes_p, NULL, qmgr_tran_entry::num_query_entries, QMGR_TRAN_NULL, qmgr_tran_entry::query_entry_list_p, qmgr_tran_entry::query_id_generator, and qmgr_tran_entry::trans_stat.
Referenced by qmgr_allocate_tran_entries().
|
static |
Definition at line 218 of file query_manager.c.
References prm_get_integer_value(), PRM_ID_LIST_QUERY_CACHE_MODE, QFILE_IS_LIST_CACHE_DISABLED, QFILE_LIST_QUERY_CACHE_MODE_OFF, QFILE_LIST_QUERY_CACHE_MODE_SELECTIVELY_OFF, QFILE_LIST_QUERY_CACHE_MODE_SELECTIVELY_ON, and RESULT_CACHE_REQUIRED.
Referenced by qmgr_create_result_file(), qmgr_process_query(), and xqmgr_execute_query().
|
static |
Definition at line 2071 of file query_manager.c.
References i, oid_block_list::last_oid_idx, qmgr_tran_entry::modified_classes_p, xasl_cache_ent::n_related_objects, oid_block_list::next, xcache_related_object::oid, oid_block_list::oid_array, OID_EQ, xasl_cache_ent::related_objects, and qmgr_query_table::tran_entries_p.
Referenced by xqmgr_execute_query().
|
static |
Definition at line 255 of file query_manager.c.
References QUERY_COMPLETED, and qmgr_query_entry::query_status.
Referenced by xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
|
static |
Definition at line 1122 of file query_manager.c.
References ARG_FILE_LINE, assert, xasl_node::dbval_cnt, ER_ERROR_SEVERITY, er_log_debug, ER_QPROC_INVALID_XASLNODE, er_set(), qmgr_query_entry::errid, free_xasl_unpack_info(), qmgr_query_entry::includes_tde_class, qfile_list_id::last_pgptr, qmgr_query_entry::list_id, NO_ERROR, NULL, qexec_execute_query(), qfile_clone_list_id(), QFILE_FREE_AND_INIT_LIST_ID, qmgr_is_allowed_result_cache(), qmgr_query_entry::query_id, RETURN_GENERATED_KEYS, qfile_list_id::sort_list, stx_map_stream_to_xasl(), XASL_INCLUDES_TDE_CLASS, XASL_IS_FLAGED, XASL_RETURN_GENERATED_KEYS, XASL_SET_FLAG, and XASL_TO_BE_CACHED.
Referenced by xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().
|
static |
Definition at line 238 of file query_manager.c.
References OR_PUT_INT, OR_PUT_SHORT, QFILE_LAST_TUPLE_OFFSET, QFILE_NEXT_PAGE_ID_OFFSET, QFILE_NEXT_VOL_ID_OFFSET, QFILE_OVERFLOW_PAGE_ID_OFFSET, QFILE_OVERFLOW_VOL_ID_OFFSET, QFILE_PAGE_HEADER_SIZE, QFILE_PREV_PAGE_ID_OFFSET, QFILE_PREV_VOL_ID_OFFSET, QFILE_RESERVED_OFFSET, and QFILE_TUPLE_COUNT_OFFSET.
Referenced by qmgr_create_new_temp_file(), qmgr_init_external_file_page(), and qmgr_setup_empty_list_file().
|
static |
Definition at line 3307 of file query_manager.c.
References assert, qmgr_temp_file_list::count, free_and_init, qmgr_temp_file_list::list, qmgr_temp_file::membuf_last, qmgr_temp_file::membuf_type, qmgr_temp_file_list::mutex, qmgr_temp_file::next, NULL, qmgr_temp_file::prev, pthread_mutex_lock, pthread_mutex_unlock, QMGR_IS_VALID_MEMBUF_TYPE, QMGR_TEMP_FILE_FREE_LIST_SIZE, rv, and qmgr_query_table::temp_file_list.
Referenced by qmgr_free_list_temp_file(), and qmgr_free_temp_file_list().
void qmgr_set_dirty_page | ( | THREAD_ENTRY * | thread_p, |
PAGE_PTR | page_p, | ||
int | free_page, | ||
LOG_DATA_ADDR * | addr_p, | ||
QMGR_TEMP_FILE * | tfile_vfid_p | ||
) |
Definition at line 2455 of file query_manager.c.
References assert, FREE, log_skip_logging(), pgbuf_set_dirty(), qmgr_get_page_type(), QMGR_MEMBUF_PAGE, QMGR_TEMP_FILE_PAGE, and QMGR_UNKNOWN_PAGE.
Referenced by qfile_set_dirty_page().
void qmgr_set_query_error | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id | ||
) |
Definition at line 3122 of file query_manager.c.
References assert, BUILDLIST_PROC, er_errid(), qmgr_query_entry::er_msg, er_msg(), qmgr_query_entry::errid, union_proc_node::left, NO_ERROR, NULL, NULL_TRAN_INDEX, xasl_node::proc, qmgr_get_query_entry(), strdup(), xasl_node::type, and xasl_node::union_.
Referenced by qexec_execute_build_columns(), qexec_execute_build_indexes(), qexec_execute_mainblock_internal(), and qexec_execute_query().
void qmgr_setup_empty_list_file | ( | char * | page_p | ) |
Definition at line 3184 of file query_manager.c.
References qfile_page_header::lasttpl_off, qfile_page_header::next_pgid, qfile_page_header::next_volid, NULL_PAGEID, NULL_VOLID, qfile_page_header::ovfl_pgid, qfile_page_header::ovfl_volid, qfile_page_header::pg_tplcnt, qfile_page_header::prev_pgid, qfile_page_header::prev_volid, QFILE_PAGE_HEADER_SIZE, and qmgr_put_page_header().
Referenced by sqfile_get_list_file_page().
int xqmgr_drop_all_query_plans | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2015 of file query_manager.c.
References fpcache_drop_all(), NO_ERROR, and xcache_drop_all().
Referenced by qmgr_drop_all_query_plans(), and sqmgr_drop_all_query_plans().
void xqmgr_dump_query_cache | ( | THREAD_ENTRY * | thread_p, |
FILE * | out_fp | ||
) |
Definition at line 2040 of file query_manager.c.
References qfile_dump_list_cache_internal().
Referenced by qmgr_dump_query_cache(), and sqmgr_dump_query_cache().
void xqmgr_dump_query_plans | ( | THREAD_ENTRY * | thread_p, |
FILE * | out_fp | ||
) |
Definition at line 2028 of file query_manager.c.
References fpcache_dump(), and xcache_dump().
Referenced by qmgr_dump_query_plans(), and sqmgr_dump_query_plans().
int xqmgr_end_query | ( | THREAD_ENTRY * | thread_p, |
QUERY_ID | query_id | ||
) |
Definition at line 1953 of file query_manager.c.
References ARG_FILE_LINE, assert, ER_FAILED, ER_QPROC_UNKNOWN_QUERYID, er_set(), ER_WARNING_SEVERITY, qmgr_query_entry::is_holdable, qmgr_query_entry::list_ent, qmgr_query_entry::list_id, LOG_FIND_THREAD_TRAN_INDEX, NO_ERROR, NULL, qfile_end_use_of_list_cache_entry(), QFILE_FREE_AND_INIT_LIST_ID, qmgr_delete_query_entry(), qmgr_find_query_entry(), qmgr_free_query_temp_file(), QUERY_COMPLETED, qmgr_tran_entry::query_entry_list_p, qmgr_query_entry::query_id, qmgr_query_entry::query_status, rc, qmgr_query_table::tran_entries_p, qmgr_query_entry::xasl_ent, qmgr_query_entry::xasl_id, XASL_ID_SET_NULL, xsession_clear_query_entry_info(), and xsession_remove_query_entry_info().
Referenced by qmgr_end_query(), sqmgr_end_query(), stran_server_auto_commit_or_abort(), and stran_server_commit().
QFILE_LIST_ID* xqmgr_execute_query | ( | THREAD_ENTRY * | thread_p, |
const XASL_ID * | xasl_id_p, | ||
QUERY_ID * | query_id_p, | ||
int | dbval_count, | ||
void * | dbval_p, | ||
QUERY_FLAG * | flag_p, | ||
CACHE_TIME * | client_cache_time_p, | ||
CACHE_TIME * | server_cache_time_p, | ||
int | query_timeout, | ||
xasl_cache_ent ** | ret_cache_entry_p | ||
) |
Definition at line 1243 of file query_manager.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR, CACHE_TIME_AS_ARGS, CACHE_TIME_MAKE, CACHE_TIME_RESET, copy_bind_value_to_tdes(), db_private_alloc, db_private_free, db_private_free_and_init, DO_NOT_COLLECT_EXEC_STATS, ER_ERROR_SEVERITY, er_log_debug, ER_QM_QENTRY_RUNOUT, ER_QPROC_INVALID_XASLNODE, er_set(), FILE_QUERY_AREA, i, qmgr_query_entry::is_holdable, IS_IN_METHOD_OR_JSP_CALL, IS_TRIGGER_INVOLVED, IS_XASL_CACHE_PINNED_REFERENCE, IS_XASL_TRACE_JSON, IS_XASL_TRACE_TEXT, qfile_list_id::last_pgptr, qmgr_query_entry::list_ent, xasl_cache_ent::list_ht_no, qfile_list_cache_entry::list_id, qmgr_query_entry::list_id, LOG_FIND_THREAD_TRAN_INDEX, NO_ERROR, NULL, or_unpack_db_value(), perfmon_inc_stat(), pr_clear_value(), pr_valstring(), PSTAT_PC_NUM_INVALID_XASL_ID, qfile_clone_list_id(), qfile_destroy_list(), qfile_duplicate_list(), qfile_end_use_of_list_cache_entry(), QFILE_FLAG_RESULT_FILE, QFILE_FREE_AND_INIT_LIST_ID, qfile_lookup_list_cache_entry(), qfile_update_list_cache_entry(), qmgr_add_query_entry(), qmgr_allocate_query_entry(), qmgr_delete_query_entry(), qmgr_free_query_temp_file(), qmgr_is_allowed_result_cache(), qmgr_is_related_class_modified(), qmgr_mark_query_as_completed(), QMGR_MAX_QUERY_ENTRY_PER_TRAN, qmgr_process_query(), QMGR_TRAN_NULL, QMGR_TRAN_RUNNING, QMGR_TRAN_TERMINATED, qmgr_query_entry::query_flag, qmgr_query_entry::query_id, qfile_list_id::query_id, QUERY_IN_PROGRESS, qmgr_query_entry::query_status, QUERY_TRACE_JSON, QUERY_TRACE_TEXT, RESULT_HOLDABLE, session_set_trigger_state(), xasl_id::sha1, SHA1_AS_ARGS, db_value_array::size, qmgr_temp_file::temp_file_type, qfile_list_id::tfile_vfid, thread_get_recursion_depth(), thread_set_trace_format(), thread_trace_on(), qfile_list_cache_entry::time_created, xasl_id::time_stored, qmgr_query_table::tran_entries_p, qmgr_tran_entry::trans_stat, db_value_array::vals, xasl_clone::xasl, xasl_clone::xasl_buf, XASL_CLONE_INITIALIZER, qmgr_query_entry::xasl_ent, qmgr_query_entry::xasl_id, XASL_ID_COPY, xcache_can_entry_cache_list(), xcache_find_xasl_id_for_execute(), xcache_retire_clone(), and xcache_unfix().
Referenced by qmgr_execute_query(), and sqmgr_execute_query().
QFILE_LIST_ID* xqmgr_prepare_and_execute_query | ( | THREAD_ENTRY * | thread_p, |
char * | xasl_stream, | ||
int | xasl_stream_size, | ||
QUERY_ID * | query_id_p, | ||
int | dbval_count, | ||
void * | dbval_p, | ||
QUERY_FLAG * | flag_p, | ||
int | query_timeout | ||
) |
Definition at line 1739 of file query_manager.c.
References ARG_FILE_LINE, assert, db_private_alloc, db_private_free_and_init, DO_NOT_COLLECT_EXEC_STATS, ER_ERROR_SEVERITY, er_log_debug, ER_QM_QENTRY_RUNOUT, er_set(), i, qmgr_query_entry::is_holdable, IS_TRIGGER_INVOLVED, IS_XASL_TRACE_JSON, IS_XASL_TRACE_TEXT, qmgr_query_entry::list_ent, LOG_FIND_THREAD_TRAN_INDEX, NO_ERROR, NULL, or_unpack_db_value(), pr_clear_value(), QFILE_FREE_AND_INIT_LIST_ID, qmgr_add_query_entry(), qmgr_allocate_query_entry(), qmgr_delete_query_entry(), qmgr_free_query_temp_file(), qmgr_mark_query_as_completed(), QMGR_MAX_QUERY_ENTRY_PER_TRAN, qmgr_process_query(), QMGR_TRAN_NULL, QMGR_TRAN_RUNNING, QMGR_TRAN_TERMINATED, qmgr_query_entry::query_flag, qmgr_query_entry::query_id, QUERY_IN_PROGRESS, qmgr_query_entry::query_status, QUERY_TRACE_JSON, QUERY_TRACE_TEXT, RESULT_HOLDABLE, session_set_trigger_state(), thread_get_recursion_depth(), thread_set_trace_format(), thread_trace_on(), qmgr_query_table::tran_entries_p, qmgr_tran_entry::trans_stat, qmgr_query_entry::xasl_ent, qmgr_query_entry::xasl_id, and XASL_ID_SET_NULL.
Referenced by qmgr_prepare_and_execute_query(), and sqmgr_prepare_and_execute_query().
int xqmgr_prepare_query | ( | THREAD_ENTRY * | thread_p, |
COMPILE_CONTEXT * | context, | ||
xasl_stream * | stream | ||
) |
Definition at line 948 of file query_manager.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, xasl_stream::buffer, db_private_alloc, db_private_free_and_init, ER_ERROR_SEVERITY, ER_FAILED, ER_GENERIC_ERROR, er_set(), i, NO_ERROR, NULL, or_unpack_int(), or_unpack_oid(), p, qfile_load_xasl_node_header(), compile_context::recompile_xasl, compile_context::sha1, XASL_CACHE_RECOMPILE_NOT_NEEDED, XASL_CACHE_RECOMPILE_PREPARE, XASL_CACHE_SEARCH_FOR_PREPARE, xasl_stream::xasl_header, xasl_cache_ent::xasl_id, xasl_stream::xasl_id, XASL_ID_COPY, XASL_ID_SET_NULL, xcache_find_sha1(), xcache_insert(), and xcache_unfix().
Referenced by qmgr_prepare_query(), and sqmgr_prepare_query().
int method_Num_method_jsp_calls |
Definition at line 54 of file method_scan.c.
Referenced by method_receive_results_for_stand_alone().
QMGR_QUERY_TABLE qmgr_Query_table |
Definition at line 135 of file query_manager.c.
|
static |
Definition at line 140 of file query_manager.c.
Referenced by qmgr_get_rand_buf(), and qmgr_initialize().