CUBRID Engine  latest
work_space.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  * work_space.h: External definitions for the workspace manager.
22  *
23  */
24 
25 #ifndef _WORK_SPACE_H_
26 #define _WORK_SPACE_H_
27 
28 #ident "$Id$"
29 
30 #include <stdio.h>
31 #include "oid.h"
32 #include "storage_common.h"
33 #include "quick_fit.h"
34 #include "locator.h"
35 #include "dbtype_def.h"
36 
37 #if defined (SERVER_MODE)
38 #error does not belong to server
39 #endif // SERVER_MODE
40 
41 /*
42  * VID_INFO
43  * typedefs for virtual objects.
44  */
45 typedef struct vid_info VID_INFO;
46 struct vid_info
47 { /* Virtual Object Info */
48  unsigned int flags;
50 };
51 
53 {
54  VID_BASE = 1, /* whether the VID is a base instance */
55  VID_UPDATABLE = 2, /* whether the VID is updatable */
56  VID_NEW = 4, /* whether the VID is new */
57  VID_INSERTING = 8 /* whether the VID is in an insert */
58 };
60 
61 typedef union vid_oid VID_OID;
62 union vid_oid
63 {
64  VID_INFO *vid_info; /* Matches OID slot and volume */
65  OID oid; /* physical oid */
66 };
67 
70 {
73  int operation;
75  char *error_msg;
77 };
78 
79 typedef struct ws_repl_obj WS_REPL_OBJ;
81 {
82  struct ws_repl_obj *next;
86  bool has_index;
87  int operation;
89 };
90 
91 typedef struct ws_repl_list WS_REPL_LIST;
93 {
96  int num_items;
97 };
98 
101 {
104 };
105 
106 /*
107  * DB_OBJECT
108  * This is the primary workspace structure used as a reference to a
109  * persistent database object. Commonly known as a "memory object
110  * pointer" or MOP.
111  * This is typedefd as DB_OBJECT rather than WS_OBJECT because this
112  * structure is visible at all levels and it makes it easier to pass
113  * these around.
114  */
115 
116 /* typede for DB_OBJECT & MOP is in dbtype.h */
117 
118 struct db_object
119 {
120  VID_OID oid_info; /* local copy of the OID or VID pointer */
121  struct db_object *class_mop; /* pointer to class mop */
122  /* Do not ever set this to NULL without removing object from class link. */
123  void *object; /* pointer to attribute values */
124 
125  struct db_object *class_link; /* link for class instances list */
126  /* Careful whenever looping through object using class_link to save it and advance using this saved class link if the
127  * current mop can be removed from class. */
128  struct db_object *dirty_link; /* link for dirty list */
129  struct db_object *hash_link; /* link for workspace hash table */
130  /* Careful whenever looping through objects using hash_link to save it and advance using this saved hash link if the
131  * current mop can be removed or relocated in hash table. */
132  struct db_object *commit_link; /* link for obj to be reset at commit/abort */
133  WS_VALUE_LIST *label_value_list; /* label value list */
134  LOCK lock; /* object lock */
135  unsigned int mvcc_snapshot_version; /* The snapshot version at the time mop object is fetched and cached.
136  * Used only when MVCC is enabled. */
137 
138  unsigned char pruning_type; /* no pruning, prune as partitioned class, prune as partition */
139  unsigned char composition_fetch; /* set the left-most bit if this MOP */
140  /* has been composition fetched and */
141  /* set the prune level into the */
142  /* right-most 7 bits */
143 
144  unsigned dirty:1; /* dirty flag */
145  unsigned deleted:1; /* deleted flag */
146  unsigned no_objects:1; /* optimization for classes */
147  unsigned pinned:1; /* to prevent swapping */
148  unsigned is_vid:1; /* set if oid is vid */
149  unsigned is_temp:1; /* set if template MOP (for triggers) */
150  unsigned released:1; /* set by code that knows that an instance can be released, used currently by the
151  * loader only */
152  unsigned decached:1; /* set if mop is decached by calling ws_decache function */
153 };
154 
155 
156 typedef struct ws_memoid WS_MEMOID;
157 typedef struct ws_memoid *MOID;
158 
159 struct ws_memoid
160 {
163 };
164 
165 /*
166  * MOBJ
167  * Defines a pointer to the memory allocated for an object in the
168  * workspace. This is not a MOP but rather the space used for the
169  * storage of the object's attributes.
170  * Might need to make this void* if the pointer sizes are different.
171  *
172  */
173 
174 typedef char *MOBJ;
175 
176 /*
177  * WS_OBJECT_HEADER
178  * This structure is always found at the top of any block of memory
179  * allocated for storing an object in the workspace.
180  * It contains only the cache coherency number which is used by the
181  * locator to validate the cached representation of the object.
182  */
183 
185 
187 {
188  int chn;
189 };
190 
191 /*
192  * MAPFUNC
193  * Shorthand typedef for the function that is passed to the workspace
194  * mapping functions.
195  */
196 
197 typedef int (*MAPFUNC) (MOP mop, void *args);
198 
199 /*
200  * IS_CLASS_MOP, IS_ROOT_MOP
201  * Macros for testing types of MOPs.
202  * Could make these functions so we don't need to introduce the
203  * rootclass globals here.
204  * IS_ROOT_MOP is non-zero if the MOP is the rootclass.
205  * IS_CLASS_MOP is non-zero if the class MOP of the object is the
206  * rootclass.
207  */
208 
209 #define IS_CLASS_MOP(mop) (((mop)->class_mop == sm_Root_class_mop) ? 1 : 0)
210 #define IS_ROOT_MOP(mop) (((mop) == sm_Root_class_mop) ? 1 : 0)
211 
212 /*
213  * WS_STATISTICS
214  * This maintains misc information about the workspace.
215  * It is public primarily for testing purposes.
216  */
217 
218 
221 {
222  int mops_allocated; /* total number of mops allocated */
223  int mops_freed; /* total reclaimed mops */
224 
228 
231 
234 
236 
239 };
240 
241 /*
242  * MOP access macros
243  * Miscellaneous macros that access fields in the MOP structure.
244  * Should use these rather than direct references into the MOP.
245  *
246  */
247 
248 #define WS_PUT_COMMIT_MOP(mop) \
249  do \
250  { \
251  if (!(mop)->commit_link) \
252  { \
253  (mop)->commit_link = ws_Commit_mops ? ws_Commit_mops : (mop); \
254  ws_Commit_mops = (mop); \
255  } \
256  } \
257  while (0)
258 
259 #define WS_ISDIRTY(mop) (ws_is_dirty (mop))
260 
261 #define WS_SET_DIRTY(mop) \
262  do \
263  { \
264  if (!WS_ISDIRTY(mop)) \
265  { \
266  (mop)->dirty = 1; \
267  WS_PUT_COMMIT_MOP(mop); \
268  ws_Num_dirty_mop++; \
269  } \
270  } \
271  while (0)
272 
273 #define WS_RESET_DIRTY(mop) \
274  do \
275  { \
276  if (WS_ISDIRTY(mop)) \
277  { \
278  (mop)->dirty = 0; \
279  ws_Num_dirty_mop--; \
280  } \
281  } \
282  while (0)
283 
284 #define WS_IS_DELETED(mop) (ws_is_deleted (mop))
285 
286 #define WS_SET_DELETED(mop) (ws_set_deleted (mop))
287 
288 #define WS_ISVID(mop) ((mop)->is_vid)
289 /*
290  * There are also functions for these, should use the macro since they
291  * aren't very complicated
292  */
293 #define WS_OID(mop) (WS_ISVID (mop) ? (OID *) (&oid_Null_oid) : &(mop)->oid_info.oid)
294 #define WS_REAL_OID(mop) (&(mop)->oid_info.oid)
295 #define WS_VID_INFO(mop) ((mop)->oid_info.vid_info)
296 #define WS_CLASS_MOP(mop) ((mop)->class_mop)
297 #define WS_SET_LOCK(mop, lock) \
298  do \
299  { \
300  (mop)->lock = lock; \
301  if (lock != NULL_LOCK) \
302  { \
303  WS_PUT_COMMIT_MOP (mop); \
304  } \
305  } \
306  while (0)
307 
308 #define WS_GET_LOCK(mop) ((mop)->lock)
309 #define WS_CHN(obj) (((WS_OBJECT_HEADER *) (obj))->chn)
310 #define WS_ISPINNED(mop) ((mop)->pinned)
311 #define WS_SET_NO_OBJECTS(mop) \
312  do \
313  { \
314  (mop)->no_objects = 1; \
315  WS_PUT_COMMIT_MOP (mop); \
316  } \
317  while (0)
318 
319 /*
320  * WS_MOP_IS_NULL
321  * Tests for logical "NULLness" of the MOP.
322  * This is true if the MOP pointer is NULL, the MOP has been marked as
323  * deleted, or if the MOP has the "NULL OID".
324  * Note that we have to test for non-virtual MOPs before comparing
325  * against the NULL OID.
326  */
327 
328 #define WS_MOP_IS_NULL(mop) \
329  (((mop == NULL) || WS_IS_DELETED (mop) || (OID_ISNULL (&(mop)->oid_info.oid) && !(mop)->is_vid)) ? 1 : 0)
330 
331 /*
332  * WS_MOP_GET_COMPOSITION_FETCH
333  * WS_MOP_SET_COMPOSITION_FETCH
334  * These macros access the "composition_fetch" right-most 1 bit inside the
335  * MOP. They should be used only by the transaction locator.
336  *
337  */
338 
339 #define WS_MOP_COMPOSITION_FETCH_BIT 0x80 /* 1000 0000 */
340 
341 #define WS_MOP_GET_COMPOSITION_FETCH(mop) \
342  ((mop)->composition_fetch & WS_MOP_COMPOSITION_FETCH_BIT)
343 
344 #define WS_MOP_SET_COMPOSITION_FETCH(mop) \
345  do \
346  { \
347  (mop)->composition_fetch |= WS_MOP_COMPOSITION_FETCH_BIT; \
348  WS_PUT_COMMIT_MOP (mop); \
349  } \
350  while (0)
351 
352 /*
353  * WS_MOP_GET_PRUNE_LEVEL
354  * WS_MOP_SET_PRUNE_LEVEL
355  * These macros access the "composition_fetch" left-most 7 bits inside the
356  * MOP.
357  *
358  */
359 
360 #define WS_MOP_GET_PRUNE_LEVEL(mop) ((mop)->composition_fetch & ~WS_MOP_COMPOSITION_FETCH_BIT)
361 #define WS_MOP_SET_PRUNE_LEVEL(mop, value) \
362  do \
363  { \
364  if (value <= 0) \
365  { \
366  (mop)->composition_fetch &= WS_MOP_COMPOSITION_FETCH_BIT; /* zero */ \
367  } \
368  else \
369  { \
370  (mop)->composition_fetch |= (value & ~WS_MOP_COMPOSITION_FETCH_BIT); \
371  } \
372  } \
373  while (0)
374 
375 /* free_and_init routine */
376 #define ws_free_string_and_init(str) \
377  do \
378  { \
379  ws_free_string ((str)); \
380  (str) = NULL; \
381  } \
382  while (0)
383 
384 #define ml_free_and_init(list) \
385  do \
386  { \
387  ml_free ((list)); \
388  (list) = NULL; \
389  } \
390  while (0)
391 
392 #define ws_list_free_and_init(list, function) \
393  do \
394  { \
395  ws_list_free ((DB_LIST *)(list), (LFREEER)(function)); \
396  (list) = NULL; \
397  } \
398  while (0)
399 
400 /*
401  * WS_MAP constants
402  * These are returned as status codes by the workspace mapping functions.
403  */
404 
405 
407 {
412 };
414 
415 /*
416  * WS_FIND_MOP constants
417  * These are returned as status codes by the ws_find function.
418  */
420 {
423 };
425 
426 /*
427  * WS_MOP_TABLE_ENTRY
428  */
431 {
434 };
435 
436 /*
437  * WORKSPACE GLOBALS
438  */
440 extern unsigned int ws_Mop_table_size;
442 extern MOP ws_Commit_mops;
443 extern WS_STATISTICS ws_Stats;
444 extern int ws_Num_dirty_mop;
446 extern int ws_Error_ignore_count;
447 
448 /*
449  * WORKSPACE FUNCTIONS
450  */
451 /* memory crisis */
452 extern void ws_abort_transaction (void);
453 
454 /* startup, shutdown, reset functions */
455 extern int ws_init (void);
456 extern void ws_final (void);
457 extern void ws_clear (void);
458 extern int ws_area_init (void);
459 extern void ws_area_final (void);
460 
461 /* MOP allocation functions */
462 extern MOP ws_mop (const OID * oid, MOP class_mop);
463 extern MOP ws_mop_if_exists (OID * oid);
464 extern MOP ws_vmop (MOP class_mop, int flags, DB_VALUE * keys);
465 extern bool ws_rehash_vmop (MOP mop, MOBJ class_obj, DB_VALUE * newkey);
466 extern MOP ws_new_mop (OID * oid, MOP class_mop);
467 extern void ws_update_oid (MOP mop, OID * newoid);
468 extern int ws_update_oid_and_class (MOP mop, OID * new_oid, OID * new_class_oid);
469 extern DB_VALUE *ws_keys (MOP vid, unsigned int *flags);
470 
471 /* Temp MOPs */
472 extern MOP ws_make_temp_mop (void);
473 extern void ws_free_temp_mop (MOP op);
474 
475 /* Dirty list maintenance */
476 extern void ws_dirty (MOP op);
477 extern int ws_is_dirty (MOP mop);
478 extern int ws_is_deleted (MOP mop);
479 extern void ws_set_deleted (MOP mop);
480 extern void ws_clean (MOP op);
481 extern int ws_map_dirty (MAPFUNC function, void *args);
482 extern void ws_filter_dirty (void);
483 extern int ws_map_class_dirty (MOP class_op, MAPFUNC function, void *args);
484 
485 /* Resident instance list maintenance */
486 extern void ws_set_class (MOP inst, MOP class_mop);
487 extern int ws_map_class (MOP class_op, MAPFUNC function, void *args);
488 extern void ws_mark_instances_deleted (MOP class_op);
489 extern void ws_remove_resident_class (MOP class_op);
490 extern void ws_intern_instances (MOP class_mop);
491 extern void ws_release_instance (MOP class_mop);
492 extern void ws_release_user_instance (MOP mop);
493 extern void ws_disconnect_deleted_instances (MOP class_mop);
494 
495 /* object cache */
496 extern void ws_cache (MOBJ obj, MOP mop, MOP class_mop);
497 extern MOP ws_cache_with_oid (MOBJ obj, OID * oid, MOP class_mop);
498 extern void ws_decache (MOP mop);
499 extern void ws_decache_all_instances (MOP classmop);
500 
501 /* Class name cache */
502 extern MOP ws_find_class (const char *name);
503 extern void ws_add_classname (MOBJ classobj, MOP classmop, const char *cl_name);
504 extern void ws_drop_classname (MOBJ classobj);
505 
506 /* MOP accessor functions */
507 extern OID *ws_identifier (MOP mop);
508 extern OID *ws_identifier_with_check (MOP mop, const bool check_non_referable);
509 extern OID *ws_oid (MOP mop);
510 extern MOP ws_class_mop (MOP mop);
511 extern int ws_chn (MOBJ obj);
512 extern LOCK ws_get_lock (MOP mop);
513 extern void ws_set_lock (MOP mop, LOCK lock);
514 extern void ws_mark_deleted (MOP mop);
515 
516 /* pin functions */
517 extern int ws_pin (MOP mop, int pin);
518 extern void ws_pin_instance_and_class (MOP obj, int *opin, int *cpin);
519 extern void ws_restore_pin (MOP obj, int opin, int cpin);
520 
521 /* Misc info */
522 extern void ws_cull_mops (void);
523 extern int ws_find (MOP mop, MOBJ * obj);
524 extern int ws_mop_compare (MOP mop1, MOP mop2);
525 extern void ws_class_has_object_dependencies (MOP mop);
526 extern int ws_class_has_cached_objects (MOP class_mop);
527 extern bool ws_has_updated (void);
528 
529 /* MOP mapping functions */
530 #if defined (CUBRID_DEBUG)
531 extern int ws_map (MAPFUNC function, void *args);
532 #endif
533 
534 /* Transaction management support */
535 extern void ws_reset_authorization_cache (void);
536 extern void ws_clear_hints (MOP obj, bool leave_pinned);
537 extern void ws_clear_all_hints (bool retain_lock);
538 extern void ws_abort_mops (bool only_unpinned);
540 
541 /* Debugging functions */
542 extern void ws_dump (FILE * fpp);
543 #if defined (CUBRID_DEBUG)
544 extern void ws_dump_mops (void);
545 #endif
546 
547 /* String utilities */
548 extern char *ws_copy_string (const char *str);
549 extern void ws_free_string (const char *str);
550 
551 /*
552  * DB_LIST functions
553  * General purpose list functions, don't have to be part of the workspace
554  * except that the coyp functions assume that they can allocate
555  * within the workspace.
556  * Assumes that the first slot in the structure is a "next" pointer.
557  * Technically, this should use imbedded structures but this hasn't
558  * been a problem for any system yet.
559  */
560 
561 typedef void *(*LCOPIER) (void *);
562 typedef void (*LFREEER) (void *);
563 typedef int (*LTOTALER) (void *);
564 
565 extern void ws_list_free (DB_LIST * list, LFREEER function);
566 extern int ws_list_total (DB_LIST * list, LTOTALER function);
567 extern int ws_list_remove (DB_LIST ** list, DB_LIST * element);
568 extern int ws_list_length (DB_LIST * list);
569 extern void ws_list_append (DB_LIST ** list, DB_LIST * element);
570 extern DB_LIST *ws_list_copy (DB_LIST * list, LCOPIER copier, LFREEER freeer);
571 extern DB_LIST *ws_list_nconc (DB_LIST * list1, DB_LIST * list2);
572 
573 #define WS_LIST_LENGTH(lst) \
574  ws_list_length ((DB_LIST *) (lst))
575 #define WS_LIST_FREE(lst, func) \
576  ws_list_free ((DB_LIST *) (lst), (LFREEER) func)
577 #define WS_LIST_APPEND(lst, element) \
578  ws_list_append ((DB_LIST **) (lst), (DB_LIST *) element)
579 #define WS_LIST_COPY(lst, copier) \
580  ws_list_copy ((DB_LIST *) (lst), copier, NULL)
581 #define WS_LIST_REMOVE(lst, element) \
582  ws_list_remove ((DB_LIST **) (lst), (DB_LIST *) element)
583 #define WS_LIST_NCONC(lst1, lst2) \
584  ws_list_nconc ((DB_LIST *) (lst1), (DB_LIST *) lst2)
585 
586 /*
587  * DB_NAMELIST functions
588  * This is an extension of the basic LIST functions that provide
589  * an additional slot for a name string. Manipulating lists of this
590  * form is extremely common in the schema manager.
591  * Modified 4/20/93 to supply an optional function to perform
592  * the comparison. This is primarily for case insensitivity.
593  */
594 
595 /*
596  * can't use int return code as this must remain compatible with
597  * strcmp() and mbs_strcmp.
598  */
599 typedef DB_C_INT (*NLSEARCHER) (const void *, const void *);
600 
601 extern DB_NAMELIST *nlist_find (DB_NAMELIST * list, const char *name, NLSEARCHER fcn);
602 extern DB_NAMELIST *nlist_remove (DB_NAMELIST ** list, const char *name, NLSEARCHER fcn);
603 extern int nlist_add (DB_NAMELIST ** list, const char *name, NLSEARCHER fcn, int *added);
604 extern int nlist_append (DB_NAMELIST ** list, const char *name, NLSEARCHER fcn, int *added);
605 extern int nlist_find_or_append (DB_NAMELIST ** list, const char *name, NLSEARCHER fcn, int *position);
606 extern DB_NAMELIST *nlist_filter (DB_NAMELIST ** root, const char *name, NLSEARCHER fcn);
607 extern DB_NAMELIST *nlist_copy (DB_NAMELIST * list);
608 extern void nlist_free (DB_NAMELIST * list);
609 
610 #define NLIST_FIND(lst, name) nlist_find ((DB_NAMELIST *) (lst), name, NULL)
611 
612 /*
613  * DB_OBJLIST functions
614  * This is an extension of the basic LIST functions that provide an
615  * additional slot for a MOP pointer. Manipulating lists of MOPs is
616  * an extremely common operation in the schema manager.
617  * This has a DB_ prefix because it is visible at the application level.
618  */
619 
620 typedef int (*MOPFILTER) (MOP op, void *args);
621 
622 extern int ml_find (DB_OBJLIST * list, MOP mop);
623 extern int ml_add (DB_OBJLIST ** list, MOP mop, int *added);
624 extern int ml_append (DB_OBJLIST ** list, MOP mop, int *added);
625 extern int ml_remove (DB_OBJLIST ** list, MOP mop);
626 extern void ml_free (DB_OBJLIST * list);
627 extern int ml_size (DB_OBJLIST * list);
628 extern DB_OBJLIST *ml_copy (DB_OBJLIST * list);
629 #if defined (ENABLE_UNUSED_FUNCTION)
630 extern void ml_filter (DB_OBJLIST ** list, MOPFILTER filter, void *args);
631 #endif
632 
633 /*
634  * These are external MOP lists that are passed beyond the db_ layer into
635  * user application space. They must be allocated in a special region so they
636  * are visible as roots for the garbage collector
637  */
638 
639 extern DB_OBJLIST *ml_ext_alloc_link (void);
640 extern void ml_ext_free_link (DB_OBJLIST * list);
641 extern DB_OBJLIST *ml_ext_copy (DB_OBJLIST * list);
642 extern void ml_ext_free (DB_OBJLIST * list);
643 extern int ml_ext_add (DB_OBJLIST ** list, MOP mop, int *added);
644 extern int ws_has_dirty_objects (MOP op, int *isvirt);
645 extern int ws_hide_new_old_trigger_obj (MOP op);
646 extern void ws_unhide_new_old_trigger_obj (MOP op);
647 
648 extern bool ws_need_flush (void);
649 
650 extern int ws_set_ignore_error_list_for_mflush (int error_count, int *error_list);
651 
652 extern int ws_add_to_repl_obj_list (OID * class_oid, char *packed_pkey_value, int packed_pkey_value_length,
653  RECDES * recdes, int operation, bool has_index);
654 extern void ws_init_repl_objs (void);
655 extern void ws_clear_all_repl_objs (void);
656 extern void ws_free_repl_obj (WS_REPL_OBJ * obj);
658 
659 extern void ws_set_repl_error_into_error_link (LC_COPYAREA_ONEOBJ * obj, char *content_ptr);
660 
662 extern void ws_clear_all_repl_errors_of_error_link (void);
663 extern void ws_free_repl_flush_error (WS_REPL_FLUSH_ERR * flush_err);
664 
665 extern unsigned int ws_get_mvcc_snapshot_version (void);
666 extern void ws_increment_mvcc_snapshot_version (void);
669 
670 extern bool ws_is_same_object (MOP mop1, MOP mop2);
671 extern void ws_move_label_value_list (MOP dest_mop, MOP src_mop);
672 extern void ws_remove_label_value_from_mop (MOP mop, DB_VALUE * val);
673 extern int ws_add_label_value_to_mop (MOP mop, DB_VALUE * val);
674 extern void ws_clean_label_value_list (MOP mop);
675 
676 #endif /* _WORK_SPACE_H_ */
int ml_remove(DB_OBJLIST **list, MOP mop)
Definition: work_space.c:4613
unsigned decached
Definition: work_space.h:152
enum ws_map_status WS_MAP_STATUS
Definition: work_space.h:413
int nlist_add(DB_NAMELIST **list, const char *name, NLSEARCHER fcn, int *added)
Definition: work_space.c:4147
DB_NAMELIST * nlist_remove(DB_NAMELIST **list, const char *name, NLSEARCHER fcn)
Definition: work_space.c:4100
void ws_cache(MOBJ obj, MOP mop, MOP class_mop)
Definition: work_space.c:2575
MOP ws_mop(const OID *oid, MOP class_mop)
Definition: work_space.c:614
unsigned released
Definition: work_space.h:150
void ws_remove_label_value_from_mop(MOP mop, DB_VALUE *val)
Definition: work_space.c:5182
MOP ws_vmop(MOP class_mop, int flags, DB_VALUE *keys)
Definition: work_space.c:754
WS_REPL_OBJ * ws_get_repl_obj_from_list(void)
Definition: work_space.c:5335
void ws_set_lock(MOP mop, LOCK lock)
Definition: work_space.c:2954
void ws_clear_hints(MOP obj, bool leave_pinned)
Definition: work_space.c:3257
unsigned int ws_Mop_table_size
Definition: work_space.c:86
struct db_object * dirty_link
Definition: work_space.h:128
void ws_restore_pin(MOP obj, int opin, int cpin)
Definition: work_space.c:3052
void ws_release_instance(MOP class_mop)
Definition: work_space.c:1565
char * MOBJ
Definition: work_space.h:174
void ws_decache_allxlockmops_but_norealclasses(void)
Definition: work_space.c:3426
int dirty_list_emergencies
Definition: work_space.h:225
void ws_set_mop_fetched_with_current_snapshot(MOP mop)
Definition: work_space.c:5013
OID class_oid
Definition: work_space.h:83
RECDES * recdes
Definition: work_space.h:88
MOP ws_mop_if_exists(OID *oid)
Definition: work_space.c:548
unsigned int ws_get_mvcc_snapshot_version(void)
Definition: work_space.c:4976
DB_NAMELIST * nlist_filter(DB_NAMELIST **root, const char *name, NLSEARCHER fcn)
Definition: work_space.c:4410
void *(* LCOPIER)(void *)
Definition: work_space.h:561
int instance_list_emergencies
Definition: work_space.h:235
WS_REPL_OBJ * head
Definition: work_space.h:94
void ws_remove_resident_class(MOP class_op)
Definition: work_space.c:1277
char * packed_pkey_value
Definition: work_space.h:84
int ws_set_ignore_error_list_for_mflush(int error_count, int *error_list)
Definition: work_space.c:4927
VID_INFO * vid_info
Definition: work_space.h:64
DB_VALUE * val
Definition: work_space.h:103
int ws_is_dirty(MOP mop)
Definition: work_space.c:5025
OID * ws_oid(MOP mop)
Definition: work_space.c:2884
void ws_clean_label_value_list(MOP mop)
Definition: work_space.c:5301
MOP pointer
Definition: work_space.h:162
void ws_cull_mops(void)
Definition: work_space.c:1406
MOP ws_Commit_mops
Definition: work_space.c:70
void ws_mark_instances_deleted(MOP class_op)
Definition: work_space.c:2192
OID * ws_identifier_with_check(MOP mop, const bool check_non_referable)
Definition: work_space.c:2820
enum ws_find_mop_status WS_FIND_MOP_STATUS
Definition: work_space.h:424
void ws_final(void)
Definition: work_space.c:2429
void ml_free(DB_OBJLIST *list)
Definition: work_space.c:4654
int temp_mops_freed
Definition: work_space.h:238
void ws_list_free(DB_LIST *list, LFREEER function)
Definition: work_space.c:3945
int temp_mops_allocated
Definition: work_space.h:237
void ws_disconnect_deleted_instances(MOP class_mop)
Definition: work_space.c:1230
void ws_reset_authorization_cache(void)
unsigned no_objects
Definition: work_space.h:146
int ws_Num_dirty_mop
Definition: work_space.c:107
void ws_free_repl_obj(WS_REPL_OBJ *obj)
Definition: work_space.c:5361
DB_OBJLIST * ml_ext_alloc_link(void)
Definition: work_space.c:4777
int uncached_classes
Definition: work_space.h:227
int nlist_append(DB_NAMELIST **list, const char *name, NLSEARCHER fcn, int *added)
Definition: work_space.c:4198
int ignored_class_assignments
Definition: work_space.h:230
MOP tail
Definition: work_space.h:433
Definition: work_space.h:430
int(* MOPFILTER)(MOP op, void *args)
Definition: work_space.h:620
int ws_hide_new_old_trigger_obj(MOP op)
Definition: work_space.c:3765
void ws_release_user_instance(MOP mop)
Definition: work_space.c:1579
void ws_clear(void)
Definition: work_space.c:2526
void ws_clear_all_hints(bool retain_lock)
Definition: work_space.c:3305
void ws_free_string(const char *str)
Definition: work_space.c:3480
void ws_pin_instance_and_class(MOP obj, int *opin, int *cpin)
Definition: work_space.c:3020
OID * ws_identifier(MOP mop)
Definition: work_space.c:2805
void ws_move_label_value_list(MOP dest_mop, MOP src_mop)
Definition: work_space.c:5138
int ws_add_to_repl_obj_list(OID *class_oid, char *packed_pkey_value, int packed_pkey_value_length, RECDES *recdes, int operation, bool has_index)
Definition: work_space.c:5408
WS_REPL_OBJ * tail
Definition: work_space.h:95
int packed_pkey_value_length
Definition: work_space.h:85
WS_VALUE_LIST * label_value_list
Definition: work_space.h:133
bool ws_is_mop_fetched_with_current_snapshot(MOP mop)
Definition: work_space.c:5000
DB_VALUE keys
Definition: work_space.h:49
int set_mops_allocated
Definition: work_space.h:232
DB_LIST * ws_list_nconc(DB_LIST *list1, DB_LIST *list2)
Definition: work_space.c:4028
void ws_abort_transaction(void)
Definition: work_space.c:201
int ws_area_init(void)
Definition: work_space.c:3823
int ws_Error_ignore_count
Definition: work_space.c:161
bool ws_need_flush(void)
Definition: work_space.c:3813
bool ws_is_same_object(MOP mop1, MOP mop2)
Definition: work_space.c:5065
unsigned int mvcc_snapshot_version
Definition: work_space.h:135
int ml_ext_add(DB_OBJLIST **list, MOP mop, int *added)
Definition: work_space.c:4877
WS_MOP_TABLE_ENTRY * ws_Mop_table
Definition: work_space.c:79
LOCK
void ws_mark_deleted(MOP mop)
Definition: work_space.c:3081
MOP ws_find_class(const char *name)
Definition: work_space.c:2278
int ws_init(void)
Definition: work_space.c:2299
int ws_update_oid_and_class(MOP mop, OID *new_oid, OID *new_class_oid)
Definition: work_space.c:1096
struct ws_value_list * next
Definition: work_space.h:102
int(* MAPFUNC)(MOP mop, void *args)
Definition: work_space.h:197
int ws_is_deleted(MOP mop)
Definition: work_space.c:5037
void ws_list_append(DB_LIST **list, DB_LIST *element)
Definition: work_space.c:3869
bool has_index
Definition: work_space.h:86
int pinned_cleanings
Definition: work_space.h:229
void ws_init_repl_objs(void)
Definition: work_space.c:5323
void ws_decache_all_instances(MOP classmop)
Definition: work_space.c:2765
void ws_increment_mvcc_snapshot_version(void)
Definition: work_space.c:4987
void ws_set_repl_error_into_error_link(LC_COPYAREA_ONEOBJ *obj, char *content_ptr)
Definition: work_space.c:4944
void(* LFREEER)(void *)
Definition: work_space.h:562
struct db_object * class_mop
Definition: work_space.h:121
void ws_filter_dirty(void)
Definition: work_space.c:1859
int ml_add(DB_OBJLIST **list, MOP mop, int *added)
Definition: work_space.c:4493
int mops_allocated
Definition: work_space.h:222
struct db_object * commit_link
Definition: work_space.h:132
MOP ws_make_temp_mop(void)
Definition: work_space.c:336
int set_mops_freed
Definition: work_space.h:233
unsigned deleted
Definition: work_space.h:145
int ws_add_label_value_to_mop(MOP mop, DB_VALUE *val)
Definition: work_space.c:5237
VID_OID oid_info
Definition: work_space.h:120
int ws_map_class(MOP class_op, MAPFUNC function, void *args)
Definition: work_space.c:2118
OID oid
Definition: work_space.h:65
void ws_update_oid(MOP mop, OID *newoid)
Definition: work_space.c:1154
vid_info_flag
Definition: work_space.h:52
int ws_class_has_cached_objects(MOP class_mop)
Definition: work_space.c:3180
int ws_chn(MOBJ obj)
Definition: work_space.c:2922
LOCK lock
Definition: work_space.h:134
bool ws_rehash_vmop(MOP mop, MOBJ class_obj, DB_VALUE *newkey)
Definition: work_space.c:899
DB_OBJLIST * ws_Resident_classes
Definition: work_space.c:97
enum vid_info_flag VID_INFO_FLAG
Definition: work_space.h:59
int ws_list_length(DB_LIST *list)
Definition: work_space.c:3925
int ml_append(DB_OBJLIST **list, MOP mop, int *added)
Definition: work_space.c:4548
void ws_intern_instances(MOP class_mop)
Definition: work_space.c:1548
void ml_ext_free_link(DB_OBJLIST *list)
Definition: work_space.c:4790
int ml_size(DB_OBJLIST *list)
Definition: work_space.c:4711
void ws_free_temp_mop(MOP op)
Definition: work_space.c:356
int ws_find(MOP mop, MOBJ *obj)
Definition: work_space.c:3112
unsigned int flags
Definition: work_space.h:48
LOCK ws_get_lock(MOP mop)
Definition: work_space.c:2942
WS_REPL_FLUSH_ERR * ws_get_repl_error_from_error_link(void)
Definition: work_space.c:5075
void ws_set_class(MOP inst, MOP class_mop)
Definition: work_space.c:1997
unsigned dirty
Definition: work_space.h:144
void ws_drop_classname(MOBJ classobj)
Definition: work_space.c:2247
ws_find_mop_status
Definition: work_space.h:419
unsigned char composition_fetch
Definition: work_space.h:139
int ws_map_dirty(MAPFUNC function, void *args)
Definition: work_space.c:1849
int ws_map_class_dirty(MOP class_op, MAPFUNC function, void *args)
Definition: work_space.c:2018
void ws_area_final(void)
Definition: work_space.c:3840
void ws_class_has_object_dependencies(MOP mop)
Definition: work_space.c:3166
void * object
Definition: work_space.h:123
DB_OBJLIST * ml_copy(DB_OBJLIST *list)
Definition: work_space.c:4671
unsigned char pruning_type
Definition: work_space.h:138
int ws_list_remove(DB_LIST **list, DB_LIST *element)
Definition: work_space.c:3891
struct ws_memoid * MOID
Definition: work_space.h:157
void ws_free_repl_flush_error(WS_REPL_FLUSH_ERR *flush_err)
Definition: work_space.c:5115
struct db_object * hash_link
Definition: work_space.h:129
int nlist_find_or_append(DB_NAMELIST **list, const char *name, NLSEARCHER fcn, int *position)
DB_C_INT(* NLSEARCHER)(const void *, const void *)
Definition: work_space.h:599
void ws_add_classname(MOBJ classobj, MOP classmop, const char *cl_name)
Definition: work_space.c:2212
DB_VALUE * ws_keys(MOP vid, unsigned int *flags)
Definition: work_space.c:726
DB_NAMELIST * nlist_find(DB_NAMELIST *list, const char *name, NLSEARCHER fcn)
Definition: work_space.c:4066
WS_STATISTICS ws_Stats
Definition: work_space.c:105
DB_OBJLIST * ml_ext_copy(DB_OBJLIST *list)
Definition: work_space.c:4832
struct db_object * class_link
Definition: work_space.h:125
int ws_Error_ignore_list[-ER_LAST_ERROR]
Definition: work_space.c:160
void ml_ext_free(DB_OBJLIST *list)
Definition: work_space.c:4806
bool ws_has_updated(void)
Definition: work_space.c:2536
unsigned is_temp
Definition: work_space.h:149
char * ws_copy_string(const char *str)
Definition: work_space.c:3457
struct ws_repl_flush_err * error_link
Definition: work_space.h:71
MOP head
Definition: work_space.h:432
int ws_pin(MOP mop, int pin)
Definition: work_space.c:2989
DB_VALUE pkey_value
Definition: work_space.h:76
ws_map_status
Definition: work_space.h:406
void ws_clear_all_repl_objs(void)
Definition: work_space.c:5377
int DB_C_INT
Definition: dbtype_def.h:1149
void ws_unhide_new_old_trigger_obj(MOP op)
Definition: work_space.c:3800
int operation
Definition: work_space.h:87
int ws_list_total(DB_LIST *list, LTOTALER function)
Definition: work_space.c:3964
int ws_mop_compare(MOP mop1, MOP mop2)
Definition: work_space.c:3144
int ws_has_dirty_objects(MOP op, int *isvirt)
Definition: work_space.c:3752
void ws_clean(MOP op)
Definition: work_space.c:1681
int ml_find(DB_OBJLIST *list, MOP mop)
Definition: work_space.c:4465
MOP ws_new_mop(OID *oid, MOP class_mop)
Definition: work_space.c:1038
void ws_dirty(MOP op)
Definition: work_space.c:1622
unsigned pinned
Definition: work_space.h:147
void ws_abort_mops(bool only_unpinned)
Definition: work_space.c:3353
struct ws_repl_obj * next
Definition: work_space.h:82
void ws_set_deleted(MOP mop)
Definition: work_space.c:5051
int(* LTOTALER)(void *)
Definition: work_space.h:563
MOP ws_class_mop(MOP mop)
Definition: work_space.c:2907
MOP ws_cache_with_oid(MOBJ obj, OID *oid, MOP class_mop)
Definition: work_space.c:2675
void ws_decache(MOP mop)
Definition: work_space.c:2701
#define ER_LAST_ERROR
Definition: error_code.h:1646
DB_LIST * ws_list_copy(DB_LIST *list, LCOPIER copier, LFREEER freeer)
Definition: work_space.c:3985
void nlist_free(DB_NAMELIST *list)
Definition: work_space.c:4344
void ws_clear_all_repl_errors_of_error_link(void)
Definition: work_space.c:5096
void ws_dump(FILE *fpp)
Definition: work_space.c:3600
DB_NAMELIST * nlist_copy(DB_NAMELIST *list)
Definition: work_space.c:4362
unsigned is_vid
Definition: work_space.h:148