MySQL 8.4.2
Source Code Documentation
server.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 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 DD_UPGRADE__SERVER_H_INCLUDED
25#define DD_UPGRADE__SERVER_H_INCLUDED
26
27#include <stdio.h>
28
29#include "typelib.h"
30
31class THD;
32class Time_zone;
33
40};
41
42namespace dd {
43namespace upgrade {
44/**
45 Upgrades/restores the system tables to defaults of the current MySQL version.
46 This is a replacement for the mysql_upgrade client.
47
48 There are four SQL scripts executed:
49 1. mysql_system_tables.sql - Creates the system tables
50 2. mysql_system_tables_fix.sql - Updates the system table
51 3. mysql_system_tables_data_fix.sql - Fills the system tables with meta data
52 4. ALL_SYS_SCHEMA.sql - Create and/or updates the sys schema
53
54 Then the system tables are checked by executing CHECK TABLE SQL statements.
55
56 This function is called during startup if the MySQL version present in
57 DD_properties in not the same as the current MySQL version. This function can
58 also be called if the server is started with --upgrade=FORCE option.
59
60 If the server is started with --upgrade=MINIMAL option with a newer MySQL
61 server version Z on an older data directory of MySQL server version X, this
62 function checks if server upgrade has been skipped before using another MySQL
63 server version Y such that Y != Z, X < Y and X < Z. If yes, we abort.
64
65 The server upgrade ends with updating the MYSQLD_UPGRADED_VERSION value in
66 DD_properties to the current server version (MYSQL_VERSION_ID).
67
68 @param[in] thd Thread handle.
69
70 @retval false ON SUCCESS
71 @retval true ON FAILURE
72*/
74
76
78
79} // namespace upgrade
80
81} // namespace dd
82#endif // DD_UPGRADE__SERVER_H_INCLUDED
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:1269
bool no_server_upgrade_required()
Definition: server.cc:1262
bool upgrade_system_schemas(THD *thd)
Upgrades/restores the system tables to defaults of the current MySQL version.
Definition: server.cc:1178
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
TYPELIB upgrade_mode_typelib
Definition: server.cc:93
enum_upgrade_mode
Definition: server.h:35
@ UPGRADE_NONE
Definition: server.h:36
@ UPGRADE_MINIMAL
Definition: server.h:37
@ UPGRADE_AUTO
Definition: server.h:38
@ UPGRADE_FORCE
Definition: server.h:39
Definition: typelib.h:35