CUBRID Engine  latest
xserver_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * xserver_interface.h - Server interface functions
22  *
23  * Note: This file defines the interface to the server. The client modules that
24  * calls any function in the server should include this module instead of the
25  * header file of the desired function.
26  */
27 
28 #ifndef _XSERVER_INTERFACE_H_
29 #define _XSERVER_INTERFACE_H_
30 
31 #ident "$Id$"
32 
33 #if !defined (SERVER_MODE) && !defined (SA_MODE)
34 #error Belongs to server module
35 #endif /* !defined (SERVER_MODE) && !defined (SA_MODE) */
36 
37 #include "boot.h"
38 #include "config.h"
39 #include "error_manager.h"
40 #include "file_io.h"
41 #include "intl_support.h"
42 #include "locator.h"
43 #include "log_comm.h"
44 #include "log_lsa.hpp"
45 #include "query_list.h"
46 #include "query_manager.h"
47 #include "perf_monitor.h"
48 #include "replication.h"
49 #include "storage_common.h"
50 #include "thread_compat.hpp"
51 
52 // forward definitions
53 struct compile_context;
54 struct xasl_cache_ent;
55 struct xasl_stream;
56 struct xasl_node_header;
57 
58 extern int xboot_initialize_server (const BOOT_CLIENT_CREDENTIAL * client_credential, BOOT_DB_PATH_INFO * db_path_info,
59  bool db_overwrite, const char *file_addmore_vols, volatile DKNPAGES db_npages,
60  PGLENGTH db_desired_pagesize, volatile DKNPAGES xlog_npages,
61  PGLENGTH db_desired_log_page_size, OID * rootclass_oid, HFID * rootclass_hfid,
62  int client_lock_wait, TRAN_ISOLATION client_isolation);
63 extern const char *xboot_get_server_session_key (void);
64 extern int xboot_register_client (THREAD_ENTRY * thread_p, BOOT_CLIENT_CREDENTIAL * client_credential,
65  int client_lock_wait, TRAN_ISOLATION client_isolation, TRAN_STATE * tran_state,
66  BOOT_SERVER_CREDENTIAL * server_credential);
67 extern int xboot_unregister_client (REFPTR (THREAD_ENTRY, thread_p), int tran_index);
68 extern int xboot_backup (THREAD_ENTRY * thread_p, const char *backup_path, FILEIO_BACKUP_LEVEL backup_level,
69  bool delete_unneeded_logarchives, const char *backup_verbose_file, int num_threads,
70  FILEIO_ZIP_METHOD zip_method, FILEIO_ZIP_LEVEL zip_level, int skip_activelog, int sleep_msecs,
71  bool separate_keys);
72 extern DISK_ISVALID xboot_checkdb_table (THREAD_ENTRY * thread_p, int check_flag, OID * oid, BTID * index_btid);
73 extern int xboot_check_db_consistency (THREAD_ENTRY * thread_p, int check_flag, OID * oids, int num_oids,
74  BTID * index_btid);
75 extern VOLID xboot_add_volume_extension (THREAD_ENTRY * thread_p, DBDEF_VOL_EXT_INFO * ext_info);
77 extern int xboot_find_number_temp_volumes (THREAD_ENTRY * thread_p);
78 extern VOLID xboot_find_last_permanent (THREAD_ENTRY * thread_p);
79 extern VOLID xboot_peek_last_permanent (THREAD_ENTRY * thread_p);
80 extern VOLID xboot_find_last_temp (THREAD_ENTRY * thread_p);
81 
82 extern LC_FIND_CLASSNAME xlocator_reserve_class_names (THREAD_ENTRY * thread_p, const int num_classes,
83  const char **classname, OID * class_oid);
84 extern int xlocator_get_reserved_class_name_oid (THREAD_ENTRY * thread_p, const char *classname, OID * class_oid);
85 extern LC_FIND_CLASSNAME xlocator_delete_class_name (THREAD_ENTRY * thread_p, const char *classname);
86 extern LC_FIND_CLASSNAME xlocator_rename_class_name (THREAD_ENTRY * thread_p, const char *oldname, const char *newname,
87  OID * class_oid);
88 extern LC_FIND_CLASSNAME xlocator_find_class_oid (THREAD_ENTRY * thread_p, const char *classname, OID * class_oid,
89  LOCK lock);
90 extern int xlocator_assign_oid (THREAD_ENTRY * thread_p, const HFID * hfid, OID * perm_oid, int expected_length,
91  OID * class_oid, const char *classname);
92 extern int xlocator_fetch (THREAD_ENTRY * thrd, OID * oid, int chn, LOCK lock,
93  LC_FETCH_VERSION_TYPE fetch_version_type, LC_FETCH_VERSION_TYPE initial_fetch_version_type,
94  OID * class_oid, int class_chn, int prefetching, LC_COPYAREA ** fetch_area);
95 extern int xlocator_get_class (THREAD_ENTRY * thread_p, OID * class_oid, int class_chn, const OID * oid, LOCK lock,
96  int prefetching, LC_COPYAREA ** fetch_area);
97 extern int xlocator_fetch_all (THREAD_ENTRY * thread_p, const HFID * hfid, LOCK * lock,
98  LC_FETCH_VERSION_TYPE fetch_type, OID * class_oid, int *nobjects, int *nfetched,
99  OID * last_oid, LC_COPYAREA ** fetch_area);
100 extern int xlocator_lock_and_fetch_all (THREAD_ENTRY * thread_p, const HFID * hfid, LOCK * instance_lock,
101  int *instance_lock_timeout, OID * class_oid, LOCK * class_lock, int *nobjects,
102  int *nfetched, int *nfailed_instance_locks, OID * last_oid,
103  LC_COPYAREA ** fetch_area, MVCC_SNAPSHOT * mvcc_snapshot);
104 extern int xlocator_fetch_lockset (THREAD_ENTRY * thread_p, LC_LOCKSET * lockset, LC_COPYAREA ** fetch_area);
105 extern int xlocator_fetch_all_reference_lockset (THREAD_ENTRY * thread_p, OID * oid, int chn, OID * class_oid,
106  int class_chn, LOCK lock, int quit_on_errors, int prune_level,
107  LC_LOCKSET ** lockset, LC_COPYAREA ** fetch_area);
108 extern LC_FIND_CLASSNAME xlocator_find_lockhint_class_oids (THREAD_ENTRY * thread_p, int num_classes,
109  const char **many_classnames, LOCK * many_locks,
110  int *many_need_subclasses, LC_PREFETCH_FLAGS * many_flags,
111  OID * guessed_class_oids, int *guessed_class_chns,
112  bool quit_on_errors, LC_LOCKHINT ** hlock,
113  LC_COPYAREA ** fetch_area);
114 extern int xlocator_fetch_lockhint_classes (THREAD_ENTRY * thread_p, LC_LOCKHINT * lockhint, LC_COPYAREA ** fetch_area);
115 extern int xlocator_does_exist (THREAD_ENTRY * thread_p, OID * oid, int chn, LOCK lock,
116  LC_FETCH_VERSION_TYPE fetch_version_type, OID * class_oid, int class_chn,
117  int need_fetching, int prefetching, LC_COPYAREA ** fetch_area);
118 extern int xlocator_force (THREAD_ENTRY * thread_p, LC_COPYAREA * copy_area, int num_ignore_error_list,
119  int *ignore_error_list);
120 extern int xlocator_repl_force (THREAD_ENTRY * thread_p, LC_COPYAREA * copy_area, LC_COPYAREA ** reply_area);
121 extern bool xlocator_notify_isolation_incons (THREAD_ENTRY * thread_p, LC_COPYAREA ** synch_area);
122 
123 extern int xlocator_assign_oid_batch (THREAD_ENTRY * thread_p, LC_OIDSET * oidset);
124 extern int xlocator_remove_class_from_index (THREAD_ENTRY * thread_p, OID * oid, BTID * btid, HFID * hfid);
125 
126 extern int xlocator_check_fk_validity (THREAD_ENTRY * thread_p, OID * cls_oid, HFID * hfid, TP_DOMAIN * key_type,
127  int n_attrs, int *attr_ids, OID * pk_cls_oid, BTID * pk_btid, char *fk_name);
128 extern LOG_LSA *xrepl_log_get_append_lsa (void);
129 extern int xrepl_set_info (THREAD_ENTRY * thread_p, REPL_INFO * repl_info);
130 
131 extern int xheap_create (THREAD_ENTRY * thread_p, HFID * hfid, const OID * class_oid, bool reuse_oid);
132 extern int xheap_destroy (THREAD_ENTRY * thread_p, const HFID * hfid, const OID * class_oid);
133 extern int xheap_destroy_newly_created (THREAD_ENTRY * thread_p, const HFID * hfid, const OID * class_oid);
134 
135 extern int xfile_apply_tde_to_class_files (THREAD_ENTRY * thread_p, const OID * class_oid);
136 
137 extern int xtde_get_mk_info (THREAD_ENTRY * thread_p, int *mk_index, time_t * created_time, time_t * set_time);
138 extern int xtde_change_mk_without_flock (THREAD_ENTRY * thread_p, const int mk_index);
139 
140 extern TRAN_STATE xtran_server_commit (THREAD_ENTRY * thrd, bool retain_lock);
142 extern int xtran_server_start_topop (THREAD_ENTRY * thread_p, LOG_LSA * topop_lsa);
143 extern TRAN_STATE xtran_server_end_topop (THREAD_ENTRY * thread_p, LOG_RESULT_TOPOP result, LOG_LSA * topop_lsa);
144 extern int xtran_server_savepoint (THREAD_ENTRY * thread_p, const char *savept_name, LOG_LSA * savept_lsa);
145 extern TRAN_STATE xtran_server_partial_abort (THREAD_ENTRY * thread_p, const char *savept_name, LOG_LSA * savept_lsa);
146 extern int xtran_server_set_global_tran_info (THREAD_ENTRY * thread_p, int gtrid, void *info, int size);
147 extern int xtran_server_get_global_tran_info (THREAD_ENTRY * thread_p, int gtrid, void *buffer, int size);
148 extern int xtran_server_2pc_start (THREAD_ENTRY * thread_p);
150 extern int xtran_server_2pc_recovery_prepared (THREAD_ENTRY * thread_p, int gtrids[], int size);
151 extern int xtran_server_2pc_attach_global_tran (THREAD_ENTRY * thread_p, int gtrid);
152 extern TRAN_STATE xtran_server_2pc_prepare_global_tran (THREAD_ENTRY * thread_p, int gtrid);
153 extern bool xtran_is_blocked (THREAD_ENTRY * thread_p, int tran_index);
154 extern bool xtran_server_has_updated (THREAD_ENTRY * thread_p);
156 extern int xtran_wait_server_active_trans (THREAD_ENTRY * thrd);
157 extern int xtran_lock_rep_read (THREAD_ENTRY * thread_p, LOCK lock_rr_tran);
158 
159 extern void xlogtb_set_interrupt (THREAD_ENTRY * thread_p, int set);
160 extern void xlogtb_set_suppress_repl_on_transaction (THREAD_ENTRY * thread_p, int set);
161 
162 extern int xlogtb_reset_wait_msecs (THREAD_ENTRY * thread_p, int wait_msecs);
163 extern int xlogtb_reset_isolation (THREAD_ENTRY * thread_p, TRAN_ISOLATION isolation);
164 
165 extern LOG_LSA *log_get_final_restored_lsa (void);
166 extern float log_get_db_compatibility (void);
167 extern int log_set_no_logging (void);
168 extern bool logtb_has_updated (THREAD_ENTRY * thread_p);
169 
170 
171 extern BTID *xbtree_add_index (THREAD_ENTRY * thread_p, BTID * btid, TP_DOMAIN * key_type, OID * class_oid, int attr_id,
172  int unique_pk, int num_oids, int num_nulls, int num_keys);
173 extern BTID *xbtree_load_index (THREAD_ENTRY * thread_p, BTID * btid, const char *bt_name, TP_DOMAIN * key_type,
174  OID * class_oids, int n_classes, int n_attrs, int *attr_ids, int *attrs_prefix_length,
175  HFID * hfids, int unique_pk, int not_null_flag, OID * fk_refcls_oid,
176  BTID * fk_refcls_pk_btid, const char *fk_name, char *pred_stream, int pred_stream_size,
177  char *expr_stream, int expr_steram_size, int func_col_id, int func_attr_index_start);
178 extern BTID *xbtree_load_online_index (THREAD_ENTRY * thread_p, BTID * btid, const char *bt_name, TP_DOMAIN * key_type,
179  OID * class_oids, int n_classes, int n_attrs, int *attr_ids,
180  int *attrs_prefix_length, HFID * hfids, int unique_pk, int not_null_flag,
181  OID * fk_refcls_oid, BTID * fk_refcls_pk_btid, const char *fk_name,
182  char *pred_stream, int pred_stream_size, char *expr_stream, int expr_steram_size,
183  int func_col_id, int func_attr_index_start, int ib_thread_count);
184 
185 extern int xbtree_delete_index (THREAD_ENTRY * thread_p, BTID * btid);
186 extern BTREE_SEARCH xbtree_find_unique (THREAD_ENTRY * thread_p, BTID * btid, SCAN_OPERATION_TYPE scan_op_type,
187  DB_VALUE * key, OID * class_oid, OID * oid, bool is_all_class_srch);
188 extern int xbtree_class_test_unique (THREAD_ENTRY * thread_p, char *buf, int buf_size);
189 extern BTREE_SEARCH xbtree_find_multi_uniques (THREAD_ENTRY * thread_p, OID * class_oid, int pruning_type, BTID * btids,
190  DB_VALUE * values, int count, SCAN_OPERATION_TYPE op_type, OID ** oids,
191  int *oids_count);
192 extern EHID *xehash_create (THREAD_ENTRY * thread_p, EHID * ehid, DB_TYPE key_type, int exp_num_entries,
193  OID * class_oid, int attr_id, bool is_tmp);
194 extern int xehash_destroy (THREAD_ENTRY * thread_p, EHID * ehid);
195 
196 extern char *xstats_get_statistics_from_server (THREAD_ENTRY * thread_p, OID * class_id, unsigned int timestamp,
197  int *length);
198 extern int xstats_update_statistics (THREAD_ENTRY * thread_p, OID * classoid, bool with_fullscan);
199 extern int xstats_update_all_statistics (THREAD_ENTRY * thread_p, bool with_fullscan);
200 
201 extern DKNPAGES xdisk_get_total_numpages (THREAD_ENTRY * thread_p, VOLID volid);
202 extern DKNPAGES xdisk_get_free_numpages (THREAD_ENTRY * thread_p, VOLID volid);
203 extern bool xdisk_is_volume_exist (THREAD_ENTRY * thread_p, VOLID volid);
204 
205 extern char *xdisk_get_remarks (THREAD_ENTRY * thread_p, VOLID volid);
206 extern int disk_get_boot_db_charset (THREAD_ENTRY * thread_p, INT16 volid, INTL_CODESET * db_charset);
207 extern char *xdisk_get_fullname (THREAD_ENTRY * thread_p, VOLID volid, char *vol_fullname);
208 extern DISK_VOLPURPOSE xdisk_get_purpose (THREAD_ENTRY * thread_p, VOLID volid);
209 extern int xdisk_get_purpose_and_space_info (THREAD_ENTRY * thread_p, VOLID volid, DISK_VOLPURPOSE * vol_purpose,
210  DISK_VOLUME_SPACE_INFO * space_info);
211 
212 extern int xqfile_get_list_file_page (THREAD_ENTRY * thread_p, QUERY_ID query_id, VOLID volid, PAGEID pageid,
213  char *page_bufp, int *page_sizep);
214 
215 /* new query interface */
216 extern int xqmgr_prepare_query (THREAD_ENTRY * thrd, compile_context * ctx, xasl_stream * stream);
217 
218 extern QFILE_LIST_ID *xqmgr_execute_query (THREAD_ENTRY * thrd, const XASL_ID * xasl_id, QUERY_ID * query_idp,
219  int dbval_cnt, void *data, QUERY_FLAG * flagp, CACHE_TIME * clt_cache_time,
220  CACHE_TIME * srv_cache_time, int query_timeout,
221  xasl_cache_ent ** ret_cache_entry_p);
222 extern QFILE_LIST_ID *xqmgr_prepare_and_execute_query (THREAD_ENTRY * thrd, char *xasl_stream, int xasl_stream_size,
223  QUERY_ID * query_id, int dbval_cnt, void *data,
224  QUERY_FLAG * flag, int query_timeout);
225 extern int xqmgr_end_query (THREAD_ENTRY * thrd, QUERY_ID query_id);
226 extern int xqmgr_drop_all_query_plans (THREAD_ENTRY * thread_p);
227 extern void xqmgr_dump_query_plans (THREAD_ENTRY * thread_p, FILE * outfp);
228 extern void xqmgr_dump_query_cache (THREAD_ENTRY * thread_p, FILE * outfp);
229 
230 /* server execution statistics */
231 extern void xperfmon_server_copy_stats (THREAD_ENTRY * thread_p, UINT64 * to_stats);
232 extern void xperfmon_server_copy_global_stats (UINT64 * to_stats);
233 /* catalog manager interface */
234 
235 extern int xcatalog_check_rep_dir (THREAD_ENTRY * thread_p, OID * class_id, OID * rep_dir_p);
236 
237 extern int xacl_reload (THREAD_ENTRY * thread_p);
238 extern void xacl_dump (THREAD_ENTRY * thread_p, FILE * outfp);
239 extern void xlock_dump (THREAD_ENTRY * thread_p, FILE * outfp);
240 
241 extern int xlogtb_get_pack_tran_table (THREAD_ENTRY * thread_p, char **buffer_p, int *size_p,
242  int include_query_exec_info);
243 
244 extern int xboot_compact_db (THREAD_ENTRY * thread_p, OID * class_oids, int n_classes, int space_to_process,
245  int instance_lock_timeout, int class_lock_timeout, bool delete_old_repr,
246  OID * last_processed_class_oid, OID * last_processed_oid, int *total_objects,
247  int *failed_objects, int *modified_objects, int *big_objects, int *initial_last_repr_id);
248 
249 extern int xboot_heap_compact (THREAD_ENTRY * thread_p, OID * class_oid);
250 
251 extern int xboot_compact_start (THREAD_ENTRY * thread_p);
252 extern int xboot_compact_stop (THREAD_ENTRY * thread_p);
253 
254 extern int xlocator_upgrade_instances_domain (THREAD_ENTRY * thread_p, OID * class_oid, int att_id);
255 
256 extern int xsession_create_new (THREAD_ENTRY * thread_p, SESSION_ID * id);
257 extern int xsession_check_session (THREAD_ENTRY * thread_p, const SESSION_ID id);
258 extern int xsession_end_session (THREAD_ENTRY * thread, const SESSION_ID id);
259 
260 extern int xsession_set_row_count (THREAD_ENTRY * thread_p, int row_count);
261 extern int xsession_get_row_count (THREAD_ENTRY * thread_p, int *row_count);
262 extern int xsession_set_cur_insert_id (THREAD_ENTRY * thread_p, const DB_VALUE * value, bool force);
263 extern int xsession_get_last_insert_id (THREAD_ENTRY * thread_p, DB_VALUE * value, bool update_last_insert_id);
264 extern int xsession_reset_cur_insert_id (THREAD_ENTRY * thread_p);
265 
266 extern int xsession_create_prepared_statement (THREAD_ENTRY * thread_p, char *name, char *alias_print, SHA1Hash * sha1,
267  char *info, int info_len);
268 extern int xsession_get_prepared_statement (THREAD_ENTRY * thread_p, const char *name, char **info, int *info_len,
269  XASL_ID * xasl_id, xasl_node_header * xasl_header_p);
270 extern int xsession_delete_prepared_statement (THREAD_ENTRY * thread_p, const char *name);
271 
272 extern int xlogin_user (THREAD_ENTRY * thread_p, const char *username);
273 
274 extern int xsession_set_session_variables (THREAD_ENTRY * thread_p, DB_VALUE * values, const int count);
275 extern int xsession_get_session_variable (THREAD_ENTRY * thread_p, const DB_VALUE * name, DB_VALUE * value);
276 extern int xsession_get_session_variable_no_copy (THREAD_ENTRY * thread_p, const DB_VALUE * name, DB_VALUE ** value);
277 extern int xsession_drop_session_variables (THREAD_ENTRY * thread_p, DB_VALUE * values, const int count);
278 extern void xsession_store_query_entry_info (THREAD_ENTRY * thread_p, QMGR_QUERY_ENTRY * qentry_p);
279 extern int xsession_load_query_entry_info (THREAD_ENTRY * thread_p, QMGR_QUERY_ENTRY * qentry_p);
280 extern int xsession_remove_query_entry_info (THREAD_ENTRY * thread_p, const QUERY_ID query_id);
281 extern int xsession_clear_query_entry_info (THREAD_ENTRY * thread_p, const QUERY_ID query_id);
282 
284  const OID * class_oidp);
285 extern bool xlogtb_does_active_user_exist (THREAD_ENTRY * thread_p, const char *user_name);
286 extern int xlocator_demote_class_lock (THREAD_ENTRY * thread_p, const OID * class_oid, LOCK lock, LOCK * ex_lock);
287 extern bool xtran_should_connection_reset (THREAD_ENTRY * thread_p, bool has_updated);
288 extern int xsession_set_tran_auto_commit (THREAD_ENTRY * thread_p, bool auto_commit);
289 #endif /* _XSERVER_INTERFACE_H_ */
TRAN_STATE xtran_server_2pc_prepare_global_tran(THREAD_ENTRY *thread_p, int gtrid)
LC_FIND_CLASSNAME xlocator_delete_class_name(THREAD_ENTRY *thread_p, const char *classname)
Definition: locator_sr.c:755
LC_FETCH_VERSION_TYPE
Definition: locator.h:178
bool xlocator_notify_isolation_incons(THREAD_ENTRY *thread_p, LC_COPYAREA **synch_area)
Definition: locator_sr.c:9132
Definition: sha1.h:50
int xsession_delete_prepared_statement(THREAD_ENTRY *thread_p, const char *name)
Definition: session_sr.c:233
int xboot_compact_start(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:5886
int xsession_remove_query_entry_info(THREAD_ENTRY *thread_p, const QUERY_ID query_id)
Definition: session_sr.c:343
int xsession_get_prepared_statement(THREAD_ENTRY *thread_p, const char *name, char **info, int *info_len, XASL_ID *xasl_id, xasl_node_header *xasl_header_p)
Definition: session_sr.c:190
void xsession_store_query_entry_info(THREAD_ENTRY *thread_p, QMGR_QUERY_ENTRY *qentry_p)
Definition: session_sr.c:318
int xdisk_get_purpose_and_space_info(THREAD_ENTRY *thread_p, VOLID volid, DISK_VOLPURPOSE *vol_purpose, DISK_VOLUME_SPACE_INFO *space_info)
int xboot_check_db_consistency(THREAD_ENTRY *thread_p, int check_flag, OID *oids, int num_oids, BTID *index_btid)
Definition: boot_sr.c:3713
int xacl_reload(THREAD_ENTRY *thread_p)
int xlocator_fetch_lockhint_classes(THREAD_ENTRY *thread_p, LC_LOCKHINT *lockhint, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:11291
int xboot_heap_compact(THREAD_ENTRY *thread_p, OID *class_oid)
Definition: boot_sr.c:5876
PAGEID DKNPAGES
DB_TYPE
Definition: dbtype_def.h:670
int xsession_get_row_count(THREAD_ENTRY *thread_p, int *row_count)
Definition: session_sr.c:91
int xfile_apply_tde_to_class_files(THREAD_ENTRY *thread_p, const OID *class_oid)
TRAN_STATE xtran_server_partial_abort(THREAD_ENTRY *thread_p, const char *savept_name, LOG_LSA *savept_lsa)
#define DISK_VOLPURPOSE
char * xdisk_get_remarks(THREAD_ENTRY *thread_p, VOLID volid)
int xboot_register_client(THREAD_ENTRY *thread_p, BOOT_CLIENT_CREDENTIAL *client_credential, int client_lock_wait, TRAN_ISOLATION client_isolation, TRAN_STATE *tran_state, BOOT_SERVER_CREDENTIAL *server_credential)
Definition: boot_sr.c:3179
LOG_LSA * xrepl_log_get_append_lsa(void)
Definition: locator_sr.c:11669
DISK_ISVALID xboot_checkdb_table(THREAD_ENTRY *thread_p, int check_flag, OID *oid, BTID *index_btid)
Definition: boot_sr.c:3587
int xcatalog_check_rep_dir(THREAD_ENTRY *thread_p, OID *class_id, OID *rep_dir_p)
int xehash_destroy(THREAD_ENTRY *thread_p, EHID *ehid)
int xlocator_force(THREAD_ENTRY *thread_p, LC_COPYAREA *copy_area, int num_ignore_error_list, int *ignore_error_list)
Definition: locator_sr.c:6983
BTID * xbtree_add_index(THREAD_ENTRY *thread_p, BTID *btid, TP_DOMAIN *key_type, OID *class_oid, int attr_id, int unique_pk, int num_oids, int num_nulls, int num_keys)
Definition: btree.c:5579
int xtran_server_start_topop(THREAD_ENTRY *thread_p, LOG_LSA *topop_lsa)
int xrepl_set_info(THREAD_ENTRY *thread_p, REPL_INFO *repl_info)
Definition: locator_sr.c:11642
INT16 VOLID
VOLID xboot_find_last_permanent(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:377
BTREE_SEARCH xbtree_find_multi_uniques(THREAD_ENTRY *thread_p, OID *class_oid, int pruning_type, BTID *btids, DB_VALUE *values, int count, SCAN_OPERATION_TYPE op_type, OID **oids, int *oids_count)
Definition: btree.c:5848
TRAN_STATE xtran_server_commit(THREAD_ENTRY *thrd, bool retain_lock)
bool xtran_should_connection_reset(THREAD_ENTRY *thread_p, bool has_updated)
int xbtree_delete_index(THREAD_ENTRY *thread_p, BTID *btid)
Definition: btree.c:5691
int xqmgr_end_query(THREAD_ENTRY *thrd, QUERY_ID query_id)
int xlocator_fetch_all(THREAD_ENTRY *thread_p, const HFID *hfid, LOCK *lock, LC_FETCH_VERSION_TYPE fetch_type, OID *class_oid, int *nobjects, int *nfetched, OID *last_oid, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:2773
int xtran_server_2pc_attach_global_tran(THREAD_ENTRY *thread_p, int gtrid)
int xtran_server_set_global_tran_info(THREAD_ENTRY *thread_p, int gtrid, void *info, int size)
int xboot_initialize_server(const BOOT_CLIENT_CREDENTIAL *client_credential, BOOT_DB_PATH_INFO *db_path_info, bool db_overwrite, const char *file_addmore_vols, volatile DKNPAGES db_npages, PGLENGTH db_desired_pagesize, volatile DKNPAGES xlog_npages, PGLENGTH db_desired_log_page_size, OID *rootclass_oid, HFID *rootclass_hfid, int client_lock_wait, TRAN_ISOLATION client_isolation)
Definition: boot_sr.c:1462
enum lc_prefetch_flags LC_PREFETCH_FLAGS
Definition: locator.h:339
int xqfile_get_list_file_page(THREAD_ENTRY *thread_p, QUERY_ID query_id, VOLID volid, PAGEID pageid, char *page_bufp, int *page_sizep)
Definition: list_file.c:2200
TRAN_STATE xtran_server_abort(THREAD_ENTRY *thrd)
VOLID xboot_peek_last_permanent(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:396
int xsession_create_new(THREAD_ENTRY *thread_p, SESSION_ID *id)
Definition: session_sr.c:38
int xboot_compact_db(THREAD_ENTRY *thread_p, OID *class_oids, int n_classes, int space_to_process, int instance_lock_timeout, int class_lock_timeout, bool delete_old_repr, OID *last_processed_class_oid, OID *last_processed_oid, int *total_objects, int *failed_objects, int *modified_objects, int *big_objects, int *initial_last_repr_id)
Definition: boot_sr.c:5860
int xsession_get_session_variable(THREAD_ENTRY *thread_p, const DB_VALUE *name, DB_VALUE *value)
Definition: session_sr.c:271
int xboot_find_number_temp_volumes(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:359
int xtde_get_mk_info(THREAD_ENTRY *thread_p, int *mk_index, time_t *created_time, time_t *set_time)
Definition: tde.c:1214
int xlogtb_reset_wait_msecs(THREAD_ENTRY *thread_p, int wait_msecs)
int xlogin_user(THREAD_ENTRY *thread_p, const char *username)
Definition: session_sr.c:245
bool xlogtb_does_active_user_exist(THREAD_ENTRY *thread_p, const char *user_name)
void THREAD_ENTRY
int xlocator_assign_oid_batch(THREAD_ENTRY *thread_p, LC_OIDSET *oidset)
Definition: locator_sr.c:11512
void xlogtb_set_interrupt(THREAD_ENTRY *thread_p, int set)
int xtran_wait_server_active_trans(THREAD_ENTRY *thrd)
LOCK
int xsession_clear_query_entry_info(THREAD_ENTRY *thread_p, const QUERY_ID query_id)
Definition: session_sr.c:357
BTREE_SEARCH xbtree_find_unique(THREAD_ENTRY *thread_p, BTID *btid, SCAN_OPERATION_TYPE scan_op_type, DB_VALUE *key, OID *class_oid, OID *oid, bool is_all_class_srch)
Definition: btree.c:23990
LC_FIND_CLASSNAME xlocator_reserve_class_names(THREAD_ENTRY *thread_p, const int num_classes, const char **classname, OID *class_oid)
Definition: locator_sr.c:409
EHID * xehash_create(THREAD_ENTRY *thread_p, EHID *ehid, DB_TYPE key_type, int exp_num_entries, OID *class_oid, int attr_id, bool is_tmp)
int xboot_compact_stop(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:5896
char * xdisk_get_fullname(THREAD_ENTRY *thread_p, VOLID volid, char *vol_fullname)
int xlocator_does_exist(THREAD_ENTRY *thread_p, OID *oid, int chn, LOCK lock, LC_FETCH_VERSION_TYPE fetch_version_type, OID *class_oid, int class_chn, int need_fetching, int prefetching, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:3891
int xboot_find_number_permanent_volumes(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:341
int xbtree_class_test_unique(THREAD_ENTRY *thread_p, char *buf, int buf_size)
Definition: btree.c:6065
int xlocator_repl_force(THREAD_ENTRY *thread_p, LC_COPYAREA *copy_area, LC_COPYAREA **reply_area)
Definition: locator_sr.c:6781
int log_set_no_logging(void)
Definition: log_manager.c:951
int xlocator_fetch(THREAD_ENTRY *thrd, OID *oid, int chn, LOCK lock, LC_FETCH_VERSION_TYPE fetch_version_type, LC_FETCH_VERSION_TYPE initial_fetch_version_type, OID *class_oid, int class_chn, int prefetching, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:2375
void xqmgr_dump_query_plans(THREAD_ENTRY *thread_p, FILE *outfp)
int xheap_destroy_newly_created(THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid)
Definition: heap_file.c:5818
FILEIO_ZIP_LEVEL
Definition: file_io.h:113
int xchksum_insert_repl_log_and_demote_table_lock(THREAD_ENTRY *thread_p, REPL_INFO *repl_info, const OID *class_oidp)
Definition: locator_sr.c:12560
int xtran_lock_rep_read(THREAD_ENTRY *thread_p, LOCK lock_rr_tran)
int xlocator_assign_oid(THREAD_ENTRY *thread_p, const HFID *hfid, OID *perm_oid, int expected_length, OID *class_oid, const char *classname)
Definition: locator_sr.c:2044
DISK_VOLPURPOSE xdisk_get_purpose(THREAD_ENTRY *thread_p, VOLID volid)
int xlocator_lock_and_fetch_all(THREAD_ENTRY *thread_p, const HFID *hfid, LOCK *instance_lock, int *instance_lock_timeout, OID *class_oid, LOCK *class_lock, int *nobjects, int *nfetched, int *nfailed_instance_locks, OID *last_oid, LC_COPYAREA **fetch_area, MVCC_SNAPSHOT *mvcc_snapshot)
Definition: locator_sr.c:11790
int xlocator_remove_class_from_index(THREAD_ENTRY *thread_p, OID *oid, BTID *btid, HFID *hfid)
Definition: locator_sr.c:8842
LC_FIND_CLASSNAME xlocator_find_class_oid(THREAD_ENTRY *thread_p, const char *classname, OID *class_oid, LOCK lock)
Definition: locator_sr.c:1033
#define REFPTR(T, name)
Definition: porting.h:1089
int xsession_get_last_insert_id(THREAD_ENTRY *thread_p, DB_VALUE *value, bool update_last_insert_id)
Definition: session_sr.c:126
BTREE_SEARCH
DB_TRAN_ISOLATION
Definition: dbtran_def.h:26
int xsession_create_prepared_statement(THREAD_ENTRY *thread_p, char *name, char *alias_print, SHA1Hash *sha1, char *info, int info_len)
Definition: session_sr.c:171
void xlogtb_set_suppress_repl_on_transaction(THREAD_ENTRY *thread_p, int set)
bool logtb_has_updated(THREAD_ENTRY *thread_p)
TRAN_STATE xtran_server_end_topop(THREAD_ENTRY *thread_p, LOG_RESULT_TOPOP result, LOG_LSA *topop_lsa)
int xboot_backup(THREAD_ENTRY *thread_p, const char *backup_path, FILEIO_BACKUP_LEVEL backup_level, bool delete_unneeded_logarchives, const char *backup_verbose_file, int num_threads, FILEIO_ZIP_METHOD zip_method, FILEIO_ZIP_LEVEL zip_level, int skip_activelog, int sleep_msecs, bool separate_keys)
Definition: boot_sr.c:3939
float log_get_db_compatibility(void)
int xheap_create(THREAD_ENTRY *thread_p, HFID *hfid, const OID *class_oid, bool reuse_oid)
Definition: heap_file.c:5772
LOG_LSA * log_get_final_restored_lsa(void)
int xlogtb_reset_isolation(THREAD_ENTRY *thread_p, TRAN_ISOLATION isolation)
int xsession_check_session(THREAD_ENTRY *thread_p, const SESSION_ID id)
Definition: session_sr.c:53
int xtde_change_mk_without_flock(THREAD_ENTRY *thread_p, const int mk_index)
Definition: tde.c:1246
static int total_objects
Definition: compactdb.c:56
LC_FIND_CLASSNAME xlocator_rename_class_name(THREAD_ENTRY *thread_p, const char *oldname, const char *newname, OID *class_oid)
Definition: locator_sr.c:916
int xqmgr_prepare_query(THREAD_ENTRY *thrd, compile_context *ctx, xasl_stream *stream)
DKNPAGES xdisk_get_total_numpages(THREAD_ENTRY *thread_p, VOLID volid)
LC_FIND_CLASSNAME
static int failed_objects
Definition: compactdb.c:57
int xsession_set_session_variables(THREAD_ENTRY *thread_p, DB_VALUE *values, const int count)
Definition: session_sr.c:258
SCAN_OPERATION_TYPE
int xsession_set_cur_insert_id(THREAD_ENTRY *thread_p, const DB_VALUE *value, bool force)
Definition: session_sr.c:106
void xperfmon_server_copy_stats(THREAD_ENTRY *thread_p, UINT64 *to_stats)
int xtran_server_get_global_tran_info(THREAD_ENTRY *thread_p, int gtrid, void *buffer, int size)
void xlock_dump(THREAD_ENTRY *thread_p, FILE *outfp)
int count(int &result, const cub_regex_object &reg, const std::string &src, const int position, const INTL_CODESET codeset)
int xtran_server_is_active_and_has_updated(THREAD_ENTRY *thread_p)
LC_FIND_CLASSNAME xlocator_find_lockhint_class_oids(THREAD_ENTRY *thread_p, int num_classes, const char **many_classnames, LOCK *many_locks, int *many_need_subclasses, LC_PREFETCH_FLAGS *many_flags, OID *guessed_class_oids, int *guessed_class_chns, bool quit_on_errors, LC_LOCKHINT **hlock, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:11017
int xsession_drop_session_variables(THREAD_ENTRY *thread_p, DB_VALUE *values, const int count)
Definition: session_sr.c:306
int xsession_reset_cur_insert_id(THREAD_ENTRY *thread_p)
Definition: session_sr.c:147
int xsession_end_session(THREAD_ENTRY *thread, const SESSION_ID id)
Definition: session_sr.c:65
int xsession_set_tran_auto_commit(THREAD_ENTRY *thread_p, bool auto_commit)
Definition: session_sr.c:370
int xsession_set_row_count(THREAD_ENTRY *thread_p, int row_count)
Definition: session_sr.c:78
int xsession_get_session_variable_no_copy(THREAD_ENTRY *thread_p, const DB_VALUE *name, DB_VALUE **value)
Definition: session_sr.c:288
int xtran_server_savepoint(THREAD_ENTRY *thread_p, const char *savept_name, LOG_LSA *savept_lsa)
const char * xboot_get_server_session_key(void)
Definition: boot_sr.c:3151
int xstats_update_all_statistics(THREAD_ENTRY *thread_p, bool with_fullscan)
int xheap_destroy(THREAD_ENTRY *thread_p, const HFID *hfid, const OID *class_oid)
Definition: heap_file.c:5786
bool xdisk_is_volume_exist(THREAD_ENTRY *thread_p, VOLID volid)
INT16 PGLENGTH
BTID * xbtree_load_online_index(THREAD_ENTRY *thread_p, BTID *btid, const char *bt_name, TP_DOMAIN *key_type, OID *class_oids, int n_classes, int n_attrs, int *attr_ids, int *attrs_prefix_length, HFID *hfids, int unique_pk, int not_null_flag, OID *fk_refcls_oid, BTID *fk_refcls_pk_btid, const char *fk_name, char *pred_stream, int pred_stream_size, char *expr_stream, int expr_steram_size, int func_col_id, int func_attr_index_start, int ib_thread_count)
Definition: btree_load.c:4438
int disk_get_boot_db_charset(THREAD_ENTRY *thread_p, INT16 volid, INTL_CODESET *db_charset)
int xstats_update_statistics(THREAD_ENTRY *thread_p, OID *classoid, bool with_fullscan)
int xlogtb_get_pack_tran_table(THREAD_ENTRY *thread_p, char **buffer_p, int *size_p, int include_query_exec_info)
bool xtran_server_has_updated(THREAD_ENTRY *thread_p)
unsigned int SESSION_ID
Definition: dbtype_def.h:480
enum intl_codeset INTL_CODESET
Definition: intl_support.h:190
void xacl_dump(THREAD_ENTRY *thread_p, FILE *outfp)
DKNPAGES xdisk_get_free_numpages(THREAD_ENTRY *thread_p, VOLID volid)
char * xstats_get_statistics_from_server(THREAD_ENTRY *thread_p, OID *class_id, unsigned int timestamp, int *length)
int query_timeout
Definition: cas.c:160
int xlocator_fetch_lockset(THREAD_ENTRY *thread_p, LC_LOCKSET *lockset, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:3047
QFILE_LIST_ID * xqmgr_execute_query(THREAD_ENTRY *thrd, const XASL_ID *xasl_id, QUERY_ID *query_idp, int dbval_cnt, void *data, QUERY_FLAG *flagp, CACHE_TIME *clt_cache_time, CACHE_TIME *srv_cache_time, int query_timeout, xasl_cache_ent **ret_cache_entry_p)
bool xtran_is_blocked(THREAD_ENTRY *thread_p, int tran_index)
TRAN_STATE
Definition: log_comm.h:36
int QUERY_FLAG
Definition: query_list.h:585
void xperfmon_server_copy_global_stats(UINT64 *to_stats)
BTID * xbtree_load_index(THREAD_ENTRY *thread_p, BTID *btid, const char *bt_name, TP_DOMAIN *key_type, OID *class_oids, int n_classes, int n_attrs, int *attr_ids, int *attrs_prefix_length, HFID *hfids, int unique_pk, int not_null_flag, OID *fk_refcls_oid, BTID *fk_refcls_pk_btid, const char *fk_name, char *pred_stream, int pred_stream_size, char *expr_stream, int expr_steram_size, int func_col_id, int func_attr_index_start)
Definition: btree_load.c:716
void xqmgr_dump_query_cache(THREAD_ENTRY *thread_p, FILE *outfp)
VOLID xboot_add_volume_extension(THREAD_ENTRY *thread_p, DBDEF_VOL_EXT_INFO *ext_info)
Definition: boot_sr.c:551
INT32 PAGEID
LOG_RESULT_TOPOP
Definition: log_comm.h:73
QFILE_LIST_ID * xqmgr_prepare_and_execute_query(THREAD_ENTRY *thrd, char *xasl_stream, int xasl_stream_size, QUERY_ID *query_id, int dbval_cnt, void *data, QUERY_FLAG *flag, int query_timeout)
TRAN_STATE xtran_server_2pc_prepare(THREAD_ENTRY *thread_p)
int xlocator_check_fk_validity(THREAD_ENTRY *thread_p, OID *cls_oid, HFID *hfid, TP_DOMAIN *key_type, int n_attrs, int *attr_ids, OID *pk_cls_oid, BTID *pk_btid, char *fk_name)
Definition: locator_sr.c:11689
int xlocator_demote_class_lock(THREAD_ENTRY *thread_p, const OID *class_oid, LOCK lock, LOCK *ex_lock)
Definition: locator_sr.c:13706
int xlocator_get_reserved_class_name_oid(THREAD_ENTRY *thread_p, const char *classname, OID *class_oid)
Definition: locator_sr.c:689
int xtran_server_2pc_start(THREAD_ENTRY *thread_p)
FILEIO_BACKUP_LEVEL
Definition: file_io.h:96
FILEIO_ZIP_METHOD
Definition: file_io.h:104
int xboot_unregister_client(REFPTR(THREAD_ENTRY, thread_p), int tran_index)
Definition: boot_sr.c:3343
int xlocator_fetch_all_reference_lockset(THREAD_ENTRY *thread_p, OID *oid, int chn, OID *class_oid, int class_chn, LOCK lock, int quit_on_errors, int prune_level, LC_LOCKSET **lockset, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:3813
int xqmgr_drop_all_query_plans(THREAD_ENTRY *thread_p)
int xlocator_upgrade_instances_domain(THREAD_ENTRY *thread_p, OID *class_oid, int att_id)
Definition: locator_sr.c:12070
int class_id
Definition: load_common.hpp:40
DISK_ISVALID
Definition: disk_manager.h:53
int xlocator_get_class(THREAD_ENTRY *thread_p, OID *class_oid, int class_chn, const OID *oid, LOCK lock, int prefetching, LC_COPYAREA **fetch_area)
Definition: locator_sr.c:2704
VOLID xboot_find_last_temp(THREAD_ENTRY *thread_p)
Definition: boot_sr.c:407
int xtran_server_2pc_recovery_prepared(THREAD_ENTRY *thread_p, int gtrids[], int size)
int xsession_load_query_entry_info(THREAD_ENTRY *thread_p, QMGR_QUERY_ENTRY *qentry_p)
Definition: session_sr.c:330
int ib_thread_count