Skip to content

Commit 9f29183

Browse files
committed
Bug#20363277: FIX #INCLUDE DEPENDENCIES IN FIELD.H AND SET_VAR.H
More cleanup of #includes. Make more self-contained, remove unneccesary dependencies.
1 parent 1d25326 commit 9f29183

Some content is hidden

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

58 files changed

+313
-187
lines changed

sql/binlog.cc

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
#include <m_ctype.h> // For is_number
3535
#include <my_stacktrace.h>
3636
#include "mysqld_thd_manager.h" // Global_THD_manager
37+
38+
#include "pfs_file_provider.h"
39+
#include "mysql/psi/mysql_file.h"
40+
3741
#include <pfs_transaction_provider.h>
3842
#include <mysql/psi/mysql_transaction.h>
3943

sql/bootstrap.cc

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "sql_connect.h" // close_connection
2323
#include "sql_parse.h" // mysql_parse
2424

25+
#include "pfs_file_provider.h"
26+
#include "mysql/psi/mysql_file.h"
27+
2528
static MYSQL_FILE *bootstrap_file= NULL;
2629
static int bootstrap_error= 0;
2730

sql/bootstrap.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
#define BOOTSTRAP_H
1818

1919
#include "my_global.h"
20-
#include "my_thread.h"
21-
#include "pfs_file_provider.h"
22-
#include "mysql/psi/mysql_file.h" // MYSQL_FILE
20+
21+
typedef struct st_mysql_file MYSQL_FILE;
2322

2423
/**
2524
Execute all commands from a file. Used by the mysql_install_db script to

sql/datadict.cc

+3-1
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, 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
@@ -17,6 +17,8 @@
1717
#include "sql_class.h"
1818
#include "sql_table.h"
1919

20+
#include "pfs_file_provider.h"
21+
#include "mysql/psi/mysql_file.h"
2022

2123
/**
2224
Check type of .frm if we are not going to parse it.

sql/derror.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 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
@@ -28,6 +28,9 @@
2828
#include "sql_class.h" // THD
2929
#include "log.h"
3030

31+
#include "pfs_file_provider.h"
32+
#include "mysql/psi/mysql_file.h"
33+
3134
static void init_myfunc_errs(void);
3235

3336

sql/des_key_file.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2001, 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,9 @@
1818
#include "log.h" // sql_print_error
1919
#include <m_ctype.h>
2020

21+
#include "pfs_file_provider.h"
22+
#include "mysql/psi/mysql_file.h"
23+
2124
#ifdef HAVE_OPENSSL
2225

2326
struct st_des_keyschedule des_keyschedule[10];

sql/discover.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2004, 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
@@ -27,6 +27,9 @@
2727
#include <my_dir.h>
2828
#include "my_sys.h"
2929

30+
#include "pfs_file_provider.h"
31+
#include "mysql/psi/mysql_file.h"
32+
3033
/**
3134
Read the contents of a .frm file.
3235

sql/event_data_objects.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2005, 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
@@ -13,8 +13,8 @@
1313
along with this program; if not, write to the Free Software
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

16-
#define MYSQL_LEX 1
17-
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
16+
#include "event_data_objects.h"
17+
1818
#include "sql_parse.h" // parse_sql
1919
#include "strfunc.h" // find_string_in_array
2020
#include "sql_db.h" // get_default_db_collation
@@ -25,8 +25,8 @@
2525
#include "auth_common.h" // EVENT_ACL, SUPER_ACL
2626
#include "sp.h" // load_charset, load_collation
2727
#include "events.h"
28-
#include "event_data_objects.h"
2928
#include "event_db_repository.h"
29+
#include "event_parse_data.h"
3030
#include "sp_head.h"
3131
#include "sql_show.h" // append_definer, append_identifier
3232
#include "log.h"

sql/event_data_objects.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,21 @@
2222
@file event_data_objects.h
2323
*/
2424

25-
#include "event_parse_data.h"
26-
#include "thr_lock.h" /* thr_lock_type */
25+
#include "my_global.h"
26+
#include "m_string.h" // LEX_CSTRING
27+
#include "my_alloc.h" // MEM_ROOT
28+
#include "my_time.h" // my_time_t
29+
#include "mysql/mysql_lex_string.h" // LEX_STRING
30+
31+
#include "my_thread.h"
2732

2833
class Field;
2934
class String;
3035
class THD;
3136
class Time_zone;
3237
struct TABLE;
3338
typedef ulonglong sql_mode_t;
39+
typedef struct st_mysql_lex_string LEX_STRING;
3440

3541
void init_scheduler_psi_keys(void);
3642

