Skip to content

Commit e9a94a4

Browse files
committed
Bug#22455022: REMOVE EXTRA #INCLUDES FROM SQL/ HEADERS
Another round of sql/ header simplifications. Do not #include headers that are not needed. Use forward declarations if possible. Gives fewer depedencies and faster compilation.
1 parent a8ce5a1 commit e9a94a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1487
-1421
lines changed

plugin/innodb_memcached/daemon_memcached/daemon/memcached_mysql.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***********************************************************************
22
3-
Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3+
Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
44
55
This program is free software; you can redistribute it and/or modify it
66
under the terms of the GNU General Public License as published by the
@@ -28,6 +28,7 @@ Created 04/12/2011 Jimmy Yang
2828
#include <stdlib.h>
2929
#include <ctype.h>
3030
#include <mysql_version.h>
31+
#include "plugin.h"
3132
#include "sql_plugin.h"
3233

3334
/** Configuration info passed to memcached, including

sql/aggregate_check.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef AGGREGATE_CHECK_INCLUDED
22
#define AGGREGATE_CHECK_INCLUDED
33

4-
/* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -447,11 +447,15 @@ VE2 are NULL then VE3 must be NULL, which makes the dependency NULL-friendly.
447447
*/
448448

449449
#include "my_global.h"
450-
#include "mem_root_array.h"
451-
#include "opt_trace.h"
452-
#include "item_cmpfunc.h"
453-
#include "item_sum.h"
450+
451+
#include "item_cmpfunc.h" // Item_func_any_value
452+
#include "item_sum.h" // Item_sum
453+
#include "mem_root_array.h" // Mem_root_array
454+
#include "sql_alloc.h" // Sql_alloc
455+
454456
struct st_mem_root;
457+
class Opt_trace_context;
458+
class Opt_trace_object;
455459
class SELECT_LEX;
456460
struct TABLE_LIST;
457461

sql/auth/sql_authorization.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2016, 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
@@ -29,6 +29,7 @@
2929
#include "derror.h"
3030
#include "mysqld.h"
3131

32+
#include "error_handler.h"
3233
#include "sql_update.h"
3334
#include "auth_internal.h"
3435
#include "sql_auth_cache.h"

sql/current_thd.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2015, 2016, 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,7 +18,6 @@
1818

1919
#include "my_global.h"
2020
#include "my_thread_local.h"
21-
#include "my_dbug.h"
2221

2322
class THD;
2423

sql/dynamic_ids.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -17,6 +17,9 @@
1717

1818
#include "dynamic_ids.h"
1919

