MySQL  8.0.18
Source Code Documentation
sql_db.h
Go to the documentation of this file.
1 /* Copyright (c) 2006, 2017, 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, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef SQL_DB_INCLUDED
24 #define SQL_DB_INCLUDED
25 
26 #include "lex_string.h"
27 
28 class THD;
29 namespace dd {
30 class Schema;
31 }
32 
33 struct CHARSET_INFO;
34 struct HA_CREATE_INFO;
35 
36 bool mysql_create_db(THD *thd, const char *db, HA_CREATE_INFO *create);
37 bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
38 bool mysql_rm_db(THD *thd, const LEX_CSTRING &db, bool if_exists);
39 bool mysql_change_db(THD *thd, const LEX_CSTRING &new_db_name,
40  bool force_switch);
41 
42 bool mysql_opt_change_db(THD *thd, const LEX_CSTRING &new_db_name,
43  LEX_STRING *saved_db_name, bool force_switch,
44  bool *cur_db_changed);
45 bool get_default_db_collation(const dd::Schema &schema,
46  const CHARSET_INFO **collation);
47 bool get_default_db_collation(THD *thd, const char *db_name,
48  const CHARSET_INFO **collation);
49 #endif /* SQL_DB_INCLUDED */
bool get_default_db_collation(const dd::Schema &schema, const CHARSET_INFO **collation)
Definition: sql_db.cc:123
const char * db_name
Definition: rules_table_service.cc:54
Definition: mysql_lex_string.h:34
bool mysql_create_db(THD *thd, const char *db, HA_CREATE_INFO *create)
Create a database.
Definition: sql_db.cc:230
bool mysql_rm_db(THD *thd, const LEX_CSTRING &db, bool if_exists)
Drop all tables, routines and events in a database and the database itself.
Definition: sql_db.cc:534
Definition: mysql_lex_string.h:39
bool mysql_change_db(THD *thd, const LEX_CSTRING &new_db_name, bool force_switch)
Change the current database and its attributes unconditionally.
Definition: sql_db.cc:1183
bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create)
Definition: sql_db.cc:415
Definition: m_ctype.h:359
bool mysql_opt_change_db(THD *thd, const LEX_CSTRING &new_db_name, LEX_STRING *saved_db_name, bool force_switch, bool *cur_db_changed)
Change the current database and its attributes if needed.
Definition: sql_db.cc:1371
Definition: handler.h:2629
Definition: schema.h:61
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:778