CUBRID Engine  latest
db_obj.c
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  * db_obj.c - API functions for accessing instances.
21  */
22 
23 #ident "$Id$"
24 
25 #include "config.h"
26 
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <stdarg.h>
30 #include <ctype.h>
31 #include <assert.h>
32 
33 #include "system_parameter.h"
34 #include "storage_common.h"
35 
36 #include "db.h"
37 #include "class_object.h"
38 #include "object_print.h"
39 #include "server_interface.h"
40 #include "boot_cl.h"
41 #include "locator_cl.h"
42 #include "schema_manager.h"
43 #include "schema_template.h"
44 #include "object_accessor.h"
45 #include "set_object.h"
46 #include "virtual_object.h"
47 #include "execute_schema.h"
48 #include "execute_statement.h"
49 #include "parser.h"
50 #include "view_transform.h"
51 #include "network_interface_cl.h"
52 #include "transform.h"
53 #include "dbtype.h"
54 #include "printer.hpp"
55 
56 /*
57  * OBJECT CREATION/DELETION
58  */
59 
60 /*
61  * db_create() - This function creates a new instance of a class.
62  * Please refer to the db_create_internal function.
63  * return : new object
64  * obj(in) : class object
65  * note : If the class is partitioned(parent or sub), function returns
66  * ER_NOT_ALLOWED_ACCESS_TO_PARTITION
67  */
68 DB_OBJECT *
70 {
71  int error = NO_ERROR;
72  DB_OBJECT *retval = NULL;
73 
75  CHECK_1ARG_NULL (obj);
77 
79  if (!error)
80  {
81  retval = db_create_internal (obj);
82  }
83 
84  return retval;
85 }
86 
87 /*
88  * db_create_internal() - This function creates a new instance of a class.
89  * return : new object
90  * obj(in) : class object
91  */
92 DB_OBJECT *
94 {
95  DB_OBJECT *retval;
96 
98  CHECK_1ARG_NULL (obj);
100 
101  retval = obj_create (obj);
102 
103  return retval;
104 }
105 
106 /*
107  * db_create_by_name() - This function creates an instance of the named class
108  * Please refer to the db_create_by_name_internal function.
109  * return : new object
110  * name(in) : class name
111  * note : If the named class is partitioned sub class, function returns
112  * ER_NOT_ALLOWED_ACCESS_TO_PARTITION
113  */
114 DB_OBJECT *
115 db_create_by_name (const char *name)
116 {
117  int is_partitioned = 0;
118  DB_OBJECT *retval = NULL;
119 
121  CHECK_1ARG_NULL (name);
123 
124  if (do_is_partitioned_subclass (&is_partitioned, name, NULL) || is_partitioned)
125  {
127  goto end_api;
128  }
129 
130  retval = db_create_by_name_internal (name);
131 
132 end_api:
133  return retval;
134 }
135 
136 /*
137  * db_create_by_name_internal() - This function creates an instance of the
138  * named class. if the class was found. If no class with the supplied name
139  * existed, a NULL is returned and an error left in global error structure.
140  * A NULL may also be returned if there was authorization failure.
141  * return : new object
142  * name(in) : class name
143  */
144 DB_OBJECT *
145 db_create_by_name_internal (const char *name)
146 {
147  DB_OBJECT *retval;
148 
150  CHECK_1ARG_NULL (name);
152 
153  retval = (obj_create_by_name (name));
154 
155  return retval;
156 }
157 
158 /*
159  * db_copy() - This is a simple function for cloning an instance. The
160  * exact semantics of this are rather vague right now. Assuming the
161  * instance is made up of only basic types the copy is fairly obvious.
162  * If the object has references to other objects the full tree is NOT
163  * copied, only the reference.
164  * return : a new instance pointer
165  * sourcemop(in): pointer to instance
166  * note : This shouldn't be a heavily used function because it is unclear
167  * what this feature will mean in the presence of object versioning,
168  * integrity constraints, etc.
169  */
170 DB_OBJECT *
171 db_copy (MOP sourcemop)
172 {
173  DB_OBJECT *retval;
174 
176 
177  retval = (obj_copy (sourcemop));
178 
179  /* handles NULL */
180  return retval;
181 }
182 
183 /*
184  * db_drop() - This function deletes an instance from the database. All of the
185  * attribute values contained in the dropped instance are lost.
186  * return : error code
187  * obj(in): instance
188  */
189 int
191 {
192  int retval;
193 
195  CHECK_1ARG_ERROR (obj);
197 
198  retval = (obj_delete (obj));
199 
200  return retval;
201 }
202 
203 /*
204  * ATTRIBUTE ACCESS
205  */
206 
207 /*
208  * db_get() -This is the basic function for retrieving the value of an
209  * attribute. This is typically called with just an attribute name.
210  * If the supplied object is an instance, this will look for and return
211  * the values of attributes or shared attributes. If the supplied object
212  * is a class, this will only look for clas attributes.
213  * return : error code
214  * object(in): class or instance
215  * attpath(in): a simple attribute name or path expression
216  * value(out) : value container to hold the returned value
217  *
218  * note : Since this is a copy the value must be freed using db_value_clear
219  * or db_value_free when it is no longer required. And This function will
220  * parse a simplified form of path expression to accepting an attribute name.
221  * it is intended only as a convenience feature for users of the functional
222  * interface. Basically the path expression allows value references to follow
223  * hierarchies of objects and sets.
224  * Example path expressions are as follows:
225  *
226  * foo.bar foo is an object that has a bar attribute
227  * foo.bar.baz three level indirection through object attributes
228  * foo[0] foo is a set, first element is returned
229  * foo[0].bar foo is a set of objects, bar attribute of first
230  * element is returned
231  */
232 int
233 db_get (DB_OBJECT * object, const char *attpath, DB_VALUE * value)
234 {
235  int retval;
236 
238  CHECK_2ARGS_ERROR (object, attpath);
239 
240  /* handles NULL */
241  retval = (obj_get_path (object, attpath, value));
242 
243  return retval;
244 }
245 
246 /*
247  * db_get_shared() - This function is used to force the retrieval of a shared
248  * attribute.
249  * return : error code
250  * op(in) : class or instance
251  * attname(in): attribute name
252  * value(out) : return value container
253  */
254 int
255 db_get_shared (DB_OBJECT * object, const char *attname, DB_VALUE * value)
256 {
257  int retval;
258 
260  CHECK_2ARGS_ERROR (object, attname);
261 
262  /* handles NULL */
263  retval = (obj_get_shared (object, attname, value));
264 
265  return retval;
266 }
267 
268 /*
269  * db_get_expression() - This is the basic function for retrieving the value
270  * of an expression. Each name in the expression must be an attribute name
271  * of object.
272  *
273  * If the supplied object is an instance, this will look for and return
274  * the values of attributes or shared attributes. If the supplied object
275  * is a class, this will only look for class attributes. The value of
276  * the attribute, if found, is copied into the value container.
277  *
278  * return : error code
279  * object(in): class or instance
280  * expression(in): a sql expression
281  * value(out) : value container to hold the returned value
282  *
283  * note : Since this is a copy the value must be freed using db_value_clear
284  * or db_value_free when it is no longer required.
285  * In addition to accepting an attribute name, this function will parse
286  * a simplified form of path expression. It is intended only as a
287  * convenience feature for users of the functional interface.
288  * Basically the path expression allows value references to follow
289  * hierarchies of objects and sets.
290  * Example path expressions are as follows:
291  *
292  * foo.bar foo is an object that has a bar attribute
293  * foo.bar.baz three level indirection through object attributes
294  */
295 int
296 db_get_expression (DB_OBJECT * object, const char *expression, DB_VALUE * value)
297 {
298  int retval;
299 
301  CHECK_2ARGS_ERROR (object, expression);
302 
303  /* handles NULL */
304  retval = mq_get_expression (object, expression, value);
305 
306  return retval;
307 }
308 
309 /*
310  * db_put() - This function changes the value of an instance or class
311  * attribute. Please refer to the db_put_internal function.
312  * return : error code
313  * obj(in): instance or class
314  * name(in): attribute name
315  * vlaue(in): new value
316  */
317 int
318 db_put (DB_OBJECT * obj, const char *name, DB_VALUE * value)
319 {
320  int error = NO_ERROR;
321 
323  CHECK_2ARGS_ERROR (obj, name);
325 
326  error = do_check_partitioned_class (db_get_class (obj), CHECK_PARTITION_NONE, (char *) name);
327  if (!error)
328  {
329  error = db_put_internal (obj, name, value);
330  }
331 
332  return error;
333 }
334 
335 /*
336  * db_put_internal() - This function changes the value of an instance or class
337  * attribute. If the supplied object pointer references a class object,
338  * the attribute name must be the name of a class attribute. If the
339  * object pointer references an instance object, the attribute name
340  * must be the name of an attribute or a shared attribute.
341  * return : error code
342  * obj(in): instance or class
343  * name(in): attribute name
344  * vlaue(in): new value
345  */
346 int
347 db_put_internal (DB_OBJECT * obj, const char *name, DB_VALUE * value)
348 {
349  int retval;
350 
352  CHECK_2ARGS_ERROR (obj, name);
354 
355  retval = (obj_set (obj, name, value));
356 
357  return retval;
358 }
359 
360 /*
361  * METHOD INVOCATION
362  */
363 
364 /*
365  * db_send() - This function invokes a method on an object. If the object is an
366  * instance, a normal method is invoked. If the object is a class, a class
367  * method is invoked. The arguments are passed to the method implementation
368  * function in the same order as given here. A maximum of 12 arguments can
369  * be sent with this function.
370  * return : error code
371  * obj(in): class or instance object
372  * name(in): method name
373  * returnval(out) : container for user-defined return value.
374  *
375  * note : The db_send() function does not automatically place a value in the
376  * returnval container. It is the responsibility of the method to return a
377  * value that is meaningful to the caller. If the caller is not expecting
378  * a return value, this argument can be ignored.
379  */
380 int
381 db_send (MOP obj, const char *name, DB_VALUE * returnval, ...)
382 {
383  int error = NO_ERROR;
384  DB_VALUE dummy;
385  va_list args;
386 
388 
389  if (returnval == NULL)
390  {
391  returnval = &dummy;
392  }
393 
394  va_start (args, returnval);
395  error = obj_send_va (obj, name, returnval, args);
396  va_end (args);
397 
398  return error;
399 }
400 
401 /*
402  * db_send_arglist() - This function invokes a method on an object. Unlike the
403  * db_send() function, the method arguments are passed in a list of values
404  * rather than as individual DB_VALUE structures.
405  * return : error code
406  * obj(in) : class or instance
407  * name(in): method name
408  * returnval(out): container for return value
409  * args(in): list of arguments
410  *
411  * note :The db_send_arglist() function does not automatically place a value in
412  * the returnval container. It is the responsibility of the method to return
413  * a value that is meaningful to the caller. If the caller is not expecting
414  * a return value, this argument can be ignored.
415  */
416 int
417 db_send_arglist (MOP obj, const char *name, DB_VALUE * returnval, DB_VALUE_LIST * args)
418 {
419  int retval;
420 
422  CHECK_2ARGS_ERROR (obj, name);
423 
424  retval = obj_send_list (obj, name, returnval, args);
425 
426  return retval;
427 }
428 
429 /*
430  * db_send_argarray() - This function invokes a method on a class or instance
431  * object and passes the arguments to an array.
432  * return : error code
433  * obj(in): class or instance
434  * name(in): method name
435  * returnval(out): container for return value
436  * args(in): array of DB_VALUE pointers
437  *
438  * note:The db_send_argarray() function does not automatically place a value in
439  * the returnval container. It is the responsibility of the method to return
440  * a value that is meaningful to the caller. If the caller is not expecting
441  * a return value, this argument can be ignored.
442  */
443 int
444 db_send_argarray (MOP obj, const char *name, DB_VALUE * returnval, DB_VALUE ** args)
445 {
446  int retval;
447 
449  CHECK_2ARGS_ERROR (obj, name);
450 
451  retval = obj_send_array (obj, name, returnval, args);
452 
453  return retval;
454 }
455 
456 /*
457  * OBJECT TEMPLATES
458  */
459 
460 /*
461  * dbt_create_object() - This function creates an object template for a new
462  * instance of a class. Please refer to the dbt_create_object_internal()
463  * return : object template
464  * classobj(in): class object
465  *
466  */
467 DB_OTMPL *
469 {
470  DB_OTMPL *def = NULL;
471 
473  CHECK_1ARG_NULL (classobj);
475 
477  {
478  def = dbt_create_object_internal (classobj);
479  }
480 
481  return def;
482 }
483 
484 /*
485  * dbt_create_object_internal() - This function creates an object template for
486  * a new instance of a class. Initially the template is empty, and it is
487  * later populated by calling the dbt_put() function. After the object
488  * template is created and populated, the template can be applied by calling
489  * the dbt_finish_object(function (to create an object), or it can be
490  * destroyed with the dbt_abort_object() function.
491  * return : object template
492  * classobj(in): class object
493  *
494  * note : Populated object templates ensure that an object is created and
495  * initialized with attribute values in a single atomic operation
496  * (the actual creation takes place when the dbt_finish_object()
497  * function is called). If your attempt to apply the template fails for
498  * any reason, the underlying object is not created.
499  */
500 DB_OTMPL *
502 {
503  DB_OTMPL *def = NULL;
504 
506  CHECK_1ARG_NULL (classobj);
508 
509  def = obt_def_object (classobj);
510 
511  return def;
512 }
513 
514 /*
515  * dbt_edit_object() - This function creates an object template for an existing
516  * object. The template is initially empty. The template is populated with
517  * the dbt_put function. When finished the template can be applied with the
518  * dbt_finish_object function or destroyed with the dbt_abort_object
519  * function.
520  * return : object template
521  * object(in): object pointer
522  *
523  * note : The purpose of the template when using the dbt_edit_object() function
524  * is to be able to make several changes (to several attributes) to an
525  * object through one update. The template is treated as one update.
526  * Therefore, if one of the changes in the template fails, the entire update
527  * fails (none of the changes in the template are applied). Thus, populated
528  * object templates ensure that an object is updated with multiple attribute
529  * values in a single atomic operation. If your attempt to apply the
530  * template fails for any reason, the underlying object is not modified.
531  */
532 DB_OTMPL *
534 {
535  DB_OTMPL *def = NULL;
536 
538  CHECK_1ARG_NULL (object);
540 
541  def = obt_edit_object (object);
542 
543  return def;
544 }
545 
546 /*
547  * dbt_finish_object() - This function applies an object template. If the
548  * template can be applied without error, a pointer to the object is
549  * returned and the template is freed. If this is a template for a new
550  * object, a new object pointer is created and returned. If this is a
551  * template for an old object the returned pointer is the same as that
552  * passed to dbt_edit_object. If an error is detected, this function
553  * returns NULL, the global error code is set, and the template is not
554  * freed. In this case, the template can either be corrected and
555  * re-applied or it can be destroyed with dbt_abort_object.
556  * return : object pointer
557  * def(in): object template
558  */
559 DB_OBJECT *
561 {
562  MOP object = NULL;
563 
565  CHECK_1ARG_NULL (def);
567 
568  if (obt_update (def, &object) != NO_ERROR)
569  {
570  object = NULL; /* probably not necessary but be safe */
571  }
572 
573  return object;
574 }
575 
576 /*
577  * dbt_finish_object_and_decache_when_failure() - This function applies an
578  * object template and decache if it is failed to update object template.
579  * return : object pointer
580  * def(in): object template
581  */
582 DB_OBJECT *
584 {
585  MOP object = NULL;
586 
588  CHECK_1ARG_NULL (def);
590 
591  if (obt_update (def, &object) != NO_ERROR)
592  {
593  if (def->object)
594  {
595  ws_decache (def->object);
596  }
597  object = NULL; /* probably not necessary but be safe */
598  }
599 
600  return object;
601 }
602 
603 /*
604  * dbt_abort_object() -
605  * return : none
606  * def(in): object template
607  *
608  * description:
609  * This function destroys an object template. All memory allocated for the
610  * template are released. It is only necessary to call this function if a
611  * template was built but could not be applied without error.
612  * If dbt_finish_object succeeds, the template will be freed and there is
613  * no need to call this function.
614  */
615 void
617 {
618  /* always allow this to be freed, will this be a problem if the transaction has been aborted or the connection is
619  * down ? */
620  if (def != NULL)
621  {
622  obt_quit (def);
623  }
624 }
625 
626 /*
627  * dbt_put() -This function makes an assignment to an attribute in an object
628  * template. Please refer to the dbt_put_internal() function.
629  * return : error code
630  * def(in/out): object template
631  * name(in): attribute name
632  * value(in): new value
633  */
634 int
635 dbt_put (DB_OTMPL * def, const char *name, DB_VALUE * value)
636 {
637  int error = NO_ERROR;
638 
640  CHECK_2ARGS_ERROR (def, name);
642 
643  error = do_check_partitioned_class (def->classobj, CHECK_PARTITION_NONE, (char *) name);
644  if (!error)
645  {
646  error = dbt_put_internal (def, name, value);
647  }
648  return error;
649 }
650 
651 /*
652  * dbt_put_internal() - This function makes an assignment to an attribute in an
653  * object template. It is similar to db_put and can return the same error
654  * conditions. There is an additional data type accepted by this function.
655  * If the value is of type DB_TYPE_POINTER the pointer in the value is
656  * assumed to point to an object template. This can be used to build a
657  * hiararchy of object templates, necessary for the processing of a
658  * nested INSERT statement. There can be cycles in the hierarchy as
659  * an object is allowed to reference any other object including itself.
660  * When a hierarical object template is built it MUST be applied by
661  * giving the top level template to dbt_finish_object. You cannot
662  * directly apply an object template that has been nested inside
663  * another template.
664  * return : error code
665  * def(in/out): object template
666  * name(in): attribute name
667  * value(in): new value
668  */
669 int
670 dbt_put_internal (DB_OTMPL * def, const char *name, DB_VALUE * value)
671 {
672  int error = NO_ERROR;
673 
675  CHECK_2ARGS_ERROR (def, name);
677 
678  if ((value != NULL) && (DB_VALUE_TYPE (value) == DB_TYPE_POINTER))
679  {
680  error = obt_set_obt (def, name, (OBJ_TEMPLATE *) db_get_pointer (value));
681  }
682  else
683  {
684  error = obt_set (def, name, value);
685  }
686 
687  return error;
688 }
689 
690 /*
691  * dbt_set_label() - This is used to establish a "label" for a template.
692  * A label is the address of a storage location that can contain a pointer
693  * to an object. When the template is successfully applied, if there is a
694  * label defined for the template, the object pointer of the new or updated
695  * object is placed in the label pointer.
696  * return: none
697  * def(in/out): object template
698  * label(in) : object pointer
699  *
700  * note : This is intended to support the use of interpreter variables in a
701  * nested insert statement. Since the nested objects are created as a side
702  * effect of applying the top level template there is no way to directly
703  * get their new MOPs when the template is applied, only the MOP for
704  * the top level object is returned. If the nested objects were inserted
705  * with the "into <variable>" clause, the MOP of the new object needs
706  * to be assigned to the variable. In the absence of labels, the parser
707  * would have to walk through the resulting object hierarchy looking
708  * for the new object MOPs to assign to the variables. By assigning
709  * the variable location as the label of the template, this assignment
710  * will take place automatically as the objects are created.
711  */
712 int
714 {
717 
718  if (def != NULL && label != NULL && (DB_VALUE_DOMAIN_TYPE (label) == DB_TYPE_OBJECT))
719  {
720  if (sm_is_reuse_oid_class (def->classobj))
721  {
724  }
725  obt_set_label (def, label);
726  }
727 
728  return NO_ERROR;
729 }
730 
731 /*
732  * DESCRIPTOR FUNCTIONS
733  *
734  * These provide a faster interface for attribute access and method invocation
735  * during repetetive operations.
736  *
737  */
738 
739 /*
740  * db_get_attribute_descriptor() - This builds an attribute descriptor for the
741  * named attribute of the given object. The attribute descriptor can then
742  * be used by other descriptor functions rather than continuing to reference
743  * the attribute by name. This speeds up repetitive operations on the same
744  * attribute since the system does not have to keep searching the attribute
745  * name list each the attribute is accessed. The same descriptor can be used
746  * with any class that has an attribute with the given name.
747  * return : error code
748  * obj(in): instance or class
749  * attname(in) : attribute name
750  * class_attribute(in): non-zero if class attribute name
751  * for_update(in) : non-zero if the intention is to update
752  * descriptor(out): returned attribute descriptor
753  *
754  * note : The descriptor must be freed with db_free_attribute_descriptor.
755  * If you intend to use the descriptor with the db_putd() or dbt_putd()
756  * functions, set the "for_update" flag to a non-zero value so that
757  * the appropriate locks and authorization checks can be made immediately.
758  * An error is returned if the object does not have an attribute
759  * with the given name. If an error is returned, an attribute descriptor
760  * is NOT returned.
761  */
762 int
763 db_get_attribute_descriptor (DB_OBJECT * obj, const char *attname, int class_attribute, int for_update,
764  DB_ATTDESC ** descriptor)
765 {
766  int retval;
767 
769  CHECK_3ARGS_ERROR (obj, attname, descriptor);
770 
771  retval = sm_get_attribute_descriptor (obj, attname, class_attribute, for_update, descriptor);
772 
773  return retval;
774 }
775 
776 /*
777  * db_attdesc_domain() - This function returns the domain of the attribute
778  * associated with the given attribute descriptor. Since the descriptor
779  * can describe a hierarchy of attributes, the most general domain is
780  * returned.
781  * return : domain
782  * attdesc(in): attribute descriptor
783  *
784  * note : This is intended for use with things like db_col_create which
785  * requires a domain, and which we frequently use to make things associated
786  * with an attribute. A regular attribute domain can be obtained with a
787  * combination of db_get_attribute and db_attribute_domain.
788  */
789 DB_DOMAIN *
791 {
792  DB_DOMAIN *domain = NULL;
793  DB_ATTRIBUTE *att;
794 
796  CHECK_1ARG_NULL (desc);
797 
798  if (desc->class_mop != NULL && desc->name != NULL)
799  {
800  if (desc->name_space == ID_CLASS_ATTRIBUTE)
801  {
802  att = db_get_class_attribute (desc->class_mop, desc->name);
803  }
804  else
805  {
806  att = db_get_attribute (desc->class_mop, desc->name);
807  }
808 
809  if (att != NULL)
810  {
811  domain = db_attribute_domain (att);
812  if (domain != NULL)
813  {
814  /* always filter the domain before returning to the higher levels */
815  sm_filter_domain (domain, NULL);
816  }
817  }
818  }
819 
820  if (domain == NULL)
821  {
823  }
824 
825  return domain;
826 }
827 
828 /*
829  * db_free_attribute_descriptor() - This function frees an attribute descriptor
830  * previously returned by db_get_attribute_descriptor.
831  * return : error code
832  * descriptor(in): attribute descriptor
833  */
834 void
836 {
837  sm_free_descriptor ((SM_DESCRIPTOR *) descriptor);
838 }
839 
840 /*
841  * db_get_method_descriptor() - This function builds a method descriptor for
842  * the named method associated with the given class. The descriptor can
843  * then be used by the other descriptor functions rather than continuing
844  * to access the method by name. This saves time for repeated invocations
845  * of the same method.
846  * An error is returned if the object does not have a method with the
847  * given name. If an error is returned, a method descriptor is NOT returned.
848  * return : error code
849  * obj(in): instance or class
850  * methname(in): method name
851  * class_method(in): non-zero if class method name is given
852  * descriptor(out): returned method descriptor
853  *
854  * note :The method descriptor must be freed with db_free_method_descriptor.
855  */
856 int
857 db_get_method_descriptor (DB_OBJECT * obj, const char *methname, int class_method, DB_METHDESC ** descriptor)
858 {
859  int retval;
860 
862  CHECK_3ARGS_ERROR (obj, methname, descriptor);
863 
864  retval = sm_get_method_descriptor (obj, methname, class_method, descriptor);
865  return retval;
866 }
867 
868 /*
869  * db_free_method_descriptor() - This function frees a method descriptor that
870  * was previously returned by db_get_method_descriptor.
871  * return : error code
872  * descriptor(in): method descriptor
873  */
874 void
876 {
877  sm_free_descriptor (descriptor);
878 }
879 
880 /*
881  * db_dget() - This function is the same as db_get() except that the attribute
882  * is identified through a descriptor rather than by name.
883  * return : error code
884  * obj(in): instance or class
885  * attribute(in): attribute descriptor
886  * value(out): value container (set on return)
887  */
888 int
889 db_dget (DB_OBJECT * obj, DB_ATTDESC * attribute, DB_VALUE * value)
890 {
891  int retval;
892 
894 
895  /* checks NULL */
896  retval = obj_desc_get (obj, attribute, value);
897  return retval;
898 }
899 
900 /*
901  * db_dput() - Please refer to the db_dput_internal function.
902  * return : error code
903  * obj(in): instance or class
904  * attribute(in): attribute descriptor
905  * value(in): value container (with value to assign)
906  */
907 int
908 db_dput (DB_OBJECT * obj, DB_ATTDESC * attribute, DB_VALUE * value)
909 {
910  int error = NO_ERROR;
911 
914 
916  if (!error)
917  {
918  error = db_dput_internal (obj, attribute, value);
919  }
920  return error;
921 }
922 
923 
924 /*
925  * db_dput() - This function is the same as db_put_internal() except that the
926  * attribute is identified through a descriptor rather than by name.
927  * return : error code
928  * obj(in): instance or class
929  * attribute(in): attribute descriptor
930  * value(in): value container (with value to assign)
931  */
932 int
933 db_dput_internal (DB_OBJECT * obj, DB_ATTDESC * attribute, DB_VALUE * value)
934 {
935  int retval;
936 
939 
940  retval = obj_desc_set (obj, attribute, value);
941 
942  return retval;
943 }
944 
945 /*
946  * dbt_dput() - Please refer to the dbt_dput_internal() function.
947  * returns/side-effects: error code
948  * def(in) : template
949  * attribute(in): attribute descriptor
950  * value(in): container with value to assign
951  */
952 int
953 dbt_dput (DB_OTMPL * def, DB_ATTDESC * attribute, DB_VALUE * value)
954 {
955  int error = NO_ERROR;
956 
959 
960  error = do_check_partitioned_class (def->classobj, CHECK_PARTITION_NONE, attribute->name);
961  if (!error)
962  {
963  error = dbt_dput_internal (def, attribute, value);
964  }
965  return error;
966 }
967 
968 /*
969  * dbt_dput() - This is the same as dbt_put_internal() except the attribute is
970  * identified through a descriptor rather than by name.
971  * returns/side-effects: error code
972  * def(in) : template
973  * attribute(in): attribute descriptor
974  * value(in): container with value to assign
975  */
976 int
977 dbt_dput_internal (DB_OTMPL * def, DB_ATTDESC * attribute, DB_VALUE * value)
978 {
979  int retval;
980 
983 
984  retval = obt_desc_set (def, attribute, value);
985 
986  return retval;
987 }
988 
989 /*
990  * db_dsend() - This is the same as db_send() except that the method is
991  * identified through a descriptor rather than by name.
992  * return : error code
993  * obj: instance or class
994  * method: method descriptor
995  * returnval: return value
996  * ...: argument list on the stack
997  */
998 int
999 db_dsend (DB_OBJECT * obj, DB_METHDESC * method, DB_VALUE * returnval, ...)
1000 {
1001  int error = NO_ERROR;
1002  va_list args;
1003 
1005 
1006  va_start (args, returnval);
1007  error = obj_desc_send_va (obj, method, returnval, args);
1008  va_end (args);
1009  return error;
1010 }
1011 
1012 /*
1013  * db_dsend_arglist() - This is the same as db_send_arglist() except that the
1014  * method is identified through a descriptor rather than by name.
1015  * return : error code
1016  * obj(in) : instance or class
1017  * method(in) : method descriptor
1018  * returnval(out): return value
1019  * atgs(in) : argument list
1020  */
1021 int
1022 db_dsend_arglist (DB_OBJECT * obj, DB_METHDESC * method, DB_VALUE * returnval, DB_VALUE_LIST * args)
1023 {
1024  int retval;
1025 
1027 
1028  retval = obj_desc_send_list (obj, method, returnval, args);
1029  return retval;
1030 }
1031 
1032 /*
1033  * db_dsend_argarray() - This is the same as db_send_argarray() except that the
1034  * method is identified through a descriptor rather than by name.
1035  * return : error code
1036  * obj(in) : instance or class
1037  * method(in) : method descriptor
1038  * returnval(out): return value
1039  * atgs(in) : argument list
1040  */
1041 int
1042 db_dsend_argarray (DB_OBJECT * obj, DB_METHDESC * method, DB_VALUE * returnval, DB_VALUE ** args)
1043 {
1044  int retval;
1045 
1047 
1048  retval = obj_desc_send_array (obj, method, returnval, args);
1049  return retval;
1050 }
1051 
1052 /*
1053  * db_dsend_quick() - This is a variation of db_dsend_argarray(). It is
1054  * intended for use only by the CUBRID parser. It uses a method descriptor
1055  * to locate the method to invoke. Unlike the other "send" functions, this
1056  * one will not perform any type validation or corecion on the supplied
1057  * arguments. It is assumed that the arguments are correct and they will
1058  * be passed directly to the method function.
1059  * return : error code
1060  * obj(in) : instance or class
1061  * method(in) : method descriptor
1062  * returnval(out): return value
1063  * nargs(in): number of arguments in array
1064  * atgs(in) : argument list
1065  */
1066 int
1067 db_dsend_quick (DB_OBJECT * obj, DB_METHDESC * method, DB_VALUE * returnval, int nargs, DB_VALUE ** args)
1068 {
1069  int retval;
1070 
1072 
1073  retval = obj_desc_send_array_quick (obj, method, returnval, nargs, args);
1074  return retval;
1075 }
1076 
1077 /*
1078  * MISC INFORMATION
1079  */
1080 
1081 /*
1082  * db_find_unique() - This function is used to locate the instance whose
1083  * attribute has a particular unique value. This works for attributes
1084  * that have been defined with the UNIQUE integrity constraint and for
1085  * indexed attributes.
1086  * return : object with the unique value
1087  * classop(in): class pointer
1088  * attname(in): attribute name
1089  * value(in): value to look for
1090  */
1091 DB_OBJECT *
1092 db_find_unique (MOP classmop, const char *attname, DB_VALUE * value)
1093 {
1094  DB_OBJECT *retval;
1095 
1096  CHECK_CONNECT_NULL ();
1097  CHECK_3ARGS_NULL (classmop, attname, value);
1098 
1099  retval = obj_find_unique (classmop, attname, value, AU_FETCH_READ);
1100 
1101  return retval;
1102 }
1103 
1104 /*
1105  * db_find_unique_write_mode() - This function can be used to locate the
1106  * instance whose attribute has a particular unique value and fetch for
1107  * UPDATE. This will only work for attributes that have been defined with
1108  * the UNIQUE integrity constraint.
1109  * return : object with the unique value
1110  * classop(in): class pointer
1111  * attname(in): attribute name
1112  * value(in): value to look for
1113  */
1114 DB_OBJECT *
1115 db_find_unique_write_mode (MOP classmop, const char *attname, DB_VALUE * value)
1116 {
1117  DB_OBJECT *retval;
1118 
1119  CHECK_CONNECT_NULL ();
1120  CHECK_3ARGS_NULL (classmop, attname, value);
1121 
1122  retval = obj_find_unique (classmop, attname, value, AU_FETCH_UPDATE);
1123 
1124  return retval;
1125 }
1126 
1127 /*
1128  * db_find_primary_key() - This can be used to locate the instance whose
1129  * primary key has a particular unique value. This will only work for
1130  * class that have been defined with the PRIMARY KEY constraint.
1131  * return : object with the primary key value
1132  * classop(in): class pointer
1133  * values(in): list of value to look for
1134  * size(in): size of value list
1135  * purpose(in): Fetch purpose DB_FETCH_READ or DB_FETCH_WRITE
1136  */
1137 DB_OBJECT *
1138 db_find_primary_key (MOP classmop, const DB_VALUE ** values, int size, DB_FETCH_MODE purpose)
1139 {
1140  DB_OBJECT *retval;
1141 
1142  CHECK_CONNECT_NULL ();
1143  CHECK_2ARGS_NULL (classmop, values);
1144  if (size == 0)
1145  {
1147  return NULL;
1148  }
1149 
1150  retval = obj_find_primary_key (classmop, values, size, purpose == DB_FETCH_WRITE ? AU_FETCH_UPDATE : AU_FETCH_READ);
1151 
1152  return retval;
1153 }
1154 
1155 /*
1156  * db_find_multi_unique() - This can be used to locate the instance whose
1157  * attribute has a particular unique value. This will only work for
1158  * attributes that have been defined with the UNIQUE integrity constraint.
1159  * return : object with the unique value
1160  * classop(in): class pointer
1161  * size(in): size of value arrays
1162  * attr_names(in): array of attribute names
1163  * values(in): array of values to look for
1164  * purpose(in): Fetch purpose DB_FETCH_READ
1165  * DB_FETCH_WRITE
1166  *
1167  */
1168 DB_OBJECT *
1169 db_find_multi_unique (MOP classmop, int size, char *attr_names[], DB_VALUE * values[], DB_FETCH_MODE purpose)
1170 {
1171  DB_OBJECT *retval = NULL;
1172 
1173  CHECK_CONNECT_NULL ();
1174  CHECK_3ARGS_NULL (classmop, attr_names, values);
1175 
1176  if (size < 1)
1177  {
1179  return NULL;
1180  }
1181 
1182  retval =
1183  obj_find_multi_attr (classmop, size, (const char **) attr_names, (const DB_VALUE **) values,
1185 
1186  return retval;
1187 }
1188 
1189 /*
1190  * db_dfind_unique() - This can be used to locate the instance whose attribute
1191  * has a particular unique value. This will only work for attributes that
1192  * have been defined with the UNIQUE integrity constraint.
1193  * returns/side-effects: object with the unique value
1194  * classop(in): class pointer
1195  * attdesc(in): attribute descriptor
1196  * value(in) : value to look for
1197  * purpose(in): Fetch purpose DB_FETCH_READ or DB_FETCH_WRITE
1198  */
1199 DB_OBJECT *
1200 db_dfind_unique (MOP classmop, DB_ATTDESC * attdesc, DB_VALUE * value, DB_FETCH_MODE purpose)
1201 {
1202  DB_OBJECT *retval;
1203 
1204  CHECK_CONNECT_NULL ();
1205  CHECK_3ARGS_NULL (classmop, attdesc, value);
1206 
1207  retval = obj_desc_find_unique (classmop, attdesc, value, purpose == DB_FETCH_WRITE ? AU_FETCH_UPDATE : AU_FETCH_READ);
1208 
1209  return retval;
1210 }
1211 
1212 /*
1213  * db_dfind_multi_unique() - This can be used to locate the instance whose
1214  * attribute has a particular unique value. This will only work for
1215  * attributes that have been defined with the UNIQUE integrity constraint.
1216  * return : object with the unique value
1217  * classop(in): class pointer
1218  * size(in): size of value arrays
1219  * attdesc(in): array of attribute desc
1220  * values(in) : array of values to look for
1221  * purpose(in): Fetch purpose DB_FETCH_READ or DB_FETCH_WRITE
1222  */
1223 DB_OBJECT *
1224 db_dfind_multi_unique (MOP classmop, int size, DB_ATTDESC * attdesc[], DB_VALUE * values[], DB_FETCH_MODE purpose)
1225 {
1226  DB_OBJECT *retval = NULL;
1227 
1228  CHECK_CONNECT_NULL ();
1229  CHECK_3ARGS_NULL (classmop, attdesc, values);
1230 
1231  if (size < 1)
1232  {
1234  return NULL;
1235  }
1236 
1237  retval =
1238  obj_find_multi_desc (classmop, size, (const DB_ATTDESC **) attdesc, (const DB_VALUE **) values,
1240 
1241  return retval;
1242 }
1243 
1244 /*
1245  * db_print() - This function displays a text description of an object
1246  * to the terminal.
1247  * return : none
1248  * obj(in): instance or class
1249  */
1250 void
1252 {
1253  CHECK_CONNECT_VOID ();
1254 
1255  if (obj != NULL)
1256  {
1258  }
1259 }
1260 
1261 /*
1262  * db_fprint() - This function writes a text description of an object to a file
1263  * return : none
1264  * fp(in) : file pointer
1265  * obj(in): instance or class
1266  */
1267 void
1268 db_fprint (FILE * fp, DB_OBJECT * obj)
1269 {
1270  file_print_output output (fp);
1271  CHECK_CONNECT_VOID ();
1272 
1273  if (fp != NULL && obj != NULL)
1274  {
1275  help_print_obj (output, obj);
1276  }
1277 }
1278 
1279 /*
1280  * TRIGGERS
1281  */
1282 
1283 /*
1284  * db_create_trigger() - This function creates a new trigger and installs it
1285  * into the system. The trigger object returned can be passed to the other
1286  * db_trigger_ functions that expect a trigger object.
1287  * return : trigger object, NULL if error
1288  * name(in): trigger name
1289  * status(in): initail status (TR_ACTIVE or TR_INACTIVE)
1290  * priority(in): initial priority
1291  * event(in): event type
1292  * class(in): target class (for class event types)
1293  * attr(in): target attribute name (optional)
1294  * cond_time(in): condition time
1295  * cond_source(in): condition source
1296  * action_time(in): action time
1297  * action_type(in): action type
1298  * action_source(in): action source (simple text if type is TR_ACT_PRINT)
1299  */
1300 DB_OBJECT *
1301 db_create_trigger (const char *name, DB_TRIGGER_STATUS status, double priority, DB_TRIGGER_EVENT event,
1302  DB_OBJECT * class_, const char *attr, DB_TRIGGER_TIME cond_time, const char *cond_source,
1303  DB_TRIGGER_TIME action_time, DB_TRIGGER_ACTION action_type, const char *action_source)
1304 {
1305  DB_OBJECT *retval;
1306 
1307  CHECK_CONNECT_NULL ();
1309 
1310  /* check for invalid arguments */
1311  retval = tr_create_trigger (name, status, priority, event, class_, attr, cond_time, cond_source, action_time,
1312  action_type, action_source, NULL);
1313 
1314  return retval;
1315 }
1316 
1317 /*
1318  * db_drop_trigger() - This function deletes a trigger from the system.
1319  * The user must have the appropriate authorization on the trigger
1320  * in order to delete it.
1321  * return : error code
1322  * obj(in): trigger object
1323  */
1324 int
1326 {
1327  int retval;
1328 
1330  CHECK_1ARG_ERROR (obj);
1332 
1333  /* auditing will be done at tr_drop_trigger() */
1334  retval = tr_drop_trigger (obj, true);
1335  return retval;
1336 }
1337 
1338 /*
1339  * db_rename_trigger() - This function renames a trigger.
1340  * The new name must not already be the name of an existing trigger.
1341  * returns/side-effects: error code
1342  * trobj(in) : trigger object
1343  * newname(in): new name
1344  */
1345 int
1346 db_rename_trigger (DB_OBJECT * obj, const char *newname)
1347 {
1348  int retval;
1349 
1351  CHECK_2ARGS_ERROR (obj, newname);
1353 
1354  /* auditing will be done at tr_rename_trigger() */
1355  retval = tr_rename_trigger (obj, newname, true);
1356  return retval;
1357 }
1358 
1359 /*
1360  * db_find_trigger() - This function locates a trigger with the given name.
1361  * NULL is returned if a trigger by this name does not exist, or it the
1362  * user does not have the appropriate access privilege for the trigger.
1363  * If NULL is returned, the system sets the global error status to a value
1364  * that indicates the exact nature of the error.
1365  * return : trigger object (NULL if error)
1366  * name(in): trigger name
1367  */
1368 
1369 DB_OBJECT *
1370 db_find_trigger (const char *name)
1371 {
1372  DB_OBJECT *retval;
1373 
1374  CHECK_CONNECT_NULL ();
1375  CHECK_1ARG_NULL (name);
1376 
1377  retval = tr_find_trigger (name);
1378 
1379  return retval;
1380 }
1381 
1382 /*
1383  * db_find_all_triggers() - This function returns a list of all triggers that
1384  * are accessible to the current user. This includes any "user" triggers
1385  * the user has defined and any "class" triggers associated with classes for
1386  * which the user has the SELECT authorization.
1387  * Returns: error code
1388  * list(out): pointer to the return trigger object list
1389  *
1390  * note : The returned object list must be freed using db_objlist_free() when
1391  * it is no longer needed.
1392  */
1393 int
1395 {
1396  int retval;
1397 
1399  CHECK_1ARG_ERROR (list);
1400 
1401  retval = tr_find_all_triggers (list);
1402  return retval;
1403 }
1404 
1405 /*
1406  * db_find_event_triggers() - This function returns a list of object pointers
1407  * containing all triggers that have the given event type and event target
1408  * (class and attribute). These object pointers are returned through the list
1409  * argument. The list contains every user trigger that is owned by the user,
1410  * and every class trigger for which the user has the SELECT privilege on
1411  * the class in its event target.
1412  * Returns: error code
1413  * event(in): event type
1414  * class(in): target class
1415  * attr(in) : target attribute
1416  * list(out): pointer to the return list of object pointers
1417  *
1418  * note : The returned object list must be freed by db_objlist_free.
1419  */
1420 int
1421 db_find_event_triggers (DB_TRIGGER_EVENT event, DB_OBJECT * class_, const char *attr, DB_OBJLIST ** list)
1422 {
1423  int retval;
1424 
1426 
1427  retval = tr_find_event_triggers (event, class_, attr, false, list);
1428  return retval;
1429 }
1430 
1431 /*
1432  * db_alter_trigger_priority() - This function changes a trigger's priority.
1433  * return : error code
1434  * trobj(in) : trigger object
1435  * priority(in): new priority
1436  */
1437 int
1438 db_alter_trigger_priority (DB_OBJECT * trobj, double priority)
1439 {
1440  int retval;
1441 
1443  CHECK_1ARG_ERROR (trobj);
1445 
1446  /* auditing will be done at tr_set_priority() */
1447  retval = tr_set_priority (trobj, priority, true);
1448  return retval;
1449 }
1450 
1451 /*
1452  * db_alter_trigger_status() - This function is used to change the status of a
1453  * trigger. An error code is returned when access to the internal object
1454  * that contains the trigger definition cannot be obtained, or when the user
1455  * is not authorized to change the status of the given trigger.
1456  * return : error code
1457  * trobj(in) : trigger object
1458  * status(in): new status
1459  *
1460  */
1461 int
1463 {
1464  int retval;
1465 
1467  CHECK_1ARG_ERROR (trobj);
1469 
1470  /* auditing will be done at tr_set_status() */
1471  retval = tr_set_status (trobj, status, true);
1472  return retval;
1473 }
1474 
1475 /*
1476  * db_execute_deferred_activities() -
1477  * This function executes deferred activities for a trigger. Normally
1478  * deferred activities are executed when the transaction is committed,
1479  * this function can cause the earily execution of selected activities.
1480  * If both the trigger and target arguments are NULL, all of the
1481  * deferred acitvities are executed.
1482  * If the trigger argument is specied with a NULL target, only
1483  * those activities that were deferred by the given trigger ware executed.
1484  * If both the trigger argument and the target argument are specified,
1485  * only those activities that were associated with the given target
1486  * object by the given trigger are executed.
1487  * If the trigger argument is NULL and the target argument is non-NULL,
1488  * all deferrec activities associated with the target object are executed
1489  * regardless of the trigger that caused the deferred activity.
1490  *
1491  * return : error code
1492  * trigger(in): trigger object
1493  * object(in): associated target instance
1494  */
1495 int
1497 {
1498  int retval;
1499 
1502 
1503  retval = tr_execute_deferred_activities (trigger_obj, target);
1504  return retval;
1505 }
1506 
1507 /*
1508  * db_drop_deferred_activities() -
1509  * This function removes deferred activities for a trigger. This will
1510  * prevent the scheduled activities from being executed with either the
1511  * transaction commits or when the db_exectue_deferred_activities function
1512  * is called. If both the trigger and target arguments are NULL, all of the
1513  * deferred acitvities are executed. If the trigger argument is specied
1514  * with a NULL target, only those activities that were deferred by the given
1515  * trigger ware executed.
1516  * If both the trigger argument and the target argument are specified, only
1517  * those activities that were associated with the given target object by the
1518  * given trigger are executed. If the trigger argument is NULL and the
1519  * target argument is non-NULL, all deferrec activities associated with the
1520  * target object are executed regardless of the trigger that caused the
1521  * deferred activity.
1522  * return : error code
1523  * trigger(in): trigger object
1524  * object(in) : associated target instance
1525  */
1526 int
1528 {
1529  int retval;
1530 
1533 
1534  retval = tr_drop_deferred_activities (trigger_obj, target);
1535  return retval;
1536 }
1537 
1538 /*
1539  * db_trigger_name() - This function returns the name of an input trigger.
1540  * return : error code
1541  * trobj(in): trigger object
1542  * name(out): trigger name (returned)
1543  *
1544  * note : The string containing the trigger name must be freed with the
1545  * db_string_free() function.
1546  */
1547 int
1548 db_trigger_name (DB_OBJECT * trobj, char **name)
1549 {
1550  int retval;
1551 
1553  CHECK_2ARGS_ERROR (trobj, name);
1554 
1555  retval = (tr_trigger_name (trobj, name));
1556  return retval;
1557 }
1558 
1559 /*
1560  * db_trigger_status() - This function finds the current status of the given
1561  * input trigger.
1562  * return : error code
1563  * trobj(in): trigger object
1564  * status(out): trigger status (returned)
1565  */
1566 int
1568 {
1569  int retval;
1570 
1572  CHECK_2ARGS_ERROR (trobj, status);
1573 
1574  retval = (tr_trigger_status (trobj, status));
1575  return retval;
1576 }
1577 
1578 /*
1579  * db_trigger_priority() -This function finds the priority of the input trigger
1580  * return : error code
1581  * trobj(in): trigger object
1582  * priority(out): trigger status (returned)
1583  */
1584 int
1585 db_trigger_priority (DB_OBJECT * trobj, double *priority)
1586 {
1587  int retval;
1588 
1590  CHECK_2ARGS_ERROR (trobj, priority);
1591 
1592  retval = (tr_trigger_priority (trobj, priority));
1593  return retval;
1594 }
1595 
1596 /*
1597  * db_trigger_event() - This function finds the event type of the input trigger
1598  * return : error code
1599  * trobj(in): trigger object
1600  * event(out): trigger status (returned)
1601  */
1602 int
1604 {
1605  int retval;
1606 
1608  CHECK_2ARGS_ERROR (trobj, event);
1609 
1610  retval = (tr_trigger_event (trobj, event));
1611  return retval;
1612 }
1613 
1614 /*
1615  * db_trigger_class() - This function finds the target class of the input
1616  * trigger. If the trigger does not have a target class, the class argument
1617  * returns NULL.
1618  * return : error code
1619  * trobj(in): trigger object
1620  * class(out): trigger target class (returned)
1621  */
1622 int
1624 {
1625  int retval;
1626 
1628  CHECK_2ARGS_ERROR (trobj, class_);
1629 
1630  retval = (tr_trigger_class (trobj, class_));
1631  return retval;
1632 }
1633 
1634 /*
1635  * db_trigger_attribute() - This function finds the target attribute of the
1636  * input trigger. If the trigger does not have a target attribute,
1637  * the attr argument returns NULL.
1638  * return : error code
1639  * trobj(in): trigger object
1640  * attr(out): target attribute (returned)
1641  */
1642 int
1643 db_trigger_attribute (DB_OBJECT * trobj, char **attr)
1644 {
1645  int retval;
1646 
1648  CHECK_2ARGS_ERROR (trobj, attr);
1649 
1650  retval = (tr_trigger_attribute (trobj, attr));
1651  return retval;
1652 }
1653 
1654 /*
1655  * db_trigger_condition() - This function finds the condition expression string
1656  * of the input trigger. If the given trigger does not have a condition, the
1657  * condition argument returns NULL.
1658  * return : error code
1659  * trobj(in): trigger object
1660  * condition(out): target condition (returned)
1661  */
1662 int
1663 db_trigger_condition (DB_OBJECT * trobj, char **condition)
1664 {
1665  int retval;
1666 
1668  CHECK_2ARGS_ERROR (trobj, condition);
1669 
1670  retval = (tr_trigger_condition (trobj, condition));
1671  return retval;
1672 }
1673 
1674 /*
1675  * db_trigger_condition_time() - This function finds the execution time of the
1676  * trigger condition. Even if the given trigger does not have a condition,
1677  * the time argument still returns a default execution time.
1678  * return : error code
1679  * trobj(in): trigger object
1680  * tr_time(out): execution time of the trigger condition(returned)
1681  */
1682 int
1684 {
1685  int retval;
1686 
1688  CHECK_2ARGS_ERROR (trobj, tr_time);
1689 
1690  retval = (tr_trigger_condition_time (trobj, tr_time));
1691  return retval;
1692 }
1693 
1694 /*
1695  * db_trigger_action_type() - This function finds the action type of
1696  * the trigger. If the action type specified is TR_ACT_EXPRESSION, then
1697  * the db_trigger_action() function can be used to get the source of
1698  * the trigger expression. If the action type is TR_ACT_PRINT, then
1699  * the db_trigger_action(function returns the text to be printed.
1700  * return : error code
1701  * trobj(in): trigger object
1702  * type(out): action type of trigger (returned)
1703  */
1704 int
1706 {
1707  int retval;
1708 
1710  CHECK_2ARGS_ERROR (trobj, type);
1711 
1712  retval = (tr_trigger_action_type (trobj, type));
1713  return retval;
1714 }
1715 
1716 /*
1717  * db_trigger_action_time() - This function finds the execution time of the
1718  * trigger action.
1719  * return : error code
1720  * trobj(in): trigger object
1721  * tr_time(out): execution time of the trigger action (returned)
1722  */
1723 int
1725 {
1726  int retval;
1727 
1729  CHECK_2ARGS_ERROR (trobj, tr_time);
1730 
1731  retval = (tr_trigger_action_time (trobj, tr_time));
1732  return retval;
1733 }
1734 
1735 /*
1736  * db_trigger_action() - This function finds the action of the input trigger.
1737  * return : error code
1738  * trobj(in): trigger object
1739  * action(out): action string(returned)
1740  */
1741 int
1742 db_trigger_action (DB_OBJECT * trobj, char **action)
1743 {
1744  int retval;
1745 
1747  CHECK_2ARGS_ERROR (trobj, action);
1748 
1749  retval = (tr_trigger_action (trobj, action));
1750  return retval;
1751 }
1752 
1753 /*
1754  * db_trigger_comment() - This function returns the comment of an input trigger.
1755  * return : error code
1756  * trobj(in): trigger object
1757  * comment(out): trigger comment (returned)
1758  *
1759  * note : The string containing the trigger comment must be freed with the
1760  * db_string_free() function.
1761  */
1762 int
1763 db_trigger_comment (DB_OBJECT * trobj, char **comment)
1764 {
1765  int retval;
1766 
1768  CHECK_2ARGS_ERROR (trobj, comment);
1769 
1770  retval = (tr_trigger_comment (trobj, comment));
1771  return retval;
1772 }
1773 
1774 /*
1775  * db_encode_object() - This function converts an object handle into a
1776  * null-terminated string-encoded OID. It sets encoded_string to the
1777  * null-terminated string form of object, and actual_length to the
1778  * length of encoded_string.
1779  * return: error code
1780  * object(in) : memory workspace form of an object handle
1781  * encoded_string(out) : null-terminated string form of an object handle
1782  * allocated_length(in): the size of allocated string buffer
1783  * actual_length(out) : the actual length of string needed to hold the
1784  * encoded object
1785  */
1786 int
1787 db_encode_object (DB_OBJECT * object, char *string, int allocated_length, int *actual_length)
1788 {
1789  int result = NO_ERROR;
1790 
1791  result = vid_encode_object (object, string, allocated_length, actual_length);
1792  return result;
1793 }
1794 
1795 /*
1796  * db_decode_object() - This function converts a null-terminated string OID
1797  * into an object handle. It requires that encoded_string come from a
1798  * successful call to db_encode_object(). It modifies the object and sets
1799  * it to the memory workspace form of the given encoded_string.
1800  * returns: error code
1801  * string(in): null-terminated string form of an object handle
1802  * object(out): memory workspace form of an object handle
1803  */
1804 int
1805 db_decode_object (const char *string, DB_OBJECT ** object)
1806 {
1807  int result = NO_ERROR;
1808 
1809  result = vid_decode_object (string, object);
1810  return result;
1811 }
1812 
1813 /*
1814  * db_get_serial_current_value() -
1815  * returns: error code
1816  * serial_name(in):
1817  * serial_value(out):
1818  */
1819 int
1820 db_get_serial_current_value (const char *serial_name, DB_VALUE * serial_value)
1821 {
1822  int result = NO_ERROR;
1823  MOP serial_class_mop, serial_mop;
1824  DB_IDENTIFIER serial_obj_id;
1825  int cached_num;
1826 
1827  if (serial_name == NULL || serial_name[0] == 0 || serial_value == NULL)
1828  {
1831  }
1832 
1833  serial_class_mop = sm_find_class (CT_SERIAL_NAME);
1834 
1835  serial_mop = do_get_serial_obj_id (&serial_obj_id, serial_class_mop, serial_name);
1836  if (serial_mop == NULL)
1837  {
1838  result = ER_QPROC_SERIAL_NOT_FOUND;
1840  return result;
1841  }
1842 
1843  result = do_get_serial_cached_num (&cached_num, serial_mop);
1844  if (result != NO_ERROR)
1845  {
1846  assert (er_errid () != NO_ERROR);
1847  return result;
1848  }
1849 
1850  result = serial_get_current_value (serial_value, &serial_obj_id, cached_num);
1851  if (result != NO_ERROR)
1852  {
1853  assert (er_errid () != NO_ERROR);
1854  }
1855 
1856  return result;
1857 }
1858 
1859 /*
1860  * db_get_serial_next_value() -
1861  * returns: error code
1862  * serial_name(in):
1863  * serial_value(out):
1864  */
1865 int
1866 db_get_serial_next_value (const char *serial_name, DB_VALUE * serial_value)
1867 {
1868  return db_get_serial_next_value_ex (serial_name, serial_value, 1);
1869 }
1870 
1871 /*
1872  * db_get_serial_next_value_ex() -
1873  * returns: error code
1874  * serial_name(in):
1875  * serial_value(out):
1876  */
1877 int
1878 db_get_serial_next_value_ex (const char *serial_name, DB_VALUE * serial_value, int num_alloc)
1879 {
1880  int result = NO_ERROR;
1881  MOP serial_class_mop, serial_mop;
1882  DB_IDENTIFIER serial_obj_id;
1883  int cached_num;
1884 
1885  if (serial_name == NULL || serial_name[0] == 0 || serial_value == NULL || num_alloc <= 0)
1886  {
1889  }
1890 
1891  serial_class_mop = sm_find_class (CT_CLASS_NAME);
1892 
1893  serial_mop = do_get_serial_obj_id (&serial_obj_id, serial_class_mop, serial_name);
1894  if (serial_mop == NULL)
1895  {
1896  result = ER_QPROC_SERIAL_NOT_FOUND;
1898  return result;
1899  }
1900 
1901  result = do_get_serial_cached_num (&cached_num, serial_mop);
1902  if (result != NO_ERROR)
1903  {
1904  assert (er_errid () != NO_ERROR);
1905  return result;
1906  }
1907 
1908  result = serial_get_next_value (serial_value, &serial_obj_id, cached_num, num_alloc, GENERATE_SERIAL);
1909  if (result != NO_ERROR)
1910  {
1911  assert (er_errid () != NO_ERROR);
1912  }
1913 
1914  return result;
1915 }
int obj_get_shared(MOP op, const char *name, DB_VALUE *value)
int db_trigger_comment(DB_OBJECT *trobj, char **comment)
Definition: db_obj.c:1763
MOP obj_find_multi_desc(MOP op, int size, const SM_DESCRIPTOR *desc[], const DB_VALUE *values[], AU_FETCHMODE fetchmode)
DB_DOMAIN * db_attdesc_domain(DB_ATTDESC *desc)
Definition: db_obj.c:790
int db_get_method_descriptor(DB_OBJECT *obj, const char *methname, int class_method, DB_METHDESC **descriptor)
Definition: db_obj.c:857
#define CHECK_MODIFICATION_ERROR()
Definition: db.h:121
#define NO_ERROR
Definition: error_code.h:46
int tr_find_event_triggers(DB_TRIGGER_EVENT event, DB_OBJECT *class_mop, const char *attribute, bool active, DB_OBJLIST **list)
int serial_get_next_value(DB_VALUE *value, OID *oid_p, int cached_num, int num_alloc, int is_auto_increment)
int do_get_serial_cached_num(int *cached_num, MOP serial_obj)
int db_find_all_triggers(DB_OBJLIST **list)
Definition: db_obj.c:1394
MOP obj_copy(MOP op)
int db_trigger_action_type(DB_OBJECT *trobj, DB_TRIGGER_ACTION *type)
Definition: db_obj.c:1705
int db_get_expression(DB_OBJECT *object, const char *expression, DB_VALUE *value)
Definition: db_obj.c:296
DB_OBJECT * db_create_internal(DB_OBJECT *obj)
Definition: db_obj.c:93
#define CHECK_2ARGS_ERROR(obj1, obj2)
Definition: db.h:195
int tr_trigger_condition(DB_OBJECT *trigger_object, char **condition)
int obj_delete(MOP op)
#define CHECK_PARTITION_PARENT
int db_get_serial_current_value(const char *serial_name, DB_VALUE *serial_value)
Definition: db_obj.c:1820
DB_ATTRIBUTE * db_get_class_attribute(DB_OBJECT *obj, const char *name)
Definition: db_info.c:878
int db_trigger_class(DB_OBJECT *trobj, DB_OBJECT **class_)
Definition: db_obj.c:1623
#define ER_REFERENCE_TO_NON_REFERABLE_NOT_ALLOWED
Definition: error_code.h:1231
int db_alter_trigger_status(DB_OBJECT *trobj, DB_TRIGGER_STATUS status)
Definition: db_obj.c:1462
int db_rename_trigger(DB_OBJECT *obj, const char *newname)
Definition: db_obj.c:1346
int tr_trigger_action_type(DB_OBJECT *trigger_object, DB_TRIGGER_ACTION *type)
int tr_trigger_attribute(DB_OBJECT *trigger_object, char **attribute)
DB_OBJECT * db_dfind_unique(MOP classmop, DB_ATTDESC *attdesc, DB_VALUE *value, DB_FETCH_MODE purpose)
Definition: db_obj.c:1200
int db_trigger_event(DB_OBJECT *trobj, DB_TRIGGER_EVENT *event)
Definition: db_obj.c:1603
int db_trigger_action_time(DB_OBJECT *trobj, DB_TRIGGER_TIME *tr_time)
Definition: db_obj.c:1724
#define CHECK_2ARGS_NULL(obj1, obj2)
Definition: db.h:174
int do_check_partitioned_class(DB_OBJECT *classop, int check_map, char *keyattr)
int db_trigger_condition_time(DB_OBJECT *trobj, DB_TRIGGER_TIME *tr_time)
Definition: db_obj.c:1683
int obt_set(OBJ_TEMPLATE *template_ptr, const char *attname, DB_VALUE *value)
DB_OBJECT * db_create_by_name(const char *name)
Definition: db_obj.c:115
MOP obj_find_unique(MOP op, const char *attname, DB_VALUE *value, AU_FETCHMODE fetchmode)
int obt_update(OBJ_TEMPLATE *template_ptr, MOP *newobj)
DB_OTMPL * dbt_create_object(MOP classobj)
Definition: db_obj.c:468
int tr_rename_trigger(DB_OBJECT *trigger_object, const char *name, bool call_from_api)
int obj_desc_set(MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value)
int dbt_dput_internal(DB_OTMPL *def, DB_ATTDESC *attribute, DB_VALUE *value)
Definition: db_obj.c:977
int tr_trigger_name(DB_OBJECT *trigger_object, char **name)
MOP obj_desc_find_unique(MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value, AU_FETCHMODE fetchmode)
int tr_trigger_priority(DB_OBJECT *trigger_object, double *priority)
int obj_desc_send_list(MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
DB_OBJECT * dbt_finish_object(DB_OTMPL *def)
Definition: db_obj.c:560
int er_errid(void)
void dbt_abort_object(DB_OTMPL *def)
Definition: db_obj.c:616
int tr_trigger_action(DB_OBJECT *trigger_object, char **action)
int tr_drop_trigger(DB_OBJECT *obj, bool call_from_api)
#define CT_CLASS_NAME
Definition: transform.h:119
int db_dsend_quick(DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval, int nargs, DB_VALUE **args)
Definition: db_obj.c:1067
int tr_trigger_comment(DB_OBJECT *trigger_object, char **comment)
void help_print_obj(print_output &output_ctx, MOP obj)
Definition: object_print.c:141
DB_OTMPL * dbt_create_object_internal(MOP classobj)
Definition: db_obj.c:501
int db_alter_trigger_priority(DB_OBJECT *trobj, double priority)
Definition: db_obj.c:1438
int db_find_event_triggers(DB_TRIGGER_EVENT event, DB_OBJECT *class_, const char *attr, DB_OBJLIST **list)
Definition: db_obj.c:1421
int db_send(MOP obj, const char *name, DB_VALUE *returnval,...)
Definition: db_obj.c:381
#define CT_SERIAL_NAME
Definition: transform.h:135
int obj_desc_send_array(MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, DB_VALUE **argarray)
int tr_set_status(DB_OBJECT *trigger_object, DB_TRIGGER_STATUS status, bool call_from_api)
int obj_send_va(MOP obj, const char *name, DB_VALUE *returnval, va_list args)
void db_fprint(FILE *fp, DB_OBJECT *obj)
Definition: db_obj.c:1268
DB_OBJECT * tr_find_trigger(const char *name)
#define CHECK_3ARGS_NULL(obj1, obj2, obj3)
Definition: db.h:177
DB_ATTRIBUTE * db_get_attribute(DB_OBJECT *obj, const char *name)
Definition: db_info.c:791
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
int dbt_dput(DB_OTMPL *def, DB_ATTDESC *attribute, DB_VALUE *value)
Definition: db_obj.c:953
DB_OBJECT * db_copy(MOP sourcemop)
Definition: db_obj.c:171
#define ER_QPROC_SERIAL_NOT_FOUND
Definition: error_code.h:965
#define ER_QPROC_INVALID_PARAMETER
Definition: error_code.h:963
int obt_quit(OBJ_TEMPLATE *template_ptr)
MOP obj_create_by_name(const char *name)
#define assert(x)
int obt_set_obt(OBJ_TEMPLATE *template_ptr, const char *attname, OBJ_TEMPLATE *value)
int tr_find_all_triggers(DB_OBJLIST **list)
int dbt_put_internal(DB_OTMPL *def, const char *name, DB_VALUE *value)
Definition: db_obj.c:670
DB_OBJECT * db_find_primary_key(MOP classmop, const DB_VALUE **values, int size, DB_FETCH_MODE purpose)
Definition: db_obj.c:1138
#define ER_GENERIC_ERROR
Definition: error_code.h:49
int tr_trigger_condition_time(DB_OBJECT *trigger_object, DB_TRIGGER_TIME *tr_time)
static file_print_output & std_output(void)
Definition: printer.cpp:36
DB_OBJECT * class_mop
Definition: class_object.h:903
int vid_decode_object(const char *string, DB_OBJECT **object)
#define CHECK_MODIFICATION_NULL()
Definition: db.h:124
OBJ_TEMPLATE * obt_def_object(MOP class_mop)
int vid_encode_object(DB_OBJECT *object, char *string, int allocated_length, int *actual_length)
#define CHECK_1ARG_ERROR(obj)
Definition: db.h:186
int tr_trigger_action_time(DB_OBJECT *trigger_object, DB_TRIGGER_TIME *tr_time)
#define DB_VALUE_DOMAIN_TYPE(value)
Definition: dbtype.h:70
void db_free_attribute_descriptor(DB_ATTDESC *descriptor)
Definition: db_obj.c:835
int db_put(DB_OBJECT *obj, const char *name, DB_VALUE *value)
Definition: db_obj.c:318
int db_get_serial_next_value_ex(const char *serial_name, DB_VALUE *serial_value, int num_alloc)
Definition: db_obj.c:1878
int db_put_internal(DB_OBJECT *obj, const char *name, DB_VALUE *value)
Definition: db_obj.c:347
#define CHECK_1ARG_NULL(obj)
Definition: db.h:171
int db_drop_trigger(DB_OBJECT *obj)
Definition: db_obj.c:1325
int obj_send_array(MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE **argarray)
int sm_filter_domain(TP_DOMAIN *domain, int *changes)
DB_OBJECT * db_find_multi_unique(MOP classmop, int size, char *attr_names[], DB_VALUE *values[], DB_FETCH_MODE purpose)
Definition: db_obj.c:1169
int db_trigger_priority(DB_OBJECT *trobj, double *priority)
Definition: db_obj.c:1585
int obj_desc_send_va(MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, va_list args)
#define CHECK_3ARGS_ERROR(obj1, obj2, obj3)
Definition: db.h:198
int db_get_attribute_descriptor(DB_OBJECT *obj, const char *attname, int class_attribute, int for_update, DB_ATTDESC **descriptor)
Definition: db_obj.c:763
int db_dput_internal(DB_OBJECT *obj, DB_ATTDESC *attribute, DB_VALUE *value)
Definition: db_obj.c:933
#define NULL
Definition: freelistheap.h:34
DB_OBJECT * db_create_by_name_internal(const char *name)
Definition: db_obj.c:145
int db_decode_object(const char *string, DB_OBJECT **object)
Definition: db_obj.c:1805
DB_OBJECT * db_get_class(MOP obj)
Definition: db_info.c:589
int db_drop(DB_OBJECT *obj)
Definition: db_obj.c:190
int db_send_arglist(MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE_LIST *args)
Definition: db_obj.c:417
int obt_desc_set(OBJ_TEMPLATE *template_ptr, SM_DESCRIPTOR *desc, DB_VALUE *value)
DB_OBJECT * db_create_trigger(const char *name, DB_TRIGGER_STATUS status, double priority, DB_TRIGGER_EVENT event, DB_OBJECT *class_, const char *attr, DB_TRIGGER_TIME cond_time, const char *cond_source, DB_TRIGGER_TIME action_time, DB_TRIGGER_ACTION action_type, const char *action_source)
Definition: db_obj.c:1301
DB_OBJECT * db_find_unique_write_mode(MOP classmop, const char *attname, DB_VALUE *value)
Definition: db_obj.c:1115
int obj_desc_get(MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value)
DB_DOMAIN * db_attribute_domain(DB_ATTRIBUTE *attribute)
Definition: db_info.c:1165
DB_OBJECT * dbt_finish_object_and_decache_when_failure(DB_OTMPL *def)
Definition: db_obj.c:583
int tr_set_priority(DB_OBJECT *trigger_object, double priority, bool call_from_api)
DB_TRIGGER_TIME
Definition: dbtype_def.h:388
static void error(const char *msg)
Definition: gencat.c:331
SM_NAME_SPACE name_space
Definition: class_object.h:904
int sm_get_method_descriptor(DB_OBJECT *op, const char *name, int class_method, SM_DESCRIPTOR **desc_ptr)
int obj_send_list(MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
#define CHECK_PARTITION_SUBS
#define CHECK_CONNECT_NULL()
Definition: db.h:91
#define ARG_FILE_LINE
Definition: error_manager.h:44
MOP obj_find_primary_key(MOP op, const DB_VALUE **values, int size, AU_FETCHMODE fetchmode)
void ws_decache(MOP mop)
Definition: work_space.c:2701
int dbt_put(DB_OTMPL *def, const char *name, DB_VALUE *value)
Definition: db_obj.c:635
int db_send_argarray(MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE **args)
Definition: db_obj.c:444
int obj_set(MOP op, const char *name, DB_VALUE *value)
MOP obj_create(MOP classop)
int db_trigger_name(DB_OBJECT *trobj, char **name)
Definition: db_obj.c:1548
int db_dput(DB_OBJECT *obj, DB_ATTDESC *attribute, DB_VALUE *value)
Definition: db_obj.c:908
bool sm_is_reuse_oid_class(MOP op)
#define ER_OBJ_INVALID_ARGUMENTS
Definition: error_code.h:275
DB_TRIGGER_EVENT
Definition: dbtype_def.h:356
int obj_get_path(DB_OBJECT *object, const char *attpath, DB_VALUE *value)
void obt_set_label(OBJ_TEMPLATE *template_ptr, DB_VALUE *label)
OBJ_TEMPLATE * obt_edit_object(MOP object)
int tr_trigger_event(DB_OBJECT *trigger_object, DB_TRIGGER_EVENT *event)
int db_get(DB_OBJECT *object, const char *attpath, DB_VALUE *value)
Definition: db_obj.c:233
int db_trigger_attribute(DB_OBJECT *trobj, char **attr)
Definition: db_obj.c:1643
int obj_desc_send_array_quick(MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, int nargs, DB_VALUE **argarray)
int db_dget(DB_OBJECT *obj, DB_ATTDESC *attribute, DB_VALUE *value)
Definition: db_obj.c:889
int tr_trigger_status(DB_OBJECT *trigger_object, DB_TRIGGER_STATUS *status)
void db_print(DB_OBJECT *obj)
Definition: db_obj.c:1251
int db_trigger_condition(DB_OBJECT *trobj, char **condition)
Definition: db_obj.c:1663
#define DB_VALUE_TYPE(value)
Definition: dbtype.h:72
DB_OBJECT * db_find_trigger(const char *name)
Definition: db_obj.c:1370
DB_OTMPL * dbt_edit_object(MOP object)
Definition: db_obj.c:533
int serial_get_current_value(DB_VALUE *value, OID *oid_p, int cached_num)
int do_is_partitioned_subclass(int *is_partitioned, const char *classname, char *keyattr)
#define ER_NOT_ALLOWED_ACCESS_TO_PARTITION
Definition: error_code.h:1137
int db_trigger_action(DB_OBJECT *trobj, char **action)
Definition: db_obj.c:1742
DB_TRIGGER_STATUS
Definition: dbtype_def.h:344
int sm_get_attribute_descriptor(DB_OBJECT *op, const char *name, int class_attribute, int for_update, SM_DESCRIPTOR **desc_ptr)
DB_FETCH_MODE
Definition: dbtype_def.h:215
int mq_get_expression(DB_OBJECT *object, const char *expr, DB_VALUE *value)
int db_dsend_argarray(DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval, DB_VALUE **args)
Definition: db_obj.c:1042
MOP sm_find_class(const char *name)
DB_OBJECT * tr_create_trigger(const char *name, DB_TRIGGER_STATUS status, double priority, DB_TRIGGER_EVENT event, DB_OBJECT *class_mop, const char *attribute, DB_TRIGGER_TIME cond_time, const char *cond_source, DB_TRIGGER_TIME action_time, DB_TRIGGER_ACTION action_type, const char *action_source, const char *comment)
void sm_free_descriptor(SM_DESCRIPTOR *desc)
int db_get_shared(DB_OBJECT *object, const char *attname, DB_VALUE *value)
Definition: db_obj.c:255
int tr_trigger_class(DB_OBJECT *trigger_object, DB_OBJECT **class_mop_p)
DB_OBJECT * db_find_unique(MOP classmop, const char *attname, DB_VALUE *value)
Definition: db_obj.c:1092
#define CHECK_PARTITION_NONE
int db_execute_deferred_activities(DB_OBJECT *trigger_obj, DB_OBJECT *target)
Definition: db_obj.c:1496
int dbt_set_label(DB_OTMPL *def, DB_VALUE *label)
Definition: db_obj.c:713
void db_free_method_descriptor(DB_ATTDESC *descriptor)
Definition: db_obj.c:875
int db_trigger_status(DB_OBJECT *trobj, DB_TRIGGER_STATUS *status)
Definition: db_obj.c:1567
DB_TRIGGER_ACTION
Definition: dbtype_def.h:397
DB_C_POINTER db_get_pointer(const DB_VALUE *value)
int db_drop_deferred_activities(DB_OBJECT *trigger_obj, DB_OBJECT *target)
Definition: db_obj.c:1527
MOP do_get_serial_obj_id(DB_IDENTIFIER *serial_obj_id, DB_OBJECT *serial_class_mop, const char *serial_name)
#define CHECK_CONNECT_VOID()
Definition: db.h:70
int tr_drop_deferred_activities(DB_OBJECT *trigger_object, DB_OBJECT *target)
int db_encode_object(DB_OBJECT *object, char *string, int allocated_length, int *actual_length)
Definition: db_obj.c:1787
MOP obj_find_multi_attr(MOP op, int size, const char *attr_names[], const DB_VALUE *values[], AU_FETCHMODE fetchmode)
int db_dsend(DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval,...)
Definition: db_obj.c:999
int tr_execute_deferred_activities(DB_OBJECT *trigger_object, DB_OBJECT *target)
#define CHECK_CONNECT_ERROR()
Definition: db.h:88
DB_OBJECT * db_create(DB_OBJECT *obj)
Definition: db_obj.c:69
DB_OBJECT * db_dfind_multi_unique(MOP classmop, int size, DB_ATTDESC *attdesc[], DB_VALUE *values[], DB_FETCH_MODE purpose)
Definition: db_obj.c:1224
int db_dsend_arglist(DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval, DB_VALUE_LIST *args)
Definition: db_obj.c:1022
int db_get_serial_next_value(const char *serial_name, DB_VALUE *serial_value)
Definition: db_obj.c:1866