39 #define STRFREE_W(string) \ 40 if (string != NULL) db_string_free((char *) (string)) 121 char temp_buffer[64];
123 sprintf (temp_buffer,
"%f", trigger->
priority);
130 if (classname !=
NULL)
193 fprintf (file,
"Trigger : %s\n",
name);
197 fprintf (file,
"Status : %s\n",
status);
202 fprintf (file,
"Priority : %s\n",
priority);
209 fprintf (file,
"Condition : %s\n",
condition);
218 fprintf (file,
"Action : %s\n",
action);
223 fprintf (file,
"Comment '%s'\n",
comment);
258 output_ctx (
"CREATE TRIGGER ");
259 output_ctx (
"[%s]\n", trigger->
name);
261 output_ctx (
" PRIORITY %f\n", trigger->
priority);
280 output_ctx (
"[%s]", name);
284 output_ctx (
"([%s])", trigger->
attribute);
296 output_ctx (
" EXECUTE ");
307 output_ctx (
"REJECT");
310 output_ctx (
"INVALIDATE TRANSACTION");
379 for (i = 1; i < max && error ==
NO_ERROR; i += 2)
394 int is_system_class = 0;
406 if (is_system_class == 0)
411 output_ctx (
"call [change_trigger_owner]('%s'," " '%s') on class [db_root];\n\n",
415 else if (is_system_class < 0)
417 error = is_system_class;
439 for (cl = classes; cl !=
NULL; cl = cl->
next)
459 #define MAX_USER_NAME 32 466 if (
db_get (user,
"name", &value))
469 strcpy (namebuf,
"???");
475 strcpy (namebuf,
"???");
482 strncpy (namebuf, tmp,
sizeof (namebuf) - 1);
char * copy_string(const char *source)
DB_COLLECTION * db_get_set(const DB_VALUE *value)
int tr_dump_selective_triggers(print_output &output_ctx, DB_OBJLIST *classes)
int sm_is_system_class(MOP op)
const char * db_get_class_name(DB_OBJECT *class_)
int init(const char *name)
void set_free(DB_COLLECTION *set)
struct tr_activity * condition
const char * tr_time_as_string(DB_TRIGGER_TIME time)
#define ASSERT_ERROR_AND_SET(error_code)
#define SM_MAX_IDENTIFIER_LENGTH
static const char * describe_trigger_condition_time(const tr_trigger &trigger)
#define STRFREE_W(string)
int set_size(DB_COLLECTION *set)
static int is_required_trigger(TR_TRIGGER *trigger, DB_OBJLIST *classes)
void ws_free_string(const char *str)
DB_OBJECT * tr_find_trigger(const char *name)
struct tr_activity * action
int set_filter(DB_COLLECTION *set)
const char * sm_get_ch_name(MOP op)
DB_OBJECT * db_get_object(const DB_VALUE *value)
int set_get_element(DB_COLLECTION *set, int index, DB_VALUE *value)
static void error(const char *msg)
const char * condition_time
const char * tr_event_as_string(DB_TRIGGER_EVENT event)
int tr_dump_trigger(print_output &output_ctx, DB_OBJECT *trigger_object)
static char * get_user_name(DB_OBJECT *user)
void help_print_describe_comment(print_output &output_ctx, const char *comment)
int db_get(DB_OBJECT *object, const char *attpath, DB_VALUE *value)
const char * tr_status_as_string(DB_TRIGGER_STATUS status)
TR_TRIGGER * tr_map_trigger(DB_OBJECT *object, int fetch)
int db_trigger_condition(DB_OBJECT *trobj, char **condition)
#define DB_VALUE_TYPE(value)
static const char * describe_trigger_action_time(const tr_trigger &trigger)
#define DB_IS_NULL(value)
int db_trigger_action(DB_OBJECT *trobj, char **action)
int obj_get(MOP op, const char *name, DB_VALUE *value)
int db_value_clear(DB_VALUE *value)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)