MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
server.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2025, 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
43extern const char *check_table_fun_modes[];
47};
48
49namespace dd {
50namespace upgrade {
51/**
52 Upgrades/restores the system tables to defaults of the current MySQL version.
53 This is a replacement for the mysql_upgrade client.
54
55 There are four SQL scripts executed:
56 1. mysql_system_tables.sql - Creates the system tables
57 2. mysql_system_tables_fix.sql - Updates the system table
58 3. mysql_system_tables_data_fix.sql - Fills the system tables with meta data
59 4. ALL_SYS_SCHEMA.sql - Create and/or updates the sys schema
60
61 Then the system tables are checked by executing CHECK TABLE SQL statements.
62
63 This function is called during startup if the MySQL version present in
64 DD_properties in not the same as the current MySQL version. This function can
65 also be called if the server is started with --upgrade=FORCE option.
66
67 If the server is started with --upgrade=MINIMAL option with a newer MySQL
68 server version Z on an older data directory of MySQL server version X, this
69 function checks if server upgrade has been skipped before using another MySQL
70 server version Y such that Y != Z, X < Y and X < Z. If yes, we abort.
71
72 The server upgrade ends with updating the MYSQLD_UPGRADED_VERSION value in
73 DD_properties to the current server version (MYSQL_VERSION_ID).
74
75 @param[in] thd Thread handle.
76
77 @retval false ON SUCCESS
78 @retval true ON FAILURE
79*/
81
83
85
86} // namespace upgrade
87
88} // namespace dd
89#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:1358
bool no_server_upgrade_required()
Definition: server.cc:1351
bool upgrade_system_schemas(THD *thd)
Upgrades/restores the system tables to defaults of the current MySQL version.
Definition: server.cc:1267
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
TYPELIB upgrade_mode_typelib
Definition: server.cc:94
enum_check_table_fun_mode
Definition: server.h:44
@ CHECK_TABLE_FUN_WARN
Definition: server.h:45
@ CHECK_TABLE_FUN_ABORT
Definition: server.h:46
TYPELIB check_table_fun_mode_typelib
Definition: server.cc:98
const char * check_table_fun_modes[]
Definition: server.cc:97
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