30 #include <sys/types.h> 73 #if defined (SUPPRESS_STRLEN_WARNING) 74 #define strlen(s1) ((int) strlen(s1)) 77 #define MAX_LINE_LEN 4096 79 #define COMMENT_CHAR '-' 80 #define COMMAND_USER "user" 81 #define COMMAND_GROUP "group" 82 #define COMMAND_MEMBERS "members" 83 #define COMMAND_GROUPS "groups" 87 #define strtok_r strtok_s 90 #define BO_DB_FULLNAME (bo_Dbfullname) 124 const char *exec_name;
126 exec_name =
basename ((
char *) argv0);
141 const char *exec_name;
143 exec_name =
basename ((
char *) argv0);
157 const char *delim =
" \t\n";
158 char *save_ptr, *token;
161 MOP database_object, user;
164 token = strtok_r (line_buffer, delim, &save_ptr);
168 token = strtok_r (
NULL, delim, &save_ptr);
171 fprintf (output_file,
176 token = strtok_r (
NULL, delim, &save_ptr);
193 fprintf (output_file,
199 while ((token = strtok_r (
NULL, delim, &save_ptr)) !=
NULL)
202 if (database_object ==
NULL)
205 fprintf (output_file,
227 fprintf (output_file,
262 fprintf (stderr,
"parse error at line: %d\n", line_number);
288 if ((*v & (*v - 1)) != 0)
290 while (pow_size < *v)
306 char er_msg_file[PATH_MAX];
309 FILE *user_define_file =
NULL;
311 const char *output_file_name;
314 const char *volume_path;
315 const char *log_path;
316 const char *lob_path;
317 const char *host_name;
321 const char *init_file_name;
322 const char *volume_spec_file_name;
323 const char *user_define_file_name;
324 const char *cubrid_charset;
329 UINT64 db_volume_size;
330 int log_volume_pages;
332 UINT64 log_volume_size;
335 char *log_volume_str;
339 char required_size[16];
344 if (database_name == 0 || database_name[0] == 0 || cubrid_charset == 0 || cubrid_charset[0] == 0
347 goto print_create_usage;
376 if (db_page_size != -1)
386 if (db_page_str !=
NULL)
397 db_page_size = (int) v;
402 if (db_volume_str ==
NULL)
418 if (db_volume_pages != -1)
425 db_volume_pages = (int) ceil ((
double) db_volume_size /
db_page_size);
432 db_volume_size = (UINT64) db_volume_pages *(UINT64)
db_page_size;
435 if (log_page_str ==
NULL)
450 log_page_size = (int) v;
455 if (log_volume_str ==
NULL)
471 if (log_volume_pages != -1)
477 log_volume_pages = (int) (log_volume_size / log_page_size);
485 if (output_file_name == 0 || output_file_name[0] == 0)
487 output_file = stdout;
491 output_file = fopen (output_file_name,
"w");
494 if (output_file ==
NULL)
504 char min_buf[64], max_buf[64], vol_buf[64];
512 if (db_volume_str !=
NULL)
515 len =
strlen (db_volume_str);
518 snprintf (vol_buf, 64,
"%sB", db_volume_str);
522 snprintf (vol_buf, 64,
"%s", db_volume_str);
538 char min_buf[64], max_buf[64], vol_buf[64];
546 if (log_volume_str !=
NULL)
549 len =
strlen (log_volume_str);
552 snprintf (vol_buf, 64,
"%sB", log_volume_str);
556 snprintf (vol_buf, 64,
"%s", log_volume_str);
570 if (user_define_file_name != 0)
572 user_define_file = fopen (user_define_file_name,
"r");
573 if (user_define_file ==
NULL)
577 user_define_file_name);
586 er_msg_file, cubrid_charset, required_size);
589 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", database_name, arg->
command_name);
601 status =
db_init (program_name,
true, database_name, volume_path,
NULL, log_path, lob_path, host_name, overwrite,
602 comment, volume_spec_file_name, db_volume_pages, db_page_size, log_volume_pages, log_page_size,
654 if (user_define_file !=
NULL)
660 user_define_file_name);
664 fclose (user_define_file);
669 if (output_file != stdout)
671 fclose (output_file);
674 if (init_file_name !=
NULL)
692 if (output_file != stdout && output_file !=
NULL)
694 fclose (output_file);
696 if (user_define_file !=
NULL)
698 fclose (user_define_file);
711 char er_msg_file[PATH_MAX];
713 const char *output_file_name;
718 if (database_name ==
NULL)
720 goto print_delete_usage;
728 goto print_delete_usage;
732 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", database_name, arg->
command_name);
740 if (output_file_name ==
NULL)
742 output_file = stdout;
746 output_file = fopen (output_file_name,
"w");
749 if (output_file ==
NULL)
772 if (output_file != stdout)
774 fclose (output_file);
785 if (output_file != stdout && output_file !=
NULL)
787 fclose (output_file);
797 char *save_ptr, *token;
798 const char *delim =
"-:";
802 token = strtok_r (date_string, delim, &save_ptr);
808 time_data->tm_mday = atoi (token);
809 if (time_data->tm_mday < 1 || time_data->tm_mday > 31)
815 time_data->tm_mon = atoi (token) - 1;
816 if (time_data->tm_mon < 0 || time_data->tm_mon > 11)
822 time_data->tm_year = atoi (token) - 1900;
823 if (time_data->tm_year < 0)
829 time_data->tm_hour = atoi (token);
830 if (time_data->tm_hour < 0 || time_data->tm_hour > 23)
836 time_data->tm_min = atoi (token);
837 if (time_data->tm_min < 0 || time_data->tm_min > 59)
843 time_data->tm_sec = atoi (token);
844 if (time_data->tm_sec < 0 || time_data->tm_sec > 59)
854 token = strtok_r (
NULL, delim, &save_ptr);
863 char from_volbackup[PATH_MAX];
911 char er_msg_file[PATH_MAX];
912 int status, error_code;
916 bool partial_recovery;
946 goto print_restore_usage;
949 if (up_to_date !=
NULL &&
strlen (up_to_date) > 0)
951 if (strcasecmp (up_to_date,
"backuptime") == 0)
958 restart_arg.
stopat = mktime (&time_data);
973 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", database_name, arg->
command_name);
994 if (partial_recovery ==
true)
998 status = boot_restart_from_backup (
true, database_name, &restart_arg);
1010 return EXIT_SUCCESS;
1012 print_restore_usage:
1018 return EXIT_FAILURE;
1029 char er_msg_file[PATH_MAX];
1030 const char *src_db_name;
1031 const char *dest_db_name;
1032 const char *ext_path;
1033 const char *control_file_name;
1038 if (src_db_name ==
NULL || dest_db_name ==
NULL)
1040 goto print_rename_usage;
1049 goto print_rename_usage;
1056 else if (ext_path && access (ext_path, F_OK) == -1)
1062 else if (control_file_name && access (control_file_name, F_OK) == -1)
1070 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", src_db_name, arg->
command_name);
1101 return EXIT_SUCCESS;
1109 return EXIT_FAILURE;
1120 char er_msg_file[PATH_MAX];
1121 char lob_path_buf[PATH_MAX];
1122 const char *server_name;
1123 const char *db_path;
1124 const char *log_path;
1127 bool cfg_added =
false;
1130 if (db_name ==
NULL)
1132 goto print_install_usage;
1141 goto print_install_usage;
1150 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", db_name, arg->
command_name);
1169 db =
cfg_add_db (&dir, db_name, db_path, log_path,
NULL, server_name);
1175 if (db->lobpath ==
NULL)
1180 lob_path_buf[PATH_MAX - 1] =
'\0';
1181 db->lobpath =
strdup (lob_path_buf);
1210 return EXIT_SUCCESS;
1212 print_install_usage:
1228 return EXIT_FAILURE;
1239 char er_msg_file[PATH_MAX];
1240 const char *src_db_name;
1241 const char *dest_db_name;
1242 const char *server_name;
1243 const char *db_path;
1244 const char *log_path;
1245 const char *lob_path;
1246 char lob_pathbuf[PATH_MAX];
1247 const char *ext_path;
1248 const char *control_file_name;
1249 bool overwrite, delete_src, copy_lob_path;
1253 if (src_db_name ==
NULL || dest_db_name ==
NULL)
1255 goto print_copy_usage;
1270 goto print_copy_usage;
1273 if (lob_path !=
NULL && copy_lob_path ==
true)
1275 goto print_copy_usage;
1277 if (delete_src ==
true && lob_path ==
NULL)
1279 copy_lob_path =
true;
1283 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", src_db_name, arg->
command_name);
1291 if (strcmp (src_db_name, dest_db_name) == 0)
1316 lob_path = strcpy (lob_pathbuf, s);
1319 if (
boot_copy (src_db_name, dest_db_name, db_path, log_path, lob_path, server_name, ext_path, control_file_name,
1331 return EXIT_SUCCESS;
1341 return EXIT_FAILURE;
1352 char er_msg_file[PATH_MAX];
1354 const char *class_name;
1359 if (db_name ==
NULL)
1361 goto print_optimize_usage;
1368 goto print_optimize_usage;
1379 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", db_name, arg->
command_name);
1393 if (class_name !=
NULL && class_name[0] != 0)
1415 return EXIT_SUCCESS;
1417 print_optimize_usage:
1423 return EXIT_FAILURE;
1449 char er_msg_file[PATH_MAX];
1453 bool is_emergency =
false;
1458 if (db_name ==
NULL)
1460 goto print_diag_usage;
1471 if (output_file ==
NULL)
1477 outfp = fopen (output_file,
"w");
1490 goto print_diag_usage;
1499 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", db_name, arg->
command_name);
1515 goto print_diag_usage;
1523 fprintf (outfp,
"\n*** DUMP OF FILE STATISTICS ***\n");
1530 fprintf (outfp,
"\n*** DUMP OF FILE DESCRIPTIONS ***\n");
1537 fprintf (outfp,
"\n*** DUMP CAPACITY OF ALL HEAPS ***\n");
1544 fprintf (outfp,
"\n*** DUMP CAPACITY OF ALL INDICES ***\n");
1551 fprintf (outfp,
"\n*** DUMP CLASSNAMES ***\n");
1558 fprintf (outfp,
"\n*** DUMP OF DISK STATISTICS ***\n");
1565 fprintf (outfp,
"\n*** DUMP OF CATALOG ***\n");
1572 int isforward, dump_npages, desired_tranid;
1582 printf (
"isforward (1 or 0) ? ");
1583 scanf (
"%d", &isforward);
1584 printf (
"start_logpageid (-1 for the first/last page) ? ");
1586 start_logpageid = s;
1587 printf (
"dump_npages (-1 for all pages) ? ");
1588 scanf (
"%d", &dump_npages);
1589 printf (
"desired_tranid (-1 for all transactions) ? ");
1590 scanf (
"%d", &desired_tranid);
1591 printf (
"log_dump(%d, %lld, %d, %d) (y/n) ? ", isforward, (
long long int) start_logpageid, dump_npages,
1595 while (yn[0] !=
'y');
1600 start_logpageid = isforward = dump_npages = desired_tranid = 0;
1605 isforward = atoi (cp);
1611 start_logpageid = atoll (cp);
1617 dump_npages = atoi (cp);
1623 desired_tranid = atoi (cp);
1628 goto print_diag_usage;
1630 fprintf (outfp,
"\n*** DUMP OF LOG ***\n");
1631 xlog_dump (thread_p, outfp, isforward, start_logpageid, dump_npages, desired_tranid);
1639 fprintf (outfp,
"\n*** DUMP OF ALL HEAPS ***\n");
1646 if (output_file !=
NULL && outfp !=
NULL && outfp != stdout)
1651 return EXIT_SUCCESS;
1659 if (output_file !=
NULL && outfp !=
NULL && outfp != stdout)
1664 return EXIT_FAILURE;
1674 char er_msg_file[PATH_MAX];
1677 const char *db_locale =
NULL;
1681 if (db_name ==
NULL)
1683 goto print_patch_usage;
1688 if (recreate_log ==
true)
1691 if (db_locale ==
NULL)
1693 goto print_patch_usage;
1699 goto print_patch_usage;
1708 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", db_name, arg->
command_name);
1718 return EXIT_SUCCESS;
1724 return EXIT_FAILURE;
1727 #if defined(ENABLE_UNUSED_FUNCTION ) 1739 #if defined(ENABLE_UNUSED_FUNCTION ) 1752 const char *key_type;
1757 int blt_wrs_npages = 0;
1763 goto print_estimate_index_usage;
1773 if (num_instance <= num_diffkeys)
1775 num_instance = num_diffkeys;
1783 if (key_type !=
NULL)
1788 type = domain->
type;
1826 btree_estimate_total_numpages (
NULL, num_diffkeys, avg_key_size, num_instance, &blt_npages,
1884 print_estimate_index_usage:
1887 return EXIT_FAILURE;
1900 const char *host_name;
1903 char dbtxt_label[PATH_MAX];
1907 const char *log_prefix;
1912 goto print_alterdbhost_usage;
1916 if (db_name ==
NULL)
1918 goto print_alterdbhost_usage;
1928 if (host_name ==
NULL)
1937 strcpy (host_name_buf,
"localhost");
1939 host_name = host_name_buf;
1946 #
if !defined(WINDOWS) || !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS)
2004 #if defined(WINDOWS) && !defined(DONT_USE_MANDATORY_LOCK_IN_WINDOWS) 2027 return EXIT_SUCCESS;
2043 return EXIT_FAILURE;
2045 print_alterdbhost_usage:
2051 return EXIT_FAILURE;
2061 char *locale_str =
NULL;
2062 char *input_path =
NULL;
2063 bool is_scan_locales =
false;
2064 bool is_verbose =
false;
2067 int count_loc = 0,
i;
2068 int start_lf_pos = -1;
2069 int end_lf_pos = -1;
2070 char er_msg_file[PATH_MAX];
2075 int err_status = EXIT_SUCCESS;
2083 goto print_genlocale_usage;
2089 is_scan_locales =
true;
2092 else if (str_count == 1)
2095 if (locale_str ==
NULL)
2097 goto print_genlocale_usage;
2102 goto print_genlocale_usage;
2108 if (input_path !=
NULL && is_scan_locales)
2110 goto print_genlocale_usage;
2117 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s.err", arg->
command_name);
2122 err_status = EXIT_FAILURE;
2126 if (is_scan_locales)
2130 printf (
"\n\nFound %d locale files\n\n", count_loc);
2133 end_lf_pos = count_loc;
2139 for (
i = 0;
i < count_loc;
i++)
2141 if (strcmp (locale_str, lf[
i].locale_name) == 0)
2150 if (curr_lf ==
NULL)
2155 err_status = EXIT_FAILURE;
2159 if (input_path !=
NULL)
2170 err_status = EXIT_FAILURE;
2180 err_status = EXIT_FAILURE;
2183 memset (ld, 0, count_loc *
sizeof (
LOCALE_DATA *));
2186 for (
i = start_lf_pos;
i < end_lf_pos;
i++)
2192 err_status = EXIT_FAILURE;
2198 for (
i = start_lf_pos;
i < end_lf_pos;
i++)
2202 err_status = EXIT_FAILURE;
2208 printf (
"*********************************\n");
2209 printf (
"Compile locale:\n");
2210 printf (
"Locale string: %s\n", lf[i].locale_name);
2211 printf (
"Input LDML: %s\n", lf[i].ldml_file);
2212 printf (
"Output Library: %s\n", lf[i].lib_file);
2217 err_status = EXIT_FAILURE;
2221 if (!is_scan_locales)
2231 err_status = EXIT_FAILURE;
2238 for (
i = 0;
i < count_loc;
i++)
2240 if (lf[
i].locale_name !=
NULL)
2244 if (lf[
i].ldml_file !=
NULL)
2248 if (lf[
i].lib_file !=
NULL)
2276 print_genlocale_usage:
2281 return EXIT_FAILURE;
2291 char *locale_str =
NULL;
2292 char *input_path =
NULL;
2293 char *alphabet_type =
NULL;
2295 void *loclib_handle =
NULL;
2298 int dl_settings = 0;
2299 int str_count,
i, count_loc, loc_index;
2300 int start_value = 0;
2311 goto print_dumplocale_usage;
2331 if (alphabet_type !=
NULL)
2355 alphabet_type =
NULL;
2358 if (alphabet_type !=
NULL)
2405 if (locale_str !=
NULL && input_path !=
NULL)
2411 goto print_dumplocale_usage;
2413 if (start_value > end_value)
2419 goto print_dumplocale_usage;
2427 if (locale_str !=
NULL)
2461 if (input_path !=
NULL)
2464 for (i = 0; i < count_loc; i++)
2466 if (lf[i].lib_file !=
NULL)
2472 if (lf[i].lib_file ==
NULL)
2482 for (loc_index = 0; loc_index < count_loc; loc_index++)
2504 err_status =
locale_dump (&lld, &(lf[loc_index]), dl_settings, start_value, end_value);
2528 #if defined(WINDOWS) 2529 FreeLibrary ((HMODULE) loclib_handle);
2531 dlclose (loclib_handle);
2536 for (i = 0; i < count_loc; i++)
2538 if (lf[i].lib_file !=
NULL)
2540 free (lf[i].lib_file);
2542 if (lf[i].ldml_file !=
NULL)
2544 free (lf[i].ldml_file);
2546 if (lf[i].locale_name !=
NULL)
2548 free (lf[i].locale_name);
2570 print_dumplocale_usage:
2574 return EXIT_FAILURE;
2585 char er_msg_file[PATH_MAX];
2587 int status = EXIT_SUCCESS;
2588 bool is_check, is_force, is_sync =
true;
2589 int db_obs_coll_cnt = 0;
2590 int new_sys_coll_cnt = 0;
2593 if (db_name ==
NULL)
2595 goto print_sync_collations_usage;
2600 goto print_sync_collations_usage;
2606 if (is_check && is_force)
2608 goto print_sync_collations_usage;
2611 if (is_check || is_force)
2622 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", db_name, arg->
command_name);
2636 if (is_check || is_sync)
2638 status =
synccoll_check (db_name, &db_obs_coll_cnt, &new_sys_coll_cnt);
2639 if (status != EXIT_SUCCESS)
2645 if (!is_sync && (db_obs_coll_cnt != 0 || new_sys_coll_cnt != 0))
2648 status = EXIT_FAILURE;
2653 if (is_sync || is_force)
2657 if (!is_force && db_obs_coll_cnt == 0 && new_sys_coll_cnt == 0)
2677 if (status != EXIT_SUCCESS)
2698 print_sync_collations_usage:
2704 return EXIT_FAILURE;
2714 #define FILE_STMT_NAME "cubrid_synccolldb_" 2715 #define QUERY_SIZE 1024 2721 FILE *f_stmt =
NULL;
2722 char f_stmt_name[PATH_MAX];
2724 int sys_coll_found_cnt = 0;
2726 int status = EXIT_SUCCESS;
2728 char *vclass_names =
NULL;
2729 int vclass_names_used = 0;
2730 int vclass_names_alloced = 0;
2731 char *part_tables =
NULL;
2732 int part_tables_used = 0;
2733 int part_tables_alloced = 0;
2734 bool need_manual_sync =
false;
2741 *db_obs_coll_cnt = 0;
2742 *new_sys_coll_cnt = 0;
2750 if (db_collations !=
NULL)
2754 status = EXIT_FAILURE;
2761 strcat (f_stmt_name, db_name);
2762 strcat (f_stmt_name,
".sql");
2764 f_stmt = fopen (f_stmt_name,
"wt");
2773 for (i = 0; i < db_coll_cnt; i++)
2778 bool is_obs_coll =
false;
2779 bool check_atts =
false;
2780 bool check_views =
false;
2781 bool check_triggers =
false;
2782 bool check_func_index =
false;
2783 bool check_tables =
false;
2785 db_coll = &(db_collations[
i]);
2794 sys_coll_found[j] = 1;
2795 sys_coll_found_cnt++;
2807 check_tables =
true;
2810 check_triggers =
true;
2811 check_func_index =
true;
2816 check_tables =
true;
2818 check_triggers =
true;
2820 check_func_index =
true;
2825 (*db_obs_coll_cnt)++;
2826 fprintf (stdout,
"----------------------------------------\n");
2827 fprintf (stdout,
"----------------------------------------\n");
2836 "SELECT C.class_name, C.class_type " "FROM _db_class C " "WHERE C.collation_id = %d " 2837 "AND NOT (C.class_name IN " "(SELECT P.class_of.class_name " "FROM _db_partition P WHERE " 2838 "P.class_of.class_name " " = C.class_name AND P.pname IS NOT NULL))", db_coll->
coll_id);
2844 status = EXIT_FAILURE;
2847 else if (db_status > 0)
2852 fprintf (stdout,
"----------------------------------------\n");
2862 status = EXIT_FAILURE;
2876 snprintf (query,
sizeof (query) - 1,
"ALTER TABLE [%s] " "COLLATE utf8_bin;",
2878 fprintf (f_stmt,
"%s\n", query);
2879 need_manual_sync =
true;
2883 if (query_result !=
NULL)
2886 query_result =
NULL;
2896 "SELECT A.class_of.class_name, I.index_name " "from _db_attribute A, _db_index I, " 2897 "_db_index_key IK, _db_domain D " "where D.object_of = A AND D.collation_id = %d AND " 2898 "NOT (A.class_of.class_name IN (SELECT " "P.class_of.class_name " "FROM _db_partition P WHERE " 2899 "P.class_of.class_name = " "A.class_of.class_name AND P.pname IS NOT NULL))" 2900 "AND A.attr_name = IK.key_attr_name AND IK in I.key_attrs " 2901 "AND I.is_foreign_key = 1 AND I.class_of = A.class_of", db_coll->
coll_id);
2907 status = EXIT_FAILURE;
2910 else if (db_status > 0)
2915 fprintf (stdout,
"----------------------------------------\n");
2925 status = EXIT_FAILURE;
2931 snprintf (query,
sizeof (query) - 1,
"ALTER TABLE [%s] DROP FOREIGN KEY [%s];",
2933 fprintf (f_stmt,
"%s\n", query);
2934 need_manual_sync =
true;
2938 if (query_result !=
NULL)
2941 query_result =
NULL;
2951 "SELECT A.class_of.class_name, " "A.class_of.class_type, A.attr_name, " "IF (D.data_type = 35," 2952 "CONCAT ('ENUM (', " "(SELECT GROUP_CONCAT(concat('''',EV.a,'''')) " 2953 "FROM TABLE(D.enumeration) as EV(a)) , ')'), " "CONCAT (CASE D.data_type WHEN 4 THEN 'VARCHAR' " 2954 "WHEN 25 THEN 'CHAR' WHEN 27 THEN 'NCHAR VARYING' " "WHEN 26 THEN 'NCHAR' WHEN 35 THEN 'ENUM' END, " 2955 "IF (D.prec < 0 AND " "(D.data_type = 4 OR D.data_type = 27) ," "'', CONCAT ('(', D.prec,')')))), " 2956 "CASE WHEN A.class_of.sub_classes IS NULL THEN 0 " "ELSE NVL((SELECT 1 FROM _db_partition p " 2957 "WHERE p.class_of = A.class_of AND p.pname IS NULL AND " 2958 "LOCATE(A.attr_name, TRIM(SUBSTRING(p.pexpr FROM 8 FOR " 2959 "(POSITION(' FROM ' IN p.pexpr)-8)))) > 0 ), 0) " "END " "FROM _db_domain D,_db_attribute A " 2960 "WHERE D.object_of = A AND D.collation_id = %d " "AND NOT (A.class_of.class_name IN " 2961 "(SELECT P.class_of.class_name " "FROM _db_partition P WHERE " "P.class_of.class_name " 2962 " = A.class_of.class_name AND P.pname IS NOT NULL)) " "ORDER BY A.class_of.class_name",
2969 status = EXIT_FAILURE;
2972 else if (db_status > 0)
2980 fprintf (stdout,
"----------------------------------------\n");
2987 bool add_to_part_tables =
false;
2995 status = EXIT_FAILURE;
3015 fprintf (f_stmt,
"ALTER TABLE [%s] REMOVE PARTITIONING;\n",
db_get_string (&class_name));
3016 add_to_part_tables =
true;
3019 snprintf (query,
sizeof (query) - 1,
"ALTER TABLE [%s] " "MODIFY [%s] %s COLLATE utf8_bin;",
3024 snprintf (query,
sizeof (query) - 1,
"DROP VIEW [%s];",
db_get_string (&class_name));
3026 if (vclass_names ==
NULL || vclass_names_alloced <= vclass_names_used)
3028 if (vclass_names_alloced == 0)
3032 vclass_names = (
char *)
db_private_realloc (thread_p, vclass_names, 2 * vclass_names_alloced);
3034 if (vclass_names ==
NULL)
3036 status = EXIT_FAILURE;
3039 vclass_names_alloced *= 2;
3042 memcpy (vclass_names + vclass_names_used,
db_get_string (&class_name),
3045 memcpy (vclass_names + vclass_names_used,
"\0", 1);
3046 vclass_names_used += 1;
3048 fprintf (f_stmt,
"%s\n", query);
3049 need_manual_sync =
true;
3051 if (add_to_part_tables)
3053 if (part_tables ==
NULL || part_tables_alloced <= part_tables_used)
3055 if (part_tables_alloced == 0)
3059 part_tables = (
char *)
db_private_realloc (thread_p, part_tables, 2 * part_tables_alloced);
3061 if (part_tables ==
NULL)
3063 status = EXIT_FAILURE;
3066 part_tables_alloced *= 2;
3069 memcpy (part_tables + part_tables_used,
db_get_string (&class_name),
3072 memcpy (part_tables + part_tables_used,
"\0", 1);
3073 part_tables_used += 1;
3076 if (part_tables !=
NULL)
3078 char *curr_tbl = part_tables;
3079 int tbl_size =
strlen (curr_tbl);
3081 fprintf (stdout,
"----------------------------------------\n");
3086 while (tbl_size > 0)
3088 printf (
"%s\n", curr_tbl);
3089 curr_tbl += tbl_size + 1;
3090 if (curr_tbl >= part_tables + part_tables_used)
3094 tbl_size =
strlen (curr_tbl);
3099 if (query_result !=
NULL)
3102 query_result =
NULL;
3109 "SELECT class_of.class_name, spec " "FROM _db_query_spec " "WHERE LOCATE ('collate %s', spec) > 0",
3116 status = EXIT_FAILURE;
3119 else if (db_status > 0)
3124 fprintf (stdout,
"----------------------------------------\n");
3131 bool already_dropped =
false;
3136 status = EXIT_FAILURE;
3146 if (vclass_names !=
NULL)
3148 char *
search = vclass_names;
3152 while (search + view_name_size < vclass_names + vclass_names_used)
3154 if (memcmp (search,
db_get_string (&view), view_name_size) == 0
3155 && *(search + view_name_size) ==
'\0')
3157 already_dropped =
true;
3161 while (*search++ !=
'\0')
3168 if (!already_dropped)
3170 snprintf (query,
sizeof (query) - 1,
"DROP VIEW [%s];",
db_get_string (&view));
3171 fprintf (f_stmt,
"%s\n", query);
3173 need_manual_sync =
true;
3177 if (query_result !=
NULL)
3180 query_result =
NULL;
3186 sprintf (query,
"SELECT name, condition FROM db_trigger " "WHERE LOCATE ('collate %s', condition) > 0",
3193 status = EXIT_FAILURE;
3196 else if (db_status > 0)
3201 fprintf (stdout,
"----------------------------------------\n");
3212 status = EXIT_FAILURE;
3222 snprintf (query,
sizeof (query) - 1,
"DROP TRIGGER [%s];",
db_get_string (&trig_name));
3223 fprintf (f_stmt,
"%s\n", query);
3224 need_manual_sync =
true;
3228 if (query_result !=
NULL)
3231 query_result =
NULL;
3235 if (check_func_index)
3240 "SELECT index_of.index_name, func, " "index_of.class_of.class_name FROM " 3241 "_db_index_key WHERE LOCATE ('%s', func) > 0 " "AND NOT (index_of.class_of.class_name IN " 3242 "(SELECT P.class_of.class_name " "FROM _db_partition P WHERE " "P.class_of.class_name " 3243 " = index_of.class_of.class_name " "AND P.pname IS NOT NULL)) ", db_coll->
coll_name);
3249 status = EXIT_FAILURE;
3252 else if (db_status > 0)
3258 fprintf (stdout,
"----------------------------------------\n");
3270 status = EXIT_FAILURE;
3282 snprintf (query,
sizeof (query) - 1,
"ALTER TABLE [%s] " "DROP INDEX [%s];",
3284 fprintf (f_stmt,
"%s\n", query);
3285 need_manual_sync =
true;
3289 if (query_result !=
NULL)
3292 query_result =
NULL;
3297 fprintf (stdout,
"----------------------------------------\n");
3298 fprintf (stdout,
"----------------------------------------\n");
3299 if (*db_obs_coll_cnt == 0)
3310 if (need_manual_sync)
3318 if (!need_manual_sync)
3325 remove (f_stmt_name);
3336 if (sys_coll_found[i] == 1)
3348 assert (sys_coll_found[i] == 0);
3351 (*new_sys_coll_cnt)++;
3353 fprintf (stdout,
"\n");
3356 if (*db_obs_coll_cnt == 0 && *new_sys_coll_cnt == 0)
3368 fprintf (stdout,
"----------------------------------------\n");
3369 fprintf (stdout,
"----------------------------------------\n");
3372 if (vclass_names !=
NULL)
3375 vclass_names =
NULL;
3378 if (part_tables !=
NULL)
3390 if (query_result !=
NULL)
3393 query_result =
NULL;
3395 if (db_collations !=
NULL)
3402 #undef FILE_STMT_NAME 3414 int status = EXIT_SUCCESS;
3418 if (class_mop ==
NULL)
3420 status = EXIT_FAILURE;
3428 status = EXIT_FAILURE;
3434 status = EXIT_FAILURE;
3448 #define QUERY_BUF_SIZE 2048 3459 res =
db_execute (query_buf, &result, &query_error);
3474 #undef QUERY_BUF_SIZE 3484 #define APPLY_INFO_VALUES 15 3485 #define QUERY_BUF_SIZE 2048 3487 int i, res, au_save;
3489 char *copy_log_base;
3490 char copy_log_base_buf[PATH_MAX];
3491 char log_path[PATH_MAX];
3500 if (copy_log_base ==
NULL || *copy_log_base ==
'\0')
3502 copy_log_base = (
char *)
envvar_get (
"DATABASES");
3503 if (copy_log_base ==
NULL)
3509 copy_log_base = realpath (copy_log_base, copy_log_base_buf);
3510 snprintf (log_path, PATH_MAX,
"%s/%s_%s", copy_log_base, database_name, master_host_name);
3512 snprintf (query_buf,
sizeof (query_buf),
"INSERT INTO %s " 3514 " db_creation_time, " 3515 " copied_log_path, " 3516 " committed_lsa_pageid, " 3517 " committed_lsa_offset, " 3518 " committed_rep_pageid, " 3519 " committed_rep_offset, " 3520 " append_lsa_pageid, " 3521 " append_lsa_offset, " 3524 " final_lsa_pageid, " 3525 " final_lsa_offset, " 3526 " required_lsa_pageid, " 3527 " required_lsa_offset, " 3528 " log_record_time, " 3529 " log_commit_time, " 3530 " last_access_time, " 3580 for (i = 0; i < 6; i++)
3604 for (i = 0; i < in_value_idx; i++)
3611 #undef APPLY_INFO_VALUES 3612 #undef QUERY_BUF_SIZE 3622 #define APPLY_INFO_VALUES 2 3623 #define QUERY_BUF_SIZE 2048 3627 char *copy_log_base;
3628 char copy_log_base_buf[PATH_MAX];
3629 char log_path[PATH_MAX];
3636 if (copy_log_base ==
NULL || *copy_log_base ==
'\0')
3638 copy_log_base = (
char *)
envvar_get (
"DATABASES");
3639 if (copy_log_base ==
NULL)
3645 copy_log_base = realpath (copy_log_base, copy_log_base_buf);
3646 snprintf (log_path, PATH_MAX,
"%s/%s_%s", copy_log_base, database_name, master_host_name);
3648 snprintf (query_buf,
sizeof (query_buf),
"DELETE FROM %s " "WHERE db_name = ? and copied_log_path <> ?",
3676 #undef APPLY_INFO_VALUES 3677 #undef QUERY_BUF_SIZE 3687 int i, j, status, num_nodes;
3692 memset ((
void *) &ha_conf, 0,
sizeof (
HA_CONF));
3703 for (i = 0; dbs[
i] !=
NULL; i++)
3705 if (strcmp (dbs[i], database_name) != 0)
3710 for (j = 0; j < num_nodes; j++)
3712 if (strcmp (nc[j].
node_name, source_host_name) != 0)
3740 bool init_ha_catalog;
3741 int status, error_code;
3742 char er_msg_file[PATH_MAX];
3743 char db_creation_time[LINE_MAX];
3746 char *master_host_name;
3747 const char *mk_path;
3760 if (master_host_name ==
NULL || source_state ==
NULL)
3762 goto print_restoreslave_usage;
3765 if (strcasecmp (source_state,
"master") == 0)
3767 init_ha_catalog =
true;
3769 else if (strcasecmp (source_state,
"slave") == 0 || strcasecmp (source_state,
"replica") == 0)
3771 init_ha_catalog =
false;
3784 restart_arg.
level = 0;
3792 if (mk_path !=
NULL)
3803 goto print_restoreslave_usage;
3814 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", database_name, arg->
command_name);
3828 return EXIT_SUCCESS;
3837 status = boot_restart_from_backup (
true, database_name, &restart_arg);
3858 return EXIT_FAILURE;
3861 if (init_ha_catalog)
3872 return EXIT_FAILURE;
3886 return EXIT_FAILURE;
3900 return EXIT_FAILURE;
3907 return EXIT_SUCCESS;
3909 print_restoreslave_usage:
3915 return EXIT_FAILURE;
3927 char *input_path =
NULL;
3928 char inputpath_local[PATH_MAX] = { 0 };
3929 char *tz_gen_mode =
NULL;
3931 int exit_status = EXIT_SUCCESS;
3933 bool need_db_shutdown =
false;
3934 bool er_inited =
false;
3938 char er_msg_file[PATH_MAX];
3944 if (tz_gen_mode ==
NULL)
3951 if (strcasecmp (tz_gen_mode,
"new") == 0)
3955 else if (strcasecmp (tz_gen_mode,
"extend") == 0)
3961 #if !defined (WINDOWS) 3964 if (db_name ==
NULL)
3966 goto print_gen_tz_usage;
3972 exit_status = EXIT_FAILURE;
3976 else if (strcasecmp (tz_gen_mode,
"update") == 0)
3984 goto print_gen_tz_usage;
3989 goto print_gen_tz_usage;
3994 if (input_path ==
NULL ||
strlen (input_path) == 0)
3997 input_path = inputpath_local;
4001 if (db_name !=
NULL)
4003 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s_%s.err", db_name, arg->
command_name);
4007 snprintf (er_msg_file,
sizeof (er_msg_file) - 1,
"%s.err", arg->
command_name);
4012 memset (checksum, 0,
sizeof (checksum));
4013 if (timezone_compile_data (input_path, tz_gen_type, db_name,
NULL, checksum) !=
NO_ERROR)
4015 exit_status = EXIT_FAILURE;
4025 if (db_name !=
NULL)
4031 exit_status = EXIT_FAILURE;
4034 dir->
name = (
char *) calloc (
strlen (db_name) + 1,
sizeof (char));
4038 exit_status = EXIT_FAILURE;
4041 strcpy (dir->
name, db_name);
4046 exit_status = EXIT_FAILURE;
4050 for (db_info_p = dir; db_info_p !=
NULL; db_info_p = db_info_p->
next)
4054 need_db_shutdown =
true;
4055 exit_status = EXIT_FAILURE;
4060 need_db_shutdown =
true;
4061 exit_status = EXIT_FAILURE;
4080 if (exit_status != EXIT_SUCCESS)
4082 if (er_inited ==
true)
4087 if (need_db_shutdown ==
true)
4094 if (er_inited ==
true)
4104 return EXIT_FAILURE;
4115 long int zone_id = -1;
4117 int err_status = EXIT_SUCCESS;
4119 char *str_next =
NULL;
4120 bool is_dump_countries =
false;
4121 bool is_dump_zone_list =
false;
4122 bool is_dump_zone =
false;
4123 bool is_dump_leap_sec =
false;
4124 bool is_dump_summary =
false;
4137 if ((zone ==
NULL) && (!is_dump_countries) && (!is_dump_zone_list) && (!is_dump_leap_sec) && (!is_dump_summary))
4139 goto print_dump_tz_usage;
4142 if (zone !=
NULL && *zone !=
'\0')
4145 if (strcasecmp (zone,
"all") == 0)
4151 zone_id = strtol (zone, &str_next, 10);
4153 if (zone_id == 0 && *str_next !=
'\0')
4155 goto print_dump_tz_usage;
4157 if (errno == ERANGE)
4162 err_status = EXIT_FAILURE;
4166 is_dump_zone =
true;
4171 err_status = EXIT_FAILURE;
4177 if (is_dump_zone && zone_id < -1 && zone_id >= tzd->
timezone_count)
4181 err_status = EXIT_FAILURE;
4185 printf (
"\nDump timezone data");
4187 if (!is_dump_countries && !is_dump_zone && !is_dump_zone_list && !is_dump_leap_sec)
4193 if (is_dump_countries)
4195 printf (
"\n\nDumping countries...\n");
4198 if (is_dump_zone_list)
4200 printf (
"\n\nDumping timezones...\n");
4219 if (is_dump_leap_sec)
4221 printf (
"\n\nDumping leap seconds...\n");
4230 print_dump_tz_usage:
#define CREATE_FILE_PATH_S
#define DUMPLOCALE_ALPHABET_LOWER_L
DB_OBJECT * db_find_class(const char *name)
#define CREATE_LOG_VOLUME_SIZE_S
bool util_is_localhost(char *host)
#define OPTIMIZE_CLASS_NAME_S
#define LANG_MAX_COLLATIONS
void util_admin_usage(const char *argv0)
char * cfg_maycreate_get_directory_filename(char *buffer)
#define RESTORE_KEYS_FILE_PATH_S
int db_make_datetime(DB_VALUE *value, const DB_DATETIME *datetime)
cubthread::entry * thread_get_thread_entry_info(void)
int logpb_initialize_log_names(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *prefix_logname)
#define CREATE_USER_DEFINITION_FILE_S
DB_INFO * cfg_find_db(const char *db_name)
#define LANG_SYS_COLLATION
const char * verbose_file
int lang_db_put_charset(void)
int lang_locale_data_load_from_lib(LANG_LOCALE_DATA *lld, void *lib_handle, const LOCALE_FILE *lf, bool is_load_for_dump)
void db_set_client_type(int client_type)
#define COPY_CONTROL_FILE_S
int synccolldb(UTIL_FUNCTION_ARG *arg)
#define DUMPLOCALE_IDENTIFIER_ALPHABET_S
int restoreslave(UTIL_FUNCTION_ARG *arg)
int locale_dump_lib_collations(void *lib_handle, const LOCALE_FILE *lf, int dl_settings, int start_value, int end_value)
static char bo_Dbfullname[PATH_MAX]
#define PRINT_AND_LOG_ERR_MSG(...)
void tzc_dump_countries(const TZ_DATA *tzd)
int sysprm_set_force(const char *pname, const char *pvalue)
char ** cfg_get_hosts(const char *prim_host, int *count, bool include_local_host)
void au_dump_to_file(FILE *fp)
int util_size_string_to_byte(UINT64 *size_num, const char *size_str)
#define DUMPLOCALE_ALPHABET_UPPER_L
int db_login(const char *name, const char *password)
#define CREATE_LOG_VOLUME_SIZE_L
#define DUMP_TZ_COUNTRIES_S
#define CREATE_PAGE_SIZE_S
int boot_copy(const char *from_dbname, const char *new_db_name, const char *new_db_path, const char *new_log_path, const char *new_lob_path, const char *new_db_server_host, const char *new_volext_path, const char *fileof_vols_and_copypaths, bool new_db_overwrite)
void tzc_dump_leap_sec(const TZ_DATA *tzd)
static int delete_all_ha_apply_info(void)
void tzc_dump_one_timezone(const TZ_DATA *tzd, const int zone_id)
void(* init_conv_func)(void)
int db_make_bigint(DB_VALUE *value, const DB_BIGINT num)
int db_get_int(const DB_VALUE *value)
#define DUMP_TZ_ZONE_ID_S
int copydb(UTIL_FUNCTION_ARG *arg)
int sm_update_all_statistics(bool with_fullscan)
void cfg_free_hosts(char **host_array)
#define RESTORESLAVE_LIST_S
const char * boot_get_lob_path(void)
int locale_compile_locale(LOCALE_FILE *lf, LOCALE_DATA *ld, bool is_verbose)
#define CREATE_OUTPUT_FILE_S
const TZ_DATA * tz_get_data(void)
int db_make_varchar(DB_VALUE *value, const int max_char_length, DB_CONST_C_CHAR str, const int char_str_byte_size, const int codeset, const int collation_id)
#define AU_DISABLE_PASSWORDS
static int parse_user_define_file(FILE *user_define_file, FILE *output_file)
int au_force_write_new_auth(void)
#define RESTORE_PARTIAL_RECOVERY_S
void locale_free_shared_data(void)
bool boot_shutdown_server(ER_FINAL_CODE iserfinal)
int boot_soft_rename(const char *old_db_name, const char *new_db_name, const char *new_db_path, const char *new_log_path, const char *new_db_server_host, const char *new_volext_path, const char *fileof_vols_and_renamepaths, bool new_db_overwrite, bool extern_rename, bool force_delete)
int diagdb(UTIL_FUNCTION_ARG *arg)
int lang_load_library(const char *lib_file, void **handle)
#define CREATE_LOG_PAGE_SIZE_S
int disk_dump_all(THREAD_ENTRY *thread_p, FILE *fp)
#define PATCH_RECREATE_LOG_S
int db_query_end(DB_QUERY_RESULT *result)
#define COPY_SERVER_NAME_S
#define assert_release(e)
int util_byte_to_size_string(char *buf, size_t len, UINT64 size_num)
int db_truncate_class(DB_OBJECT *class_)
#define DUMPLOCALE_COLLATION_S
#define DUMPLOCALE_CONSOLE_CONV_S
#define CREATE_LOG_PAGE_COUNT_S
char log_Name_active[PATH_MAX]
const VOLID LOG_DBLOG_ACTIVE_VOLID
void xlog_dump(THREAD_ENTRY *thread_p, FILE *out_fp, int isforward, LOG_PAGEID start_logpageid, DKNPAGES dump_npages, TRANID desired_tranid)
int locale_save_all_to_C_file(LOCALE_DATA **ld, int start_index, int end_index, LOCALE_FILE *lf)
int check_database_name(const char *name)
#define CREATE_LOG_PAGE_SIZE_L
bool fileio_is_volume_exist(const char *vol_label_p)
#define CREATE_LOB_PATH_S
int renamedb(UTIL_FUNCTION_ARG *arg)
#define RENAME_CONTROL_FILE_S
#define DUMPLOCALE_IS_COLLATION_WEIGHT_ORDER
static void make_valid_page_size(int *v)
const VOLID LOG_DBTXT_VOLID
#define CREATE_DB_VOLUME_SIZE_S
int util_log_write_errid(int message_id,...)
#define CREATE_DB_VOLUME_SIZE_L
int er_init(const char *msglog_filename, int exit_ask)
void tzc_dump_summary(const TZ_DATA *tzd)
#define GEN_TZ_INPUT_FOLDER_S
#define GENLOCALE_VERBOSE_S
#define DUMPLOCALE_ALPHABET_S
int fileio_mount(THREAD_ENTRY *thread_p, const char *db_full_name_p, const char *vol_label_p, VOLID vol_id, int lock_wait, bool is_do_sync)
int optimizedb(UTIL_FUNCTION_ARG *arg)
int utility_get_option_int_value(UTIL_ARG_MAP *arg_map, int arg_ch)
#define RESTORE_OUTPUT_FILE_S
#define CREATE_LOG_PAGE_COUNT_L
int deletedb(UTIL_FUNCTION_ARG *arg)
void util_print_deprecated(const char *option)
void lang_init_builtin(void)
#define DUMPLOCALE_NUMBERING_S
UINT64 prm_get_bigint_value(PARAM_ID prm_id)
void locator_dump_class_names(THREAD_ENTRY *thread_p, FILE *out_fp)
int createdb(UTIL_FUNCTION_ARG *arg)
#define ER_BO_UNKNOWN_DATABASE
#define GENLOCALE_INPUT_PATH_S
int db_restart(const char *program, int print_version, const char *volume)
void catalog_dump(THREAD_ENTRY *thread_p, FILE *fp, int dump_flag)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
#define RESTORESLAVE_OUTPUT_FILE_S
#define RESTORESLAVE_SOURCE_STATE_S
LANG_COLLATION * lang_get_collation(const int coll_id)
#define DUMPLOCALE_IS_CALENDAR
int db_init(const char *program, int print_version, const char *dbname, const char *db_path, const char *vol_path, const char *log_path, const char *lob_path, const char *host_name, const bool overwrite, const char *comments, const char *addmore_vols_file, int npages, int desired_pagesize, int log_npages, int desired_log_page_size, const char *lang_charset)
#define DIAG_OUTPUT_FILE_S
bool utility_get_option_bool_value(UTIL_ARG_MAP *arg_map, int arg_ch)
const char * fileio_get_base_file_name(const char *full_name_p)
void er_final(ER_FINAL_CODE do_global_final)
char checksum[TZ_CHECKSUM_SIZE+1]
#define DUMPLOCALE_IS_IDENTIFIER_ALPHABET_LOWER
void util_admin_version(const char *argv0)
#define DUMPLOCALE_ALPHABET_LOWER_S
#define DUMPLOCALE_INPUT_PATH_S
#define RESTORESLAVE_BACKUP_FILE_PATH_S
#define COPY_COPY_LOB_PATH_S
MOP au_add_user(const char *name, int *exists)
static int synccoll_check(const char *db_name, int *db_obs_coll_cnt, int *new_sys_coll_cnt)
static int delete_all_slave_ha_apply_info(char *database_name, char *master_host_name)
int file_tracker_dump_all_btree_capacities(THREAD_ENTRY *thread_p, FILE *fp)
#define DUMPLOCALE_IS_NORMALIZATION
#define ER_OUT_OF_VIRTUAL_MEMORY
static int print_backup_info(char *database_name, BO_RESTART_ARG *restart_arg)
int estimatedb_data(UTIL_FUNCTION_ARG *arg_map)
int sysprm_load_and_init(const char *db_name, const char *conf_file, const int load_flags)
int sm_update_statistics(MOP classop, bool with_fullscan)
#define RESTORE_USE_DATABASE_LOCATION_PATH_S
#define INSTALL_FILE_PATH_S
#define DB_MAX_IDENTIFIER_LENGTH
#define INSTALL_LOG_PATH_S
int sysprm_check_range(const char *pname, void *value)
#define DUMPLOCALE_WEIGHT_ORDER_S
int file_tracker_dump_all_capacities(THREAD_ENTRY *thread_p, FILE *fp)
bool is_restore_from_backup
int catcls_get_db_collation(THREAD_ENTRY *thread_p, LANG_COLL_COMPAT **db_collations, int *coll_cnt)
void db_localdatetime(time_t *epoch_time, DB_DATETIME *datetime)
const char * db_error_string(int level)
PGLENGTH db_page_size(void)
char keys_file_path[PATH_MAX]
#define DUMPLOCALE_IS_IDENTIFIER_ALPHABET_UPPER
int check_new_database_name(const char *name)
int locale_dump(void *data, LOCALE_FILE *lf, int dl_settings, int start_value, int end_value)
int locale_get_cfg_locales(LOCALE_FILE **p_locale_files, int *p_num_locales, bool is_lang_init)
int lang_collation_count(void)
#define CREATE_MORE_VOLUME_FILE_S
void fileio_dismount(THREAD_ENTRY *thread_p, int vol_fd)
int db_abort_transaction(void)
#define DUMPLOCALE_IS_ALPHABET
int estimatedb_index(UTIL_FUNCTION_ARG *arg_map)
int genlocale(UTIL_FUNCTION_ARG *arg)
int au_add_member(MOP group, MOP member)
void util_free_ha_conf(HA_CONF *ha_conf)
#define DUMPLOCALE_IS_NUMBERING
#define DUMPLOCALE_END_VALUE_S
int tp_valid_indextype(DB_TYPE type)
int db_execute(const char *CSQL_query, DB_QUERY_RESULT **result, DB_QUERY_ERROR *query_error)
MOP au_find_user(const char *user_name)
#define APPLY_INFO_VALUES
int patchdb(UTIL_FUNCTION_ARG *arg)
int sm_force_write_all_classes(void)
static int parse_user_define_line(char *line, FILE *output_file)
#define INSTALL_SERVER_NAME_S
#define RESTORESLAVE_USE_DATABASE_LOCATION_PATH_S
#define DIAG_DUMP_RECORDS_S
int disk_sectors_to_extend_npages(const int num_pages)
bool cfg_delete_db(DB_INFO **dir_info_p, const char *name)
#define RESTORE_BACKUP_FILE_PATH_S
int log_default_input_for_archive_log_location
static int insert_ha_apply_info(char *database_name, char *master_host_name, INT64 database_creation, INT64 pageid, int offset)
#define db_private_free(thrd, ptr)
void COMPOSE_FULL_NAME(char *buf, size_t buf_size, const char *path, const char *name)
int cfg_read_directory_ex(int vdes, DB_INFO **info_p, bool write_flag)
int csql(const char *argv0, CSQL_ARGUMENT *csql_arg)
int catcls_compile_catalog_classes(THREAD_ENTRY *thread_p)
void er_set_with_oserror(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
DB_DOMAIN * pt_string_to_db_domain(const char *s, const char *class_name)
#define IO_DEFAULT_PAGE_SIZE
DB_INFO * cfg_add_db(DB_INFO **dir, const char *name, const char *path, const char *logpath, const char *lobpath, const char *host)
int utility_get_option_string_table_size(UTIL_ARG_MAP *arg_map)
#define DUMPLOCALE_ALPHABET_ALL_CASING
#define DUMPLOCALE_CALENDAR_S
#define DELETE_DELETE_BACKUP_S
const char * utility_get_generic_message(int message_index)
int db_datetime_to_string(char *buf, int bufsize, DB_DATETIME *datetime)
#define ER_BO_UNABLE_TO_FIND_HOSTNAME
#define SYNCCOLL_FORCESYNC_S
const char * envvar_get(const char *name)
#define DUMPLOCALE_IS_TEXT_CONV
static void error(const char *msg)
#define CREATE_PAGE_SIZE_L
void locale_destroy_data(LOCALE_DATA *ld)
#define DUMPLOCALE_ALPHABET_UPPER_S
#define RENAME_EXTENTED_VOLUME_PATH_S
int db_query_next_tuple(DB_QUERY_RESULT *result)
int file_tracker_dump(THREAD_ENTRY *thread_p, FILE *fp)
int db_execute_with_values(const char *CSQL_query, DB_QUERY_RESULT **result, DB_QUERY_ERROR *query_error, int arg_count, DB_VALUE *vals)
static bool check_ha_db_and_node_list(char *database_name, char *source_host_name)
static char database_name[MAX_HA_DBINFO_LENGTH]
#define RESTORE_UP_TO_DATE_S
int cfg_read_directory(DB_INFO **info_p, bool write_flag)
int fileio_list_restore(THREAD_ENTRY *thread_p, const char *db_full_name_p, char *backup_source_p, FILEIO_BACKUP_LEVEL level, bool is_new_vol_path)
TEXT_CONVERSION * txt_conv
void locale_mark_duplicate_collations(LOCALE_DATA **ld, int start_index, int end_index, bool is_verbose)
int fileio_get_backup_volume(THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *user_backuppath, int try_level, char *from_volbackup)
int sm_update_all_catalog_statistics(bool with_fullscan)
#define DUMPLOCALE_START_VALUE_S
#define ER_ARG_OUT_OF_RANGE
#define LOC_LOCALE_STR_SIZE
#define free_and_init(ptr)
char * prm_get_string_value(PARAM_ID prm_id)
int sysprm_get_range(const char *pname, void *min, void *max)
#define STATS_WITH_FULLSCAN
#define DB_CURSOR_SUCCESS
int dumplocale(UTIL_FUNCTION_ARG *arg)
#define DUMP_TZ_DUMP_SUM_S
#define CREATE_LOG_PATH_S
int db_get_string_size(const DB_VALUE *value)
int util_log_write_errstr(const char *format,...)
char * basename(const char *path)
#define ALTERDBHOST_HOST_S
#define DB_VALUE_TYPE(value)
#define COPY_DELETE_SOURCE_S
#define CREATE_CSQL_INITIALIZATION_FILE_S
char * envvar_tzdata_dir_file(char *path, size_t size, const char *filename)
char * msgcat_message(int cat_id, int set_id, int msg_id)
const char * prm_get_name(PARAM_ID prm_id)
#define LOG_LOCALE_ERROR(msg, er_status, do_print)
int boot_add_collations(MOP class_mop)
#define CREATE_DB_PAGE_SIZE_L
#define DUMPLOCALE_IS_IDENTIFIER_ALPHABET
char * strdup(const char *str)
int boot_emergency_patch(const char *db_name, bool recreate_log, DKNPAGES log_npages, const char *db_locale, FILE *out_fp)
char coll_name[COLL_NAME_SIZE]
#define DUMPLOCALE_IS_COLLATION_CP_ORDER
#define DUMPLOCALE_NORMALIZATION_S
int db_value_clear(DB_VALUE *value)
int db_make_int(DB_VALUE *value, const int num)
int db_query_get_tuple_value(DB_QUERY_RESULT *result, int index, DB_VALUE *value)
#define OPTION_STRING_TABLE
#define DUMP_TZ_LEAP_SEC_S
#define STATS_WITH_SAMPLING
int put_timezone_checksum(char *checksum)
void cfg_write_directory_ex(int vdes, const DB_INFO *databases)
#define RENAME_DELETE_BACKUP_S
#define RESTORESLAVE_MASTER_HOST_NAME_S
#define ER_BO_DATABASE_EXISTS
int locale_prepare_C_file(void)
const char * program_name
#define CUB_MAXHOSTNAMELEN
void sm_mark_system_classes(void)
#define COPY_EXTENTED_VOLUME_PATH_S
#define LOB_PATH_DEFAULT_PREFIX
void tzc_dump_timezones(const TZ_DATA *tzd)
int util_make_ha_conf(HA_CONF *ha_conf)
#define db_private_realloc(thrd, ptr, size)
int db_compile_and_execute_local(const char *CSQL_query, void *result, DB_QUERY_ERROR *query_error)
static int parse_up_to_date(char *up_to_date, struct tm *time_date)
int file_tracker_dump_all_heap(THREAD_ENTRY *thread_p, FILE *fp, bool dump_records)
const char * in_file_name
void cfg_free_directory(DB_INFO *databases)
int dump_tz(UTIL_FUNCTION_ARG *arg)
char coll_name[COLL_NAME_SIZE]
#define DELETE_OUTPUT_FILE_S
int restoredb(UTIL_FUNCTION_ARG *arg)
const char * command_name
int boot_delete(const char *db_name, bool force_delete)
#define GETHOSTNAME(p, l)
int locale_check_and_set_default_files(LOCALE_FILE *lf, bool is_lang_init)
char * utility_get_option_string_value(UTIL_ARG_MAP *arg_map, int arg_ch, int index)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
int alterdbhost(UTIL_FUNCTION_ARG *arg)
int db_set_page_size(PGLENGTH io_page_size, PGLENGTH log_page_size)
int file_tracker_dump_all_heap_capacities(THREAD_ENTRY *thread_p, FILE *fp)
int installdb(UTIL_FUNCTION_ARG *arg)
#define DISK_SECTOR_NPAGES
int db_commit_transaction(void)
#define CREATE_DB_PAGE_SIZE_S
int search(int &result, const cub_regex_object ®, const std::string &src, const INTL_CODESET codeset)
DB_INFO * cfg_find_db_list(DB_INFO *db_info_list_p, const char *name)
#define CREATE_SERVER_NAME_S
#define DUMPLOCALE_IS_ALPHABET_LOWER
void cfg_write_directory(const DB_INFO *databases)
int gen_tz(UTIL_FUNCTION_ARG *arg)
#define DUMPLOCALE_IS_ALPHABET_UPPER
#define MSGCAT_CATALOG_UTILS