sql/event_db_repository.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
along with this program; if not, write to the Free Software
1515
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1616

17-
#include "sql_base.h" // close_thread_tables
1817
#include "event_db_repository.h"
18+
19+
#include "sql_base.h" // close_thread_tables
1920
#include "key.h" // key_copy
2021
#include "sql_db.h" // get_default_db_collation
2122
#include "sql_time.h" // interval_type_to_name
@@ -24,6 +25,7 @@
2425
#include "records.h" // init_read_record, end_read_record
2526
#include "sp_head.h"
2627
#include "event_data_objects.h"
28+
#include "event_parse_data.h"
2729
#include "events.h"
2830
#include "sql_show.h"
2931
#include "lock.h" // MYSQL_LOCK_IGNORE_TIMEOUT

sql/event_db_repository.h

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

44
/*
5-
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
5+
Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
66
77
This program is free software; you can redistribute it and/or modify
88
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,14 @@
1818
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21+
#include "my_global.h"
22+
#include "my_time.h" // my_time_t
23+
#include "thr_lock.h" // thr_lock_type
24+
#include "mysql/mysql_lex_string.h" // LEX_STRING
25+
26+
struct TABLE;
2127
struct TABLE_LIST;
28+
typedef struct st_mysql_lex_string LEX_STRING;
2229

2330
/**
2431
@addtogroup Event_Scheduler

sql/event_queue.cc

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1515

1616
#include "event_queue.h"
17+
1718
#include "event_data_objects.h"
1819
#include "event_db_repository.h"
1920
#include "events.h"

sql/event_queue.h

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "my_thread.h" // mysql_mutex_t
3232

3333
#include "event_data_objects.h"
34+
#include "event_parse_data.h"
3435
#include "priority_queue.h"
3536
#include "malloc_allocator.h"
3637

sql/event_scheduler.cc

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
#include "event_scheduler.h"
17+
1718
#include "events.h"
1819
#include "event_data_objects.h"
1920
#include "event_queue.h"

sql/events.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
along with this program; if not, write to the Free Software
1515
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1616

17+
#include "events.h"
18+
1719
#include "sql_parse.h" // check_access
1820
#include "sql_base.h" // close_mysql_tables
1921
#include "sql_show.h" // append_definer
20-
#include "events.h"
2122
#include "sql_db.h" // check_db_dir_existence
2223
#include "sql_table.h" // write_bin_log
2324
#include "tztime.h" // struct Time_zone

sql/events.h

+16-13
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,12 @@
2525
A public interface of Events_Scheduler module.
2626
*/
2727

28-
#ifdef HAVE_PSI_INTERFACE
29-
extern PSI_mutex_key key_event_scheduler_LOCK_scheduler_state;
30-
extern PSI_cond_key key_event_scheduler_COND_state;
31-
extern PSI_thread_key key_thread_event_scheduler, key_thread_event_worker;
32-
#endif /* HAVE_PSI_INTERFACE */
33-
34-
extern PSI_memory_key key_memory_event_basic_root;
35-
36-
/* Always defined, for SHOW PROCESSLIST. */
37-
extern PSI_stage_info stage_waiting_on_empty_queue;
38-
extern PSI_stage_info stage_waiting_for_next_activation;
39-
extern PSI_stage_info stage_waiting_for_scheduler_to_stop;
40-
28+
#include "my_global.h"
4129
#include "mysql/mysql_lex_string.h" // LEX_STRING
4230
#include "my_time.h" /* interval_type */
4331

32+
#include "my_thread.h"
33+
4434
class Event_db_repository;
4535
class Event_parse_data;
4636
class Event_queue;
@@ -52,6 +42,19 @@ class THD;
5242
typedef struct charset_info_st CHARSET_INFO;
5343
typedef struct st_mysql_lex_string LEX_STRING;
5444

45+
#ifdef HAVE_PSI_INTERFACE
46+
extern PSI_mutex_key key_event_scheduler_LOCK_scheduler_state;
47+
extern PSI_cond_key key_event_scheduler_COND_state;
48+
extern PSI_thread_key key_thread_event_scheduler, key_thread_event_worker;
49+
#endif /* HAVE_PSI_INTERFACE */
50+
51+
extern PSI_memory_key key_memory_event_basic_root;
52+
53+
/* Always defined, for SHOW PROCESSLIST. */
54+
extern PSI_stage_info stage_waiting_on_empty_queue;
55+
extern PSI_stage_info stage_waiting_for_next_activation;
56+
extern PSI_stage_info stage_waiting_for_scheduler_to_stop;
57+
5558
int
5659
sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
5760

sql/field.cc

