CUBRID Engine  latest
csql_session.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  * csql_session.c : menu driver of csql
21  */
22 
23 #ident "$Id$"
24 
25 #include "config.h"
26 
27 #include <stdarg.h>
28 #include <string.h>
29 #include <signal.h>
30 #include <assert.h>
31 
32 #include "csql.h"
33 
34 #include "class_description.hpp"
35 #include "porting.h"
36 #include "memory_alloc.h"
37 #include "object_print.h"
38 #include "util_func.h"
39 #include "network_interface_cl.h"
40 #include "unicode_support.h"
41 #include "transaction_cl.h"
42 #include "trigger_description.hpp"
43 #include "db.h"
44 
45 /* for short usage of `csql_append_more_line()' and error check */
46 #define APPEND_MORE_LINE(indent, line) \
47  do { \
48  if(csql_append_more_line((indent), (line)) == CSQL_FAILURE) \
49  goto error; \
50  } while(0)
51 #define APPEND_HEAD_LINE(head_text) \
52  do { \
53  APPEND_MORE_LINE(0, ""); \
54  APPEND_MORE_LINE(1, (head_text)); \
55  APPEND_MORE_LINE(0, ""); \
56  } while(0)
57 
58 static jmp_buf csql_Jmp_buf;
59 
60 static void csql_pipe_handler (int sig_no);
61 static void csql_dump_alltran (volatile TRANS_INFO * info);
62 
63 
64 #define CMD_EMPTY_FLAG 0x00000000
65 #define CMD_CHECK_CONNECT 0x00000001
66 
67 /* session command table */
68 typedef struct
69 {
70  const char *text; /* lower case cmd name */
71  SESSION_CMD cmd_no; /* command number */
72  unsigned int flags;
74 
76  /* File stuffs */
77  {"read", S_CMD_READ, CMD_EMPTY_FLAG},
78  {"write", S_CMD_WRITE, CMD_EMPTY_FLAG},
79  {"append", S_CMD_APPEND, CMD_EMPTY_FLAG},
80  {"print", S_CMD_PRINT, CMD_EMPTY_FLAG},
81  {"shell", S_CMD_SHELL, CMD_EMPTY_FLAG},
82  {"!", S_CMD_SHELL, CMD_EMPTY_FLAG},
83  {"cd", S_CMD_CD, CMD_EMPTY_FLAG},
84  {"exit", S_CMD_EXIT, CMD_EMPTY_FLAG},
85  /* Edit stuffs */
86  {"clear", S_CMD_CLEAR, CMD_EMPTY_FLAG},
87  {"edit", S_CMD_EDIT, CMD_EMPTY_FLAG},
88  {"list", S_CMD_LIST, CMD_EMPTY_FLAG},
89  /* Command stuffs */
90  {"run", S_CMD_RUN, CMD_CHECK_CONNECT},
91  {"xrun", S_CMD_XRUN, CMD_CHECK_CONNECT},
92  {"commit", S_CMD_COMMIT, CMD_CHECK_CONNECT},
93  {"rollback", S_CMD_ROLLBACK, CMD_CHECK_CONNECT},
94  {"autocommit", S_CMD_AUTOCOMMIT, CMD_EMPTY_FLAG},
95  {"checkpoint", S_CMD_CHECKPOINT, CMD_CHECK_CONNECT},
96  {"killtran", S_CMD_KILLTRAN, CMD_CHECK_CONNECT},
97  {"restart", S_CMD_RESTART, CMD_EMPTY_FLAG},
98  /* Environment stuffs */
99  {"shell_cmd", S_CMD_SHELL_CMD, CMD_EMPTY_FLAG},
100  {"editor_cmd", S_CMD_EDIT_CMD, CMD_EMPTY_FLAG},
101  {"print_cmd", S_CMD_PRINT_CMD, CMD_EMPTY_FLAG},
102  {"pager_cmd", S_CMD_PAGER_CMD, CMD_EMPTY_FLAG},
103  {"nopager", S_CMD_NOPAGER_CMD, CMD_EMPTY_FLAG},
104  {"column-width", S_CMD_COLUMN_WIDTH, CMD_EMPTY_FLAG},
105  {"string-width", S_CMD_STRING_WIDTH, CMD_EMPTY_FLAG},
106  {"set", S_CMD_SET_PARAM, CMD_CHECK_CONNECT},
107  {"get", S_CMD_GET_PARAM, CMD_CHECK_CONNECT},
108  {"plan", S_CMD_PLAN_DUMP, CMD_CHECK_CONNECT},
109  {"echo", S_CMD_ECHO, CMD_EMPTY_FLAG},
110  {"date", S_CMD_DATE, CMD_EMPTY_FLAG},
111  {"time", S_CMD_TIME, CMD_EMPTY_FLAG},
112  {"line-output", S_CMD_LINE_OUTPUT, CMD_EMPTY_FLAG},
113  {".hist", S_CMD_HISTO, CMD_EMPTY_FLAG},
114  {".clear_hist", S_CMD_CLR_HISTO, CMD_EMPTY_FLAG},
115  {".dump_hist", S_CMD_DUMP_HISTO, CMD_EMPTY_FLAG},
116  {".x_hist", S_CMD_DUMP_CLR_HISTO, CMD_EMPTY_FLAG},
117  /* Help stuffs */
118  {"help", S_CMD_HELP, CMD_EMPTY_FLAG},
119  {"schema", S_CMD_SCHEMA, CMD_CHECK_CONNECT},
120  {"database", S_CMD_DATABASE, CMD_CHECK_CONNECT},
121  {"trigger", S_CMD_TRIGGER, CMD_CHECK_CONNECT},
122  {"info", S_CMD_INFO, CMD_EMPTY_FLAG},
123  /* history stuffs */
124  {"historyread", S_CMD_HISTORY_READ, CMD_EMPTY_FLAG},
125  {"historylist", S_CMD_HISTORY_LIST, CMD_EMPTY_FLAG},
126 
127  {"trace", S_CMD_TRACE, CMD_CHECK_CONNECT}
128 };
129 
130 /*
131  * csql_get_session_cmd_no() - find a session command
132  * return: SESSION_CMD number if success.
133  * if error, -1 is returned and csql_Error_code is set.
134  * input(in)
135  *
136  * Note:
137  * The search function succeed when there is only one entry which starts
138  * with the given string, or there is an entry which matches exactly.
139  */
140 int
142 {
143  int i; /* loop counter */
144  int input_cmd_length; /* input command length */
145  int num_matches = 0; /* # of matched commands */
146  int matched_index = -1; /* last matched entry index */
147 
148  if (*input == '\0')
149  {
150  /* csql>; means csql>;xrun */
151  return S_CMD_XRUN;
152  }
153 
154  input_cmd_length = (int) strlen (input);
155  num_matches = 0;
156  matched_index = -1;
157  for (i = 0; i < (int) DIM (csql_Session_cmd_table); i++)
158  {
159  if (strncasecmp (input, csql_Session_cmd_table[i].text, input_cmd_length) == 0)
160  {
161  int ses_cmd_length;
162 
163  ses_cmd_length = (int) strlen (csql_Session_cmd_table[i].text);
164  if (ses_cmd_length == input_cmd_length)
165  {
166  return (csql_Session_cmd_table[i].cmd_no);
167  }
168  num_matches++;
169  matched_index = i;
170  }
171  }
172  if (num_matches != 1)
173  {
175  return (-1);
176  }
177 #if defined (CS_MODE)
178  if (csql_Session_cmd_table[matched_index].flags & CMD_CHECK_CONNECT)
179  {
181  {
184  return (-1);
185  }
186  }
187 #endif
188 
189  return (csql_Session_cmd_table[matched_index].cmd_no);
190 }
191 
192 /*
193  * csql_help_menu() - display appropriate help message
194  * return: none
195  */
196 void
198 {
200  == CSQL_FAILURE)
201  {
202  goto error;
203  }
206 
208  return;
209 
210 error:
213 }
214 
215 /*
216  * csql_help_schema() - display schema information for given class name
217  * return: none
218  * class_name(in)
219  */
220 void
221 csql_help_schema (const char *class_name)
222 {
223  char **line_ptr;
224  char class_title[2 * DB_MAX_IDENTIFIER_LENGTH + 2];
225  char fixed_class_name[DB_MAX_IDENTIFIER_LENGTH];
226  char *class_name_composed = NULL;
227  int composed_size, class_name_size;
228  class_description class_descr;
229 
230  if (class_name == NULL || class_name[0] == 0)
231  {
233  goto error;
234  }
235 
236  /* class name may be in Unicode decomposed form, in DB we store only composed form */
237  class_name_size = (int) strlen (class_name);
239  && unicode_string_need_compose (class_name, class_name_size, &composed_size, lang_get_generic_unicode_norm ()))
240  {
241  bool is_composed = false;
242 
243  class_name_composed = (char *) malloc (composed_size + 1);
244  if (class_name_composed == NULL)
245  {
247  goto error;
248  }
249 
250  unicode_compose_string (class_name, class_name_size, class_name_composed, &composed_size, &is_composed,
252  class_name_composed[composed_size] = '\0';
253  assert (composed_size <= class_name_size);
254 
255  if (is_composed)
256  {
257  class_name = class_name_composed;
258  }
259  }
260 
261  if (strlen (class_name) >= DB_MAX_IDENTIFIER_LENGTH)
262  {
264  goto error;
265  }
266  else
267  {
268  strcpy (fixed_class_name, class_name);
269  /* check that both lower and upper case are not truncated */
270  if (intl_identifier_fix (fixed_class_name, -1, true) != NO_ERROR)
271  {
273  goto error;
274  }
275  class_name = fixed_class_name;
276  }
277 
278  if (class_descr.init (class_name) != NO_ERROR)
279  {
281  goto error;
282  }
283 
284  snprintf (class_title, (2 * DB_MAX_IDENTIFIER_LENGTH + 2),
286  class_descr.class_type);
287  APPEND_HEAD_LINE (class_title);
288  APPEND_MORE_LINE (5, class_descr.name);
289 
290  if (class_descr.supers != NULL)
291  {
293  for (line_ptr = class_descr.supers; *line_ptr != NULL; line_ptr++)
294  {
295  APPEND_MORE_LINE (5, *line_ptr);
296  }
297  }
298 
299  if (class_descr.subs != NULL)
300  {
302  for (line_ptr = class_descr.subs; *line_ptr != NULL; line_ptr++)
303  {
304  APPEND_MORE_LINE (5, *line_ptr);
305  }
306  }
307 
309  if (class_descr.attributes == NULL)
310  {
312  }
313  else
314  {
315  for (line_ptr = class_descr.attributes; *line_ptr != NULL; line_ptr++)
316  {
317  APPEND_MORE_LINE (5, *line_ptr);
318  }
319  }
320 
321  if (class_descr.class_attributes != NULL)
322  {
325  for (line_ptr = class_descr.class_attributes; *line_ptr != NULL; line_ptr++)
326  {
327  APPEND_MORE_LINE (5, *line_ptr);
328  }
329  }
330 
331  if (class_descr.constraints != NULL)
332  {
334  for (line_ptr = class_descr.constraints; *line_ptr != NULL; line_ptr++)
335  {
336  APPEND_MORE_LINE (5, *line_ptr);
337  }
338  }
339 
340  if (class_descr.object_id != NULL)
341  {
342  APPEND_MORE_LINE (0, "");
343  APPEND_MORE_LINE (1, class_descr.object_id);
344  }
345 
346  if (class_descr.methods != NULL)
347  {
349  for (line_ptr = class_descr.methods; *line_ptr != NULL; line_ptr++)
350  {
351  APPEND_MORE_LINE (5, *line_ptr);
352  }
353  }
354 
355  if (class_descr.class_methods != NULL)
356  {
358  for (line_ptr = class_descr.class_methods; *line_ptr != NULL; line_ptr++)
359  {
360  APPEND_MORE_LINE (5, *line_ptr);
361  }
362  }
363 
364  if (class_descr.resolutions != NULL)
365  {
367  for (line_ptr = class_descr.resolutions; *line_ptr != NULL; line_ptr++)
368  {
369  APPEND_MORE_LINE (5, *line_ptr);
370  }
371  }
372 
373  if (class_descr.method_files != NULL)
374  {
376  for (line_ptr = class_descr.method_files; *line_ptr != NULL; line_ptr++)
377  {
378  APPEND_MORE_LINE (5, *line_ptr);
379  }
380  }
381 
382  if (class_descr.query_spec != NULL)
383  {
385  for (line_ptr = class_descr.query_spec; *line_ptr != NULL; line_ptr++)
386  {
387  APPEND_MORE_LINE (5, *line_ptr);
388  }
389  }
390 
391  if (!class_descr.triggers.empty ())
392  {
394 #if 0 //bSolo: temporary until evolve above gcc 4.4.7
395 /* *INDENT-OFF* */
396  for (auto it : class_descr.triggers)
397 /* *INDENT-ON* */
398  {
399  APPEND_MORE_LINE (5, it);
400  }
401 #else
402  for (auto it = class_descr.triggers.begin (); it != class_descr.triggers.end (); ++it)
403  {
404  APPEND_MORE_LINE (5, *it);
405  }
406 #endif
407  }
408 
409  if (!class_descr.partition.empty ())
410  {
412 #if 0 //bSolo: temporary until evolve above gcc 4.4.7
413 /* *INDENT-OFF* */
414  for (auto it : class_descr.partition)
415 /* *INDENT-ON* */
416  {
417  APPEND_MORE_LINE (5, it);
418  }
419 #else
420  for (auto it = class_descr.partition.begin (); it != class_descr.partition.end (); ++it)
421  {
422  APPEND_MORE_LINE (5, *it);
423  }
424 #endif
425  }
426 
428 
430 
431  if (class_name_composed != NULL)
432  {
433  free_and_init (class_name_composed);
434  }
435  return;
436 
437 error:
438 
439  if (class_name_composed != NULL)
440  {
441  free_and_init (class_name_composed);
442  }
443 
445  {
446  csql_display_csql_err (0, 0);
447  }
448  else
449  {
451  }
453 }
454 
455 /*
456  * csql_help_trigger() - display trigger information for given trigger name
457  * return: none
458  * trigger_name(in)
459  */
460 void
461 csql_help_trigger (const char *trigger_name)
462 {
463  char **all_triggers = NULL;
464  char *trigger_name_composed = NULL;
465  LC_FETCH_VERSION_TYPE read_fetch_instance_version;
466 
467  read_fetch_instance_version = TM_TRAN_READ_FETCH_VERSION ();
469 
470  if (trigger_name == NULL || strcmp (trigger_name, "*") == 0)
471  {
472  /* all classes */
473  if (help_trigger_names (&all_triggers) != NO_ERROR)
474  {
476  goto error;
477  }
478 
479  if (all_triggers == NULL)
480  {
483  }
484  else
485  {
486  char **line_ptr; /* pointer to each line */
487 
488  for (line_ptr = all_triggers; *line_ptr != NULL; line_ptr++)
489  {
490  APPEND_MORE_LINE (5, *line_ptr);
491  }
492 
495  }
496  }
497  else
498  {
499  int trigger_name_size, composed_size;
500  /* trigger name is given */
501  /* trigger name may be in Unicode decomposed form, in DB we store only composed form */
502  trigger_name_size = (int) strlen (trigger_name);
504  && unicode_string_need_compose (trigger_name, trigger_name_size, &composed_size,
506  {
507  bool is_composed = false;
508 
509  trigger_name_composed = (char *) malloc (composed_size + 1);
510  if (trigger_name_composed == NULL)
511  {
513  goto error;
514  }
515 
516  unicode_compose_string (trigger_name, trigger_name_size, trigger_name_composed, &composed_size, &is_composed,
518  trigger_name_composed[composed_size] = '\0';
519  assert (composed_size <= trigger_name_size);
520 
521  if (is_composed)
522  {
523  trigger_name = trigger_name_composed;
524  }
525  }
526 
527  trigger_description help;
528  if (help.init (trigger_name) != NO_ERROR)
529  {
531  goto error;
532  }
533 
535  APPEND_MORE_LINE (5, help.name);
536 
537  if (help.status != NULL)
538  {
540  APPEND_MORE_LINE (5, help.status);
541  }
542 
544  APPEND_MORE_LINE (5, help.full_event);
545 
546  if (help.condition != NULL)
547  {
551 
554  APPEND_MORE_LINE (5, help.condition);
555  }
556 
557  if (help.action != NULL)
558  {
561  APPEND_MORE_LINE (5, help.action_time);
562 
564  APPEND_MORE_LINE (5, help.action);
565  }
566 
567  if (help.priority != NULL)
568  {
571  APPEND_MORE_LINE (5, help.priority);
572  }
573 
574  if (help.comment != NULL)
575  {
577  APPEND_MORE_LINE (5, help.comment);
578  }
579 
582  }
583 
584  if (all_triggers != NULL)
585  {
586  help_free_names (all_triggers);
587  }
589 
590  if (trigger_name_composed != NULL)
591  {
592  free_and_init (trigger_name_composed);
593  }
594 
595  db_set_read_fetch_instance_version (read_fetch_instance_version);
596 
597  return;
598 
599 error:
600  if (trigger_name_composed != NULL)
601  {
602  free_and_init (trigger_name_composed);
603  }
604  if (all_triggers != NULL)
605  {
606  help_free_names (all_triggers);
607  }
609  {
610  csql_display_csql_err (0, 0);
611  }
612  else
613  {
615  }
617 
618  db_set_read_fetch_instance_version (read_fetch_instance_version);
619 }
620 
621 /*
622  * csql_pipe_handler() - Generic longjmp'ing signal handler used
623  * where we need to catch broken pipe
624  * return: none
625  * sig_no(in)
626  */
627 static void
628 csql_pipe_handler (int sig_no)
629 {
630  longjmp (csql_Jmp_buf, 1);
631 }
632 
633 /*
634  * csql_help_info() - display database information for given command
635  * return: none
636  * command(in): "schema [<class name>]"
637  * "trigger [<trigger name>]"
638  * "deferred"
639  * "workspace"
640  * "lock"
641  * "stats [<class name>]"
642  * "plan"
643  * "qcache"
644  * aucommit_flag(in): auto-commit mode flag
645  */
646 void
647 csql_help_info (const char *command, int aucommit_flag)
648 {
649  char *dup = NULL, *tok, *save;
650  FILE *p_stream; /* pipe stream to pager */
651 #if !defined(WINDOWS)
652  void (*csql_intr_save) (int sig);
653  void (*csql_pipe_save) (int sig);
654 #endif /* ! WINDOWS */
655 
656  if (!command)
657  {
659  goto error;
660  }
661 
662  dup = strdup (command);
663  if (dup == NULL)
664  {
666  goto error;
667  }
668  tok = strtok_r (dup, " \t", &save);
669  if (tok != NULL
670  && (!strcasecmp (tok, "schema") || !strcasecmp (tok, "trigger") || !strcasecmp (tok, "deferred")
671  || !strcasecmp (tok, "workspace") || !strcasecmp (tok, "lock") || !strcasecmp (tok, "stats")
672  || !strcasecmp (tok, "logstat") || !strcasecmp (tok, "csstat") || !strcasecmp (tok, "plan")
673  || !strcasecmp (tok, "qcache") || !strcasecmp (tok, "trantable")))
674  {
675  int result;
676 
677 #if !defined(WINDOWS)
678  csql_intr_save = signal (SIGINT, SIG_IGN);
679  csql_pipe_save = signal (SIGPIPE, SIG_IGN);
680 #else
681  SetConsoleCtrlHandler (NULL, true); /* ignore Ctrl + c */
682 #endif /* ! WINDOWS */
683  result = NO_ERROR;
684 
686  help_print_info (command, p_stream);
687  if (aucommit_flag)
688  {
689  result = db_commit_transaction ();
690  }
691  csql_pclose (p_stream, csql_Output_fp);
692  if (aucommit_flag)
693  {
694  if (result != NO_ERROR)
695  {
696  csql_display_csql_err (0, 0);
698  }
699  else
700  {
702  }
703  }
704 #if !defined(WINDOWS)
705  signal (SIGINT, csql_intr_save);
706  signal (SIGPIPE, csql_pipe_save);
707 #else
708  SetConsoleCtrlHandler (NULL, false);
709 #endif /* ! WINDOWS */
710  }
711  else
712  {
714  goto error;
715  }
716 
717  free (dup);
718  return;
719 
720 error:
722  if (dup)
723  {
724  free (dup);
725  }
726 }
727 
728 static void
729 csql_dump_alltran (volatile TRANS_INFO * info)
730 {
731  FILE *p_stream; /* pipe stream to pager */
732 
733  if (setjmp (csql_Jmp_buf) == 0)
734  {
736 
737  fprintf (p_stream, csql_get_message (CSQL_KILLTRAN_TITLE_TEXT));
738  for (int i = 0; i < info->num_trans; i++)
739  {
740  fprintf (p_stream, csql_get_message (CSQL_KILLTRAN_FORMAT), info->tran[i].tran_index,
742  info->tran[i].host_name, info->tran[i].process_id, info->tran[i].program_name);
743  }
744 
745  csql_pclose (p_stream, csql_Output_fp);
746  }
747 }
748 
749 /*
750  * csql_killtran() - kill a transaction
751  * return: none
752  * argument: tran index or NULL (dump transaction list)
753  */
754 void
755 csql_killtran (const char *argument)
756 {
757  TRANS_INFO *info = NULL;
758  int tran_index = -1, i;
759 #if !defined(WINDOWS)
760  void (*csql_pipe_save) (int sig);
761 #endif /* ! WINDOWS */
762 
763  if (argument)
764  {
765  tran_index = atoi (argument);
766  }
767 
768  info = logtb_get_trans_info (false);
769  if (info == NULL)
770  {
772  goto error;
773  }
774 
775  /* dump transaction */
776  if (tran_index <= 0)
777  {
778 #if !defined(WINDOWS)
779  csql_pipe_save = signal (SIGPIPE, &csql_pipe_handler);
780 #endif /* ! WINDOWS */
781  csql_dump_alltran (info);
782 #if !defined(WINDOWS)
783  signal (SIGPIPE, csql_pipe_save);
784 #endif /* ! WINDOWS */
785  }
786  /* kill transaction */
787  else
788  {
789  for (i = 0; i < info->num_trans; i++)
790  {
791  if (info->tran[i].tran_index == tran_index)
792  {
796  info->tran[i].host_name, info->tran[i].process_id, info->tran[i].program_name);
797 
798  if (thread_kill_tran_index (info->tran[i].tran_index, info->tran[i].db_user, info->tran[i].host_name,
799  info->tran[i].process_id) == NO_ERROR)
800  {
802  }
803  else
804  {
806  }
807  break;
808  }
809  }
810  }
811 
812  if (info != NULL)
813  {
814  logtb_free_trans_info (info);
815  }
816 
817  return;
818 
819 error:
821  if (info != NULL)
822  {
823  logtb_free_trans_info (info);
824  }
825 }
const char * csql_get_message(int message_index)
Definition: csql.c:2954
LC_FETCH_VERSION_TYPE
Definition: locator.h:178
int help_trigger_names(char ***names_ptr)
Definition: object_print.c:78
int csql_get_session_cmd_no(const char *input)
Definition: csql_session.c:141
#define APPEND_MORE_LINE(indent, line)
Definition: csql_session.c:46
#define NO_ERROR
Definition: error_code.h:46
bool unicode_string_need_compose(const char *str_in, const int size_in, int *size_out, const UNICODE_NORMALIZATION *norm)
std::vector< char * > partition
int init(const char *name)
#define MSGCAT_CATALOG_CSQL
int db_Connect_status
Definition: db_macro.c:88
const char * tran_get_tranlist_state_name(TRAN_STATE state)
unsigned int flags
Definition: csql_session.c:72
int thread_kill_tran_index(int kill_tran_index, char *kill_user, char *kill_host, int kill_pid)
Definition: csql.h:184
TRANS_INFO * logtb_get_trans_info(bool include_query_exec_info)
void csql_help_schema(const char *class_name)
Definition: csql_session.c:221
void csql_display_msg(const char *string)
Definition: csql.c:376
void unicode_compose_string(const char *str_in, const int size_in, char *str_out, int *size_out, bool *is_composed, const UNICODE_NORMALIZATION *norm)
#define ER_OBJ_NO_CONNECT
Definition: error_code.h:295
int csql_append_more_line(int indent, const char *line)
Definition: csql_support.c:550
#define SCRATCH_TEXT_LEN
Definition: csql.h:152
int init(const char *name)
#define DB_CONNECTION_STATUS_CONNECTED
Definition: db.h:47
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define assert(x)
void csql_check_server_down(void)
Definition: csql_support.c:753
#define CMD_EMPTY_FLAG
Definition: csql_session.c:64
static int input()
Definition: cnvlex.c:1661
static jmp_buf csql_Jmp_buf
Definition: csql_session.c:58
const char * text
Definition: csql_session.c:70
void help_print_info(const char *command, FILE *fpp)
Definition: object_print.c:595
SESSION_CMD
Definition: csql.h:176
void csql_help_trigger(const char *trigger_name)
Definition: csql_session.c:461
#define DB_MAX_IDENTIFIER_LENGTH
Definition: dbtype_def.h:495
void csql_help_info(const char *command, int aucommit_flag)
Definition: csql_session.c:647
void db_set_read_fetch_instance_version(LC_FETCH_VERSION_TYPE read_Fetch_Instance_Version)
Definition: db_vdb.c:3904
void csql_display_csql_err(int line_no, int col_no)
Definition: csql_support.c:490
UNICODE_NORMALIZATION * lang_get_generic_unicode_norm(void)
#define NULL
Definition: freelistheap.h:34
ONE_TRAN_INFO tran[1]
static void csql_dump_alltran(volatile TRANS_INFO *info)
Definition: csql_session.c:729
void help_free_names(char **names)
Definition: object_print.c:431
void logtb_free_trans_info(TRANS_INFO *info)
#define MSGCAT_CSQL_SET_CSQL
Definition: csql.h:49
#define TM_TRAN_READ_FETCH_VERSION()
char csql_Scratch_text[SCRATCH_TEXT_LEN]
Definition: csql.c:146
FILE * csql_popen(const char *cmd, FILE *fd)
Definition: csql_support.c:396
void csql_pclose(FILE *pf, FILE *fd)
Definition: csql_support.c:444
void csql_free_more_lines(void)
Definition: csql_support.c:714
static void csql_pipe_handler(int sig_no)
Definition: csql_session.c:628
void csql_display_more_lines(const char *title)
Definition: csql_support.c:675
static void(* csql_pipe_save)(int sig)
Definition: csql_result.c:710
static void error(const char *msg)
Definition: gencat.c:331
char csql_Pager_cmd[PATH_MAX]
Definition: csql.c:125
#define ARG_FILE_LINE
Definition: error_manager.h:44
SESSION_CMD cmd_no
Definition: csql_session.c:71
#define free_and_init(ptr)
Definition: memory_alloc.h:147
#define strlen(s1)
Definition: intl_support.c:43
void csql_killtran(const char *argument)
Definition: csql_session.c:755
#define CMD_CHECK_CONNECT
Definition: csql_session.c:65
void nonscr_display_error(char *buffer, int buf_length)
Definition: csql_support.c:830
int i
Definition: dynamic_load.c:954
FILE * csql_Output_fp
Definition: csql.c:157
char * msgcat_message(int cat_id, int set_id, int msg_id)
int intl_identifier_fix(char *name, int ident_max_size, bool error_on_case_overflow)
char * strdup(const char *str)
Definition: porting.c:901
void csql_help_menu(void)
Definition: csql_session.c:197
#define APPEND_HEAD_LINE(head_text)
Definition: csql_session.c:51
int csql_Error_code
Definition: csql.c:148
#define LANG_SYS_CODESET
std::vector< char * > triggers
static SESSION_CMD_TABLE csql_Session_cmd_table[]
Definition: csql_session.c:75
int db_commit_transaction(void)
Definition: db_admin.c:1091