| 5784 | |
| 5785 | |
| 5786 | static 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 */ |
no test coverage detected