+12-14
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,25 @@
2323
This file implements classes defined in field.h
2424
*/
2525

26-
#include "sql_select.h"
27-
#include "rpl_rli.h" // Pull in Relay_log_info
28-
#include "rpl_slave.h" // Pull in rpl_master_has_bug()
29-
#include "strfunc.h" // find_type2, find_set
30-
#include "sql_time.h" // str_to_datetime_with_warn,
31-
// str_to_time_with_warn,
32-
// TIME_to_timestamp,
33-
// make_time, make_date,
34-
// make_truncated_value_warning
35-
#include "tztime.h" // struct Time_zone
26+
#include "field.h"
27+
3628
#include "filesort.h" // change_double_for_sort
29+
#include "item_timefunc.h" // Item_func_now_local
3730
#include "log_event.h" // class Table_map_log_event
38-
#include <m_ctype.h>
39-
#include <errno.h>
31+
#include "rpl_rli.h" // Relay_log_info
32+
#include "rpl_slave.h" // rpl_master_has_bug
33+
#include "sql_class.h" // THD
4034
#include "sql_join_buffer.h" // CACHE_FIELD
41-
#include "sql_base.h"
42-
#include "item_timefunc.h" // Item_func_now_local
35+
#include "sql_time.h" // str_to_datetime_with_warn
36+
#include "strfunc.h" // find_type2
37+
#include "tztime.h" // Time_zone
38+
39+
#include <algorithm>
4340

4441
using std::max;
4542
using std::min;
4643

44+
4745
// Maximum allowed exponent value for converting string to decimal
4846
#define MAX_EXPONENT 1024
4947

sql/field.h

+19-16
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,23 @@
1616
along with this program; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1818

19-
#include "mysqld.h" /* system_charset_info */
20-
#include "table.h" /* TABLE */
21-
#include "sql_string.h" /* String */
22-
#include "my_decimal.h" /* my_decimal */
23-
#include "sql_error.h" /* Sql_condition */
24-
#include "mysql_version.h" /* FRM_VER */
25-
#include "mysqld_error.h"
26-
#include "binary_log_funcs.h"
27-
#include "my_time.h" /* my_time_binary_length */
28-
#include "my_compare.h" /* portable_sizeof_char_ptr */
19+
#include "my_global.h"
20+
21+
#include "my_compare.h" // portable_sizeof_char_ptr
22+
#include "my_time.h" // MYSQL_TIME_NOTE_TRUNCATED
23+
#include "binary_log_funcs.h" // my_time_binary_length
24+
#include "mysqld.h" // system_charset_info
25+
#include "mysqld_error.h" // ER_*
26+
#include "sql_error.h" // Sql_condition
27+
#include "sql_string.h" // String
28+
#include "table.h" // TABLE
29+
#include "mysql_version.h" // FRM_VER
30+
31+
class Create_field;
32+
class Protocol;
33+
class Relay_log_info;
34+
class Send_field;
35+
2936

3037
/*
3138
@@ -78,12 +85,6 @@ Field (abstract)
7885
*/
7986

8087

81-
class Send_field;
82-
class Protocol;
83-
class Create_field;
84-
class Relay_log_info;
85-
class Field;
86-
8788
enum enum_check_fields
8889
{
8990
CHECK_FIELD_IGNORE,
@@ -167,6 +168,8 @@ enum type_conversion_status
167168
#define my_charset_numeric my_charset_latin1
168169
#define MY_REPERTOIRE_NUMERIC MY_REPERTOIRE_ASCII
169170

171+
#define FRM_VER_TRUE_VARCHAR (FRM_VER+4) /* 10 */
172+
170173
struct st_cache_field;
171174
type_conversion_status field_conv(Field *to,Field *from);
172175

sql/filesort.cc

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
#include "log.h"
3939
#include "item_sum.h" // Item_sum
4040

41+
#include "pfs_file_provider.h"
42+
#include "mysql/psi/mysql_file.h"
43+
4144
#include <algorithm>
4245
#include <utility>
4346
using std::max;

sql/ha_partition.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@
6161
#include "sql_show.h" // append_identifier
6262
#include "sql_admin.h" // SQL_ADMIN_MSG_TEXT_SIZE
6363
#include "myisam.h" // TT_FOR_UPGRADE
64-
6564
#include "debug_sync.h"
6665
#ifndef DBUG_OFF
6766
#include "sql_test.h" // print_where
6867
#endif
6968

69+
#include "pfs_file_provider.h"
70+
#include "mysql/psi/mysql_file.h"
71+
7072
using std::min;
7173
using std::max;
7274

0 commit comments

Comments
 (0)