MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sql_db.h
1 /* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 #ifndef SQL_DB_INCLUDED
17 #define SQL_DB_INCLUDED
18 
19 #include "hash.h" /* HASH */
20 
21 class THD;
22 typedef struct charset_info_st CHARSET_INFO;
24 typedef struct st_mysql_lex_string LEX_STRING;
25 
26 int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
27 bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
28 bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
29 bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db);
30 bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name,
31  bool force_switch);
32 
33 bool mysql_opt_change_db(THD *thd,
34  const LEX_STRING *new_db_name,
35  LEX_STRING *saved_db_name,
36  bool force_switch,
37  bool *cur_db_changed);
38 bool my_dboptions_cache_init(void);
39 void my_dboptions_cache_free(void);
40 bool check_db_dir_existence(const char *db_name);
41 bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
42 bool load_db_opt_by_name(THD *thd, const char *db_name,
43  HA_CREATE_INFO *db_create_info);
44 const CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
45 bool my_dbopt_init(void);
46 void my_dbopt_cleanup(void);
47 
48 #define MY_DB_OPT_FILE "db.opt"
49 
50 #endif /* SQL_DB_INCLUDED */