My Project
sql_db.h
00001 /* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
00015 
00016 #ifndef SQL_DB_INCLUDED
00017 #define SQL_DB_INCLUDED
00018 
00019 #include "hash.h"                               /* HASH */
00020 
00021 class THD;
00022 typedef struct charset_info_st CHARSET_INFO;
00023 typedef struct st_ha_create_information HA_CREATE_INFO;
00024 typedef struct st_mysql_lex_string LEX_STRING;
00025 
00026 int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
00027 bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
00028 bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
00029 bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db);
00030 bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name,
00031                      bool force_switch);
00032 
00033 bool mysql_opt_change_db(THD *thd,
00034                          const LEX_STRING *new_db_name,
00035                          LEX_STRING *saved_db_name,
00036                          bool force_switch,
00037                          bool *cur_db_changed);
00038 bool my_dboptions_cache_init(void);
00039 void my_dboptions_cache_free(void);
00040 bool check_db_dir_existence(const char *db_name);
00041 bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
00042 bool load_db_opt_by_name(THD *thd, const char *db_name,
00043                          HA_CREATE_INFO *db_create_info);
00044 const CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
00045 bool my_dbopt_init(void);
00046 void my_dbopt_cleanup(void);
00047 
00048 #define MY_DB_OPT_FILE "db.opt"
00049 
00050 #endif /* SQL_DB_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines