MySQL 8.4.0
Source Code Documentation
sql_db.h
Go to the documentation of this file.
1/* Copyright (c) 2006, 2024, Oracle and/or its affiliates.
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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef SQL_DB_INCLUDED
25#define SQL_DB_INCLUDED
26
27#include "lex_string.h"
28
29struct TABLE_SHARE;
30class THD;
31namespace dd {
32class Schema;
33}
34
35struct CHARSET_INFO;
36struct HA_CREATE_INFO;
37
38bool mysql_create_db(THD *thd, const char *db, HA_CREATE_INFO *create);
39bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
40bool mysql_rm_db(THD *thd, const LEX_CSTRING &db, bool if_exists);
41bool mysql_change_db(THD *thd, const LEX_CSTRING &new_db_name,
42 bool force_switch);
43
44bool mysql_opt_change_db(THD *thd, const LEX_CSTRING &new_db_name,
45 LEX_STRING *saved_db_name, bool force_switch,
46 bool *cur_db_changed);
47bool get_default_db_collation(const dd::Schema &schema,
48 const CHARSET_INFO **collation);
49bool get_default_db_collation(THD *thd, const char *db_name,
50 const CHARSET_INFO **collation);
51bool check_schema_readonly(THD *thd, const char *schema_name,
52 TABLE_SHARE *share = nullptr);
53#endif /* SQL_DB_INCLUDED */
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: schema.h:63
const char * collation
Definition: audit_api_message_emit.cc:184
borrowable::session_track::Schema< true > Schema
Definition: classic_protocol_session_track.h:288
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
static mysql_service_status_t create(const char *service_names[], reference_caching_channel *out_channel) noexcept
Definition: component.cc:45
const char * db_name
Definition: rules_table_service.cc:55
bool check_schema_readonly(THD *thd, const char *schema_name, TABLE_SHARE *share=nullptr)
Check the read_only option for the given schema, and report error if the schema is not writable.
Definition: sql_db.cc:208
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:709
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:1356
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:1543
bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create)
Definition: sql_db.cc:514
bool mysql_create_db(THD *thd, const char *db, HA_CREATE_INFO *create)
Create a database.
Definition: sql_db.cc:329
bool get_default_db_collation(const dd::Schema &schema, const CHARSET_INFO **collation)
Definition: sql_db.cc:129
Definition: m_ctype.h:423
Struct to hold information about the table that should be created.
Definition: handler.h:3201
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
This structure is shared between different table objects.
Definition: table.h:700