Skip to content

Commit a3479c1

Browse files
committed
Bug#21656153: REDUCE HEADER FILE DEPENDENCIES IN MYSQLD.H
Remove unneccessary header dependencies from mysqld.h Remove declarations from mysqld.h which have no defintions. Remove declarations from mysqld.h where they can be made static in mysqld.cc instead. Remove performance schema keys for mutexes/rwlocks/files that no longer exist.
1 parent 1409c76 commit a3479c1

19 files changed

+386
-403
lines changed

libmysqld/lib_sql.cc

-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,6 @@ extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
5151
static my_bool emb_read_query_result(MYSQL *mysql);
5252

5353

54-
void unireg_clear(int exit_code)
55-
{
56-
DBUG_ENTER("unireg_clear");
57-
clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */
58-
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
59-
DBUG_VOID_RETURN;
60-
}
61-
6254
/*
6355
Wrapper error handler for embedded server to call client/server error
6456
handler based on whether thread is in client/server context

sql/auth/sql_auth_cache.cc

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "field.h" // Field
2323
#include "item_func.h" // mqh_used
2424
#include "log.h" // sql_print_warning
25+
#include "mysqld.h" // my_localhost
2526
#include "psi_memory_key.h" // key_memory_acl_mem
2627
#include "records.h" // READ_RECORD
2728
#include "sql_authentication.h" // sha256_password_plugin_name

sql/auth/sql_auth_cache.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "my_global.h"
2020
#include "my_sys.h" // wild_many, wild_one, wild_prefix
21+
#include "m_string.h" // LEX_CSTRING
2122
#include "mysql_com.h" // SCRAMBLE_LENGTH
2223
#include "mysql_time.h" // MYSQL_TIME
2324
#include "prealloced_array.h" // Prealloced_array

sql/auth/sql_authorization.cc

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "log.h" /* sql_print_warning */
2828
#include "sql_class.h"
2929
#include "derror.h"
30+
#include "mysqld.h"
3031

3132
#include "sql_update.h"
3233
#include "auth_internal.h"

sql/auth/sql_user.cc

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "tztime.h"
3030
#include "crypt_genhash_impl.h" /* CRYPT_MAX_PASSWORD_SIZE */
3131
#include "derror.h" /* ER_THD */
32+
#include "mysqld.h"
3233

3334
/**
3435
Auxiliary function for constructing a user list string.

sql/derror.cc

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include "pfs_file_provider.h"
2626
#include "mysql/psi/mysql_file.h"
2727

28+
CHARSET_INFO *error_message_charset_info;
29+
2830
static const char *ERRMSG_FILE = "errmsg.sys";
2931
static const int NUM_SECTIONS=
3032
sizeof(errmsg_section_start) / sizeof(errmsg_section_start[0]);

sql/derror.h

+6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
#endif
2323

2424
class THD;
25+
typedef struct charset_info_st CHARSET_INFO;
26+
27+
/**
28+
Character set of the buildin error messages loaded from errmsg.sys.
29+
*/
30+
extern CHARSET_INFO *error_message_charset_info;
2531

2632
class MY_LOCALE_ERRMSGS
2733
{

sql/hash_filo.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
#define HASH_FILO_H
2424

2525
#include "hash.h" /* my_hash_get_key, my_hash_free_key, HASH */
26-
#include "mysqld.h" /* key_hash_filo_lock */
26+
27+
#ifdef HAVE_PSI_INTERFACE
28+
extern PSI_mutex_key key_hash_filo_lock;
29+
#endif // HAVE_PSI_INTERFACE
2730

2831
struct hash_filo_element
2932
{

sql/hostname.cc

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "hostname.h"
2929
#include "hash_filo.h"
3030
#include <m_ctype.h>
31+
#include "mysqld.h" // specialflag
3132
#include "log.h" // sql_print_warning,
3233
// sql_print_information
3334
#include "psi_memory_key.h"

sql/hostname.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
1818

1919
#include "my_global.h" /* uint */
2020
#include "hash_filo.h"
21+
#include "mysql_com.h"
2122

2223
#ifdef HAVE_NETINET_IN_H
2324
#include <netinet/in.h>

sql/init.cc

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "my_sys.h"
2626
#include "mysqld.h" // connection_events_loop_aborted(), ...
2727
#include "my_time.h" // my_init_time
28+
#include "m_string.h" // my_stpcpy
2829
#include <m_ctype.h>
2930

3031
#ifdef _WIN32

0 commit comments

Comments
 (0)