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