You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.1 KiB

  1. /* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  12. #ifndef SQL_DB_INCLUDED
  13. #define SQL_DB_INCLUDED
  14. #include "hash.h" /* HASH */
  15. class THD;
  16. typedef struct charset_info_st CHARSET_INFO;
  17. typedef struct st_ha_create_information HA_CREATE_INFO;
  18. typedef struct st_mysql_lex_string LEX_STRING;
  19. int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
  20. bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
  21. bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
  22. bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db);
  23. bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name,
  24. bool force_switch);
  25. bool mysql_opt_change_db(THD *thd,
  26. const LEX_STRING *new_db_name,
  27. LEX_STRING *saved_db_name,
  28. bool force_switch,
  29. bool *cur_db_changed);
  30. bool my_database_names_init(void);
  31. void my_database_names_free(void);
  32. bool check_db_dir_existence(const char *db_name);
  33. bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
  34. bool load_db_opt_by_name(THD *thd, const char *db_name,
  35. HA_CREATE_INFO *db_create_info);
  36. CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name);
  37. bool my_dbopt_init(void);
  38. void my_dbopt_cleanup(void);
  39. extern int creating_database; // How many database locks are made
  40. extern HASH lock_db_cache;
  41. #define MY_DB_OPT_FILE "db.opt"
  42. #endif /* SQL_DB_INCLUDED */