MySQL 26.7.0
Source Code Documentation
server.h
Go to the documentation of this file.
1#pragma once
2/* Copyright (c) 2019, 2026, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24
25#include "typelib.h"
26
27class THD;
28class Time_zone;
29
36};
37
39extern const char *check_table_fun_modes[];
43};
44
45namespace dd {
46namespace upgrade {
47/**
48 Upgrades/restores the system tables to defaults of the current MySQL version.
49 This is a replacement for the mysql_upgrade client.
50
51 There are four SQL scripts executed:
52 1. mysql_system_tables.sql - Creates the system tables
53 2. mysql_system_tables_fix.sql - Updates the system table
54 3. mysql_system_tables_data_fix.sql - Fills the system tables with meta data
55 4. ALL_SYS_SCHEMA.sql - Create and/or updates the sys schema
56
57 Then the system tables are checked by executing CHECK TABLE SQL statements.
58
59 This function is called during startup if the MySQL version present in
60 DD_properties in not the same as the current MySQL version. This function can
61 also be called if the server is started with --upgrade=FORCE option.
62
63 If the server is started with --upgrade=MINIMAL option with a newer MySQL
64 server version Z on an older data directory of MySQL server version X, this
65 function checks if server upgrade has been skipped before using another MySQL
66 server version Y such that Y != Z, X < Y and X < Z. If yes, we abort.
67
68 The server upgrade ends with updating the MYSQLD_UPGRADED_VERSION value in
69 DD_properties to the current server version (MYSQL_VERSION_ID).
70
71 @param[in] thd Thread handle.
72
73 @retval false ON SUCCESS
74 @retval true ON FAILURE
75*/
77
79
81
82} // namespace upgrade
83
84} // namespace dd
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
This class represents abstract time zone and provides basic interface for MYSQL_TIME <-> my_time_t co...
Definition: tztime.h:49
bool I_S_upgrade_required()
Definition: server.cc:1453
bool no_server_upgrade_required()
Definition: server.cc:1446
bool upgrade_system_schemas(THD *thd)
Upgrades/restores the system tables to defaults of the current MySQL version.
Definition: server.cc:1362
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:44
TYPELIB upgrade_mode_typelib
Definition: server.cc:96
enum_check_table_fun_mode
Definition: server.h:40
@ CHECK_TABLE_FUN_WARN
Definition: server.h:41
@ CHECK_TABLE_FUN_ABORT
Definition: server.h:42
TYPELIB check_table_fun_mode_typelib
Definition: server.cc:100
const char * check_table_fun_modes[]
Definition: server.cc:99
enum_upgrade_mode
Definition: server.h:31
@ UPGRADE_NONE
Definition: server.h:32
@ UPGRADE_MINIMAL
Definition: server.h:33
@ UPGRADE_AUTO
Definition: server.h:34
@ UPGRADE_FORCE
Definition: server.h:35
Definition: typelib.h:35