MCPcopy Create free account
hub / github.com/MariaDB/server / init_dumping

Function init_dumping

client/mysqldump.cc:5786–5815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5784
5785
5786static int init_dumping(char *database, int init_func(char*))
5787{
5788 if (mysql_select_db(mysql, database))
5789 {
5790 DB_error(mysql, "when selecting the database");
5791 return 1; /* If --force */
5792 }
5793 if (!multi_file_output && !opt_xml)
5794 {
5795 if (opt_databases || opt_alldbs)
5796 {
5797 /*
5798 length of table name * 2 (if name contains quotes), 2 quotes and 0
5799 */
5800 char quoted_database_buf[NAME_LEN*2+3];
5801 char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
5802
5803 print_comment(md_result_file, 0,
5804 "\n--\n-- Current Database: %s\n--\n",
5805 fix_for_comment(qdatabase));
5806
5807 /* Call the view or table specific function */
5808 init_func(qdatabase);
5809
5810 fprintf(md_result_file,"\nUSE %s;\n", qdatabase);
5811 check_io(md_result_file);
5812 }
5813 }
5814 return 0;
5815} /* init_dumping */
5816
5817
5818/* Return 1 if we should copy the table */

Callers 3

dump_all_tables_in_dbFunction · 0.85
dump_all_views_in_dbFunction · 0.85
dump_selected_tablesFunction · 0.85

Calls 6

mysql_select_dbFunction · 0.85
DB_errorFunction · 0.85
quote_nameFunction · 0.85
fix_for_commentFunction · 0.85
check_ioFunction · 0.85
print_commentFunction · 0.70

Tested by

no test coverage detected