20+
#include "m_string.h" // my_strtok_r
21+
#include "sql_string.h" // String
22+
2023
Server_ids::Server_ids()
2124
: dynamic_ids(PSI_NOT_INSTRUMENTED)
2225
{

sql/dynamic_ids.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2010, 2016, 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
@@ -14,13 +14,13 @@
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
#ifndef DYNAMIC_ID_H
17-
1817
#define DYNAMIC_ID_H
1918

20-
#include <my_sys.h>
21-
#include <sql_string.h>
19+
#include "my_global.h"
2220
#include "prealloced_array.h"
2321

22+
class String;
23+
2424
class Server_ids
2525
{
2626
public:

sql/field.h

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "sql_error.h" // Sql_condition
2828
#include "sql_string.h" // String
2929
#include "table.h" // TABLE
30-
#include "mysql_version.h" // FRM_VER
3130

3231
class Create_field;
3332
class Json_dom;

sql/filesort.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -43,6 +43,7 @@
4343
#include "json_dom.h" // Json_wrapper
4444
#include "psi_memory_key.h"
4545
#include "template_utils.h"
46+
#include "error_handler.h"
4647

4748
#include "pfs_file_provider.h"
4849
#include "mysql/psi/mysql_file.h"

sql/filesort.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2006, 2016, 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,7 +18,7 @@
1818

1919
#include "my_global.h" /* uint, uchar */
2020
#include "my_base.h" /* ha_rows */
21-
#include "sql_list.h" /* Sql_alloc */
21+
#include "sql_alloc.h" /* Sql_alloc */
2222
class THD;
2323
struct TABLE;
2424
struct st_sort_field;

sql/filesort_utils.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2010, 2016, 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
@@ -17,16 +17,17 @@
1717
#define FILESORT_UTILS_INCLUDED
1818

1919
#include "my_global.h"
20-
#include "my_base.h"
21-
#include "sql_array.h"
22-
#include "my_sys.h"
23-
#include "mysql/service_mysql_alloc.h"
2420

25-
#include <algorithm>
21+
#include "my_base.h" // ha_rows
22+
#include "mysql/service_mysql_alloc.h" // my_free
23+
#include "sql_array.h" // Bounds_checked_array
24+
2625
#include <utility>
2726

2827
class Cost_model_table;
2928
class Sort_param;
29+
30+
3031
/*
3132
Calculate cost of merge sort
3233

sql/handler.cc

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "dd_table_share.h" // open_table_def
3131
#include "debug_sync.h" // DEBUG_SYNC
3232
#include "derror.h" // ER_DEFAULT
33+
#include "error_handler.h" // Internal_error_handler
3334
#include "lock.h" // MYSQL_LOCK
3435
#include "log.h" // sql_print_error
3536
#include "log_event.h" // Write_rows_log_event

sql/item.cc

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "auth_common.h" // get_column_grant
2222
#include "current_thd.h"
2323
#include "derror.h" // ER_THD
24+
#include "error_handler.h" // Internal_error_handler
2425
#include "item_cmpfunc.h" // COND_EQUAL
2526
#include "item_create.h" // create_temporal_literal
2627
#include "item_func.h" // item_func_sleep_init

sql/item_cmpfunc.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2016, 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
@@ -29,6 +29,7 @@
2929
#include "item_sum.h" // Item_sum_hybrid
3030
#include "item_json_func.h" // json_value, get_json_atom_wrapper
3131
#include "mysqld.h" // log_10
32+
#include "opt_trace.h" // Opt_trace_object
3233
#include "parse_tree_helpers.h" // PT_item_list
3334
#include "sql_class.h" // THD
3435
#include "sql_optimizer.h" // JOIN

sql/item_func.cc

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "current_thd.h"
2929
#include "debug_sync.h" // DEBUG_SYNC
3030
#include "derror.h" // ER_THD
31+
#include "error_handler.h" // Internal_error_handler
3132
#include "item_cmpfunc.h" // get_datetime_value
3233
#include "item_strfunc.h" // Item_func_geohash
3334
#include <mysql/service_thd_wait.h>

sql/item_strfunc.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
33

44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@
4040
#include "mysqld.h" // LOCK_des_key_file
4141
#include "sha1.h" // SHA1_HASH_SIZE
4242
#include "auth_common.h" // check_password_policy
43+
#include "derror.h" // ER_THD
4344
#include "des_key_file.h" // st_des_keyblock
4445
#include "password.h" // my_make_scrambled_password
4546
#include "spatial.h" // Geometry

sql/item_timefunc.cc

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "item_timefunc.h"
2929

3030
#include "current_thd.h"
31+
#include "derror.h" // ER_THD
3132
#include "sql_class.h" // THD
3233
#include "sql_locale.h" // my_locale_en_US
3334
#include "sql_time.h" // make_truncated_value_warning

sql/json_binary.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef JSON_BINARY_INCLUDED
22
#define JSON_BINARY_INCLUDED
33

4-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
55

66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -134,10 +134,10 @@
134134
*/
135135

136136
#include "my_global.h"
137-
#include "sql_string.h" // String
138137
#include "binary_log_types.h" // enum_field_types
139138

140139
class Json_dom;
140+
class String;
141141

142142
namespace json_binary
143143
{

sql/json_path.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef SQL_JSON_PATH_INCLUDED
22
#define SQL_JSON_PATH_INCLUDED
33

4-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
55

66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -26,11 +26,11 @@
2626

2727
#include "my_global.h"
2828
#include "prealloced_array.h" // Prealloced_array
29-
#include "sql_string.h" // String
3029

3130
#include <string>
3231

3332
class Json_string;
33+
class String;
3434

3535
enum enum_json_path_leg_type
3636
{

sql/keycaches.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2002, 2016, 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
@@ -16,6 +16,7 @@
1616
#include "keycaches.h"
1717
#include "../mysys/mysys_priv.h"
1818
#include "template_utils.h"
19+
#include "m_string.h"
1920

2021

2122
/****************************************************************************

sql/keycaches.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef KEYCACHES_INCLUDED
22
#define KEYCACHES_INCLUDED
33

4-
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
4+
/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
55

66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -16,10 +16,16 @@
1616
along with this program; if not, write to the Free Software Foundation,
1717
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1818

19+
#include "my_global.h"
20+
1921
#include "sql_list.h"
20-
#include <keycache.h>
22+
#include "keycache.h"
23+
#include "mysql/mysql_lex_string.h"
2124
#include "mysql/service_mysql_alloc.h"
2225

26+
typedef struct st_mysql_lex_string LEX_STRING;
27+
28+
2329
extern "C"
2430
{
2531
extern PSI_memory_key key_memory_NAMED_ILINK_name;

sql/locking_service.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2015, 2016, 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
@@ -16,6 +16,7 @@
1616
#include "locking_service.h"
1717

1818
#include "current_thd.h" // current_thd
19+
#include "error_handler.h" // Internal_error_handler
1920
#include "mdl.h" // MDL_request_list
2021
#include "sql_class.h" // THD
2122

sql/log.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2016, 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
@@ -28,6 +28,7 @@
2828

2929
#include "current_thd.h" // current_thd
3030
#include "derror.h" // ER_DEFAULT
31+
#include "error_handler.h" // Internal_error_handler
3132
#include "mysqld.h" // opt_log_syslog_enable
3233
#include "psi_memory_key.h" // key_memory_File_query_log_name
3334
#include "sql_audit.h" // mysql_audit_general_log

sql/log_event.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
33

44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@
3030
#include "mysql.h" // MYSQL_OPT_MAX_ALLOWED_PACKET
3131
#include "my_decimal.h" // my_decimal
3232
#include "my_time.h" // MAX_DATE_STRING_REP_LENGTH
33+
#include "derror.h" // ER_THD
3334

3435
#ifdef MYSQL_CLIENT
3536
#include "mysqlbinlog.h"

sql/log_event.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2016, 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
@@ -29,6 +29,7 @@
2929
#define _log_event_h
3030

3131
#include "my_global.h"
32+
#include "m_string.h" // native_strncasecmp
3233
#include "my_bitmap.h" // MY_BITMAP
3334
#include "binary_log.h" // binary_log
3435
#include "rpl_utility.h" // Hash_slave_rows

sql/mysqld.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2010, 2016, 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
@@ -19,9 +19,10 @@
1919
#include "my_global.h"
2020
#include "mysql_com.h" // SERVER_VERSION_LENGTH
2121
#include "my_atomic.h" // my_atomic_load32
22+
#include "my_sqlcommand.h" // SQLCOM_END
23+
#include "my_sys.h" // MY_TMPDIR
2224
#include "my_thread.h" // my_thread_attr_t
2325
#include "my_thread_local.h" // my_get_thread_local
24-
#include "sql_cmd.h" // SQLCOM_END
2526
#include "sql_const.h" // UUID_LENGTH
2627
#include "atomic_class.h" /* Atomic_int32 */
2728

0 commit comments

Comments
 (0)