Skip to content

Commit 9bcf287

Browse files
author
Steinar H. Gunderson
committed
Bug#24488219: INCLUDE WHAT YOU USE
Run IWYU on everything under sql/*, except sql/gis/*. (Some manual cleanup was needed.) Change-Id: I46806e50f9d9e43092144d7e454e3fd3d840a83a
1 parent 65c5833 commit 9bcf287

File tree

640 files changed

+3126
-1531
lines changed

Some content is hidden

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

640 files changed

+3126
-1531
lines changed

include/mysql/components/services/psi_mutex_bits.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
Other compilers, like gcc, optimize these dependencies by default.
2929
*/
3030

31+
#include "my_inttypes.h"
3132
#include "my_macros.h"
3233

3334
C_MODE_START

include/mysql/psi/psi_abi_mutex_v1.h.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "my_psi_config.h"
2222
#include "my_sharedlib.h"
2323
#include "mysql/components/services/psi_mutex_bits.h"
24+
#include "my_inttypes.h"
2425
#include "my_macros.h"
2526
typedef unsigned int PSI_mutex_key;
2627
struct PSI_mutex_info_v1

include/mysql/service_security_context.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2015, 2017, 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
@@ -24,6 +24,8 @@
2424
@sa security_context_service_st
2525
*/
2626

27+
#include "mysql/plugin.h"
28+
2729
#ifdef __cplusplus
2830
class Security_context;
2931
/** an opaque class reference hiding the actual security context object. */

include/mysql/services.h.pp

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,118 @@
532532
} *transaction_write_set_service;
533533
Transaction_write_set* get_transaction_write_set(unsigned long m_thread_id);
534534
#include <mysql/service_security_context.h>
535+
#include "mysql/plugin.h"
536+
#include "status_var.h"
537+
enum enum_mysql_show_type
538+
{
539+
SHOW_UNDEF, SHOW_BOOL,
540+
SHOW_INT,
541+
SHOW_LONG,
542+
SHOW_LONGLONG,
543+
SHOW_CHAR, SHOW_CHAR_PTR,
544+
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
545+
};
546+
enum enum_mysql_show_scope
547+
{
548+
SHOW_SCOPE_UNDEF,
549+
SHOW_SCOPE_GLOBAL
550+
};
551+
struct st_mysql_show_var
552+
{
553+
const char *name;
554+
char *value;
555+
enum enum_mysql_show_type type;
556+
enum enum_mysql_show_scope scope;
557+
};
558+
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
559+
typedef void * MYSQL_PLUGIN;
560+
struct st_mysql_xid {
561+
long formatID;
562+
long gtrid_length;
563+
long bqual_length;
564+
char data[128];
565+
};
566+
typedef struct st_mysql_xid MYSQL_XID;
567+
struct st_mysql_sys_var;
568+
struct st_mysql_value;
569+
typedef int (*mysql_var_check_func)(void* thd,
570+
struct st_mysql_sys_var *var,
571+
void *save, struct st_mysql_value *value);
572+
typedef void (*mysql_var_update_func)(void* thd,
573+
struct st_mysql_sys_var *var,
574+
void *var_ptr, const void *save);
575+
struct st_mysql_plugin
576+
{
577+
int type;
578+
void *info;
579+
const char *name;
580+
const char *author;
581+
const char *descr;
582+
int license;
583+
int (*init)(MYSQL_PLUGIN);
584+
int (*check_uninstall)(MYSQL_PLUGIN);
585+
int (*deinit)(MYSQL_PLUGIN);
586+
unsigned int version;
587+
struct st_mysql_show_var *status_vars;
588+
struct st_mysql_sys_var **system_vars;
589+
void * __reserved1;
590+
unsigned long flags;
591+
};
592+
struct st_mysql_daemon
593+
{
594+
int interface_version;
595+
};
596+
struct st_mysql_information_schema
597+
{
598+
int interface_version;
599+
};
600+
struct st_mysql_storage_engine
601+
{
602+
int interface_version;
603+
};
604+
struct handlerton;
605+
struct Mysql_replication {
606+
int interface_version;
607+
};
608+
struct st_mysql_value
609+
{
610+
int (*value_type)(struct st_mysql_value *);
611+
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
612+
int (*val_real)(struct st_mysql_value *, double *realbuf);
613+
int (*val_int)(struct st_mysql_value *, long long *intbuf);
614+
int (*is_unsigned)(struct st_mysql_value *);
615+
};
616+
int thd_in_lock_tables(const void* thd);
617+
int thd_tablespace_op(const void* thd);
618+
long long thd_test_options(const void* thd, long long test_options);
619+
int thd_sql_command(const void* thd);
620+
const char *set_thd_proc_info(void* thd, const char *info,
621+
const char *calling_func,
622+
const char *calling_file,
623+
const unsigned int calling_line);
624+
void **thd_ha_data(const void* thd, const struct handlerton *hton);
625+
void thd_storage_lock_wait(void* thd, long long value);
626+
int thd_tx_isolation(const void* thd);
627+
int thd_tx_is_read_only(const void* thd);
628+
void* thd_tx_arbitrate(void* requestor, void* holder);
629+
int thd_tx_priority(const void* thd);
630+
int thd_tx_is_dd_trx(const void* thd);
631+
char *thd_security_context(void* thd, char *buffer, size_t length,
632+
size_t max_query_len);
633+
void thd_inc_row_count(void* thd);
634+
int thd_allow_batch(void* thd);
635+
void thd_mark_transaction_to_rollback(void* thd, int all);
636+
int mysql_tmpfile(const char *prefix);
637+
int thd_killed(const void* thd);
638+
void thd_set_kill_status(const void* thd);
639+
void thd_binlog_pos(const void* thd,
640+
const char **file_var,
641+
unsigned long long *pos_var);
642+
unsigned long thd_get_thread_id(const void* thd);
643+
void thd_get_xid(const void* thd, MYSQL_XID *xid);
644+
void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
645+
void thd_set_ha_data(void* thd, const struct handlerton *hton,
646+
const void *ha_data);
535647
typedef char my_svc_bool;
536648
extern struct security_context_service_st {
537649
my_svc_bool (*thd_get_security_context)(void*, void* *out_ctx);

plugin/connection_control/security_context_wrapper.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616

17-
#include <sql_class.h> /* THD, Security context */
18-
#include <sql_acl.h> /* SUPER_ACL */
1917
#include <mysql/service_security_context.h> /* Security context service */
18+
#include <sql_acl.h> /* SUPER_ACL */
19+
#include <sql_class.h> /* THD, Security context */
2020

21+
#include "auth_acls.h"
2122
#include "security_context_wrapper.h"
2223

2324
namespace connection_control

plugin/version_token/version_token.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
#include <errmsg.h>
1919
#include <locking_service.h>
2020
#include <m_string.h>
21+
#include <mysql/components/my_service.h>
22+
#include <mysql/components/services/dynamic_privilege.h>
2123
#include <mysql/plugin_audit.h>
2224
#include <mysql/psi/mysql_memory.h>
2325
#include <mysql/psi/mysql_rwlock.h>
2426
#include <mysql/service_locking.h>
25-
#include <mysql/components/my_service.h>
26-
#include <mysql/components/services/dynamic_privilege.h>
2727
#include <sql_class.h>
2828
#include <sys/types.h>
29-
3029
#include <algorithm>
3130
#include <atomic>
3231
#include <sstream>
3332
#include <string>
3433
#include <utility>
3534
#include <vector>
3635

36+
#include "auth_acls.h"
3737
#include "lex_string.h"
3838
#include "map_helpers.h"
3939
#include "my_compiler.h"

sql/abstract_query_plan.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "sql_opt_exec_shared.h"
3232
#include "sql_optimizer.h" // JOIN
3333
#include "table.h"
34-
#include "temp_table_param.h"
34+
#include "thr_malloc.h"
3535

3636
namespace AQP
3737
{

sql/aggregate_check.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,21 @@
3434
#include "my_base.h"
3535
#include "my_dbug.h"
3636
#include "my_sys.h"
37+
#include "mysql/service_my_snprintf.h"
3738
#include "mysqld_error.h"
3839
#include "opt_trace.h"
3940
#include "opt_trace_context.h"
41+
#include "parse_tree_nodes.h"
42+
#include "sql_array.h"
4043
#include "sql_base.h"
4144
#include "sql_class.h"
4245
#include "sql_const.h"
4346
#include "sql_lex.h"
4447
#include "sql_list.h"
48+
#include "sql_parse.h"
4549
#include "table.h"
4650
#include "template_utils.h"
51+
#include "window.h"
4752

4853
/**
4954
@addtogroup AGGREGATE_CHECKS

sql/aggregate_check.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ VE2 are NULL then VE3 must be NULL, which makes the dependency NULL-friendly.
456456
#include "my_dbug.h"
457457
#include "my_inttypes.h"
458458
#include "my_table_map.h"
459+
#include "mysql/udf_registration_types.h"
459460
#include "sql_alloc.h" // Sql_alloc
461+
#include "sql_lex.h"
460462

461463
class Opt_trace_context;
462464
class Opt_trace_object;

sql/auth/auth_common.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,29 @@
1616
#ifndef AUTH_COMMON_INCLUDED
1717
#define AUTH_COMMON_INCLUDED
1818

19-
#include "my_config.h"
20-
19+
#include <mysql/components/my_service.h>
20+
#include <mysql/components/service.h>
21+
#include <mysql/components/services/dynamic_privilege.h>
2122
#include <stddef.h>
2223
#include <sys/types.h>
24+
#include <functional>
2325
#include <set>
2426
#include <utility>
2527
#include <vector>
2628

27-
#include "auth_acls.h" /* ACL information */
29+
#include "dynamic_privileges_impl.h"
2830
#include "lex_string.h"
29-
#include "m_string.h"
3031
#include "my_command.h"
3132
#include "my_dbug.h"
3233
#include "my_inttypes.h"
33-
#include "sql_string.h" /* String */
3434
#include "template_utils.h"
3535
#include "thr_malloc.h"
36-
#include <mysql/components/service.h>
37-
#include <mysql/components/my_service.h>
38-
#include <mysql/components/services/dynamic_privilege.h>
39-
#include "dynamic_privileges_impl.h"
40-
41-
#include <functional>
4236

4337
/* Forward Declarations */
4438
class Alter_info;
4539
class Field_iterator_table_ref;
4640
class LEX_COLUMN;
41+
class String;
4742
class THD;
4843
template <class T> class List;
4944

sql/auth/dynamic_privilege_table.cc

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,39 @@ GNU General Public License for more details.
1212
You should have received a copy of the GNU General Public License
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 */
15-
#include "sql_base.h"
16-
#include "records.h"
17-
#include "auth_internal.h"
15+
#include <string.h>
16+
#include <string>
17+
#include <unordered_map>
18+
1819
#include "auth_common.h"
19-
#include "sql_auth_cache.h"
20-
#include "mysqld_error.h"
20+
#include "auth_internal.h"
2121
#include "current_thd.h"
22-
#include "sql_class.h"
2322
#include "dynamic_privilege_table.h"
24-
#include <string>
23+
#include "field.h"
24+
#include "handler.h"
25+
#include "lex_string.h"
26+
#include "m_ctype.h"
27+
#include "my_base.h"
28+
#include "my_dbug.h"
29+
#include "my_inttypes.h"
30+
#include "my_sys.h"
31+
#include "mysql/components/my_service.h"
32+
#include "mysql/components/service.h"
33+
#include "mysql/components/services/dynamic_privilege.h"
34+
#include "mysql/components/services/registry.h"
35+
#include "mysql/mysql_lex_string.h"
36+
#include "mysql/psi/psi_base.h"
37+
#include "mysql/service_plugin_registry.h"
38+
#include "mysql/udf_registration_types.h"
39+
#include "mysqld_error.h"
40+
#include "records.h"
41+
#include "sql_auth_cache.h"
42+
#include "sql_const.h"
43+
#include "sql_security_ctx.h"
44+
#include "sql_servers.h"
45+
#include "table.h"
46+
47+
class THD;
2548

2649
#define MYSQL_DYNAMIC_PRIV_FIELD_USER 0
2750
#define MYSQL_DYNAMIC_PRIV_FIELD_HOST 1

sql/auth/dynamic_privilege_table.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2016, 2017, 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
@@ -15,13 +15,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515
#ifndef DYNAMIC_PRIVILEGE_TABLE_H
1616
#define DYNAMIC_PRIVILEGE_TABLE_H
1717

18-
#include <string>
19-
#include <unordered_map>
20-
#include <unordered_set>
2118
#include <auth/auth_common.h>
2219
#include <m_string.h>
2320
#include <algorithm>
2421
#include <functional>
22+
#include <string>
23+
#include <unordered_map>
24+
#include <unordered_set>
25+
26+
#include "key.h"
27+
28+
class THD;
29+
struct TABLE;
30+
struct TABLE_LIST;
2531

2632
typedef std::unordered_set<std::string >
2733
Dynamic_privilege_register;

sql/auth/dynamic_privileges_impl.cc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,29 @@ GNU General Public License for more details.
1212
You should have received a copy of the GNU General Public License
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 */
15-
#include <mysql/components/service_implementation.h>
16-
#include <auth/auth_common.h>
1715
#include <auth/dynamic_privilege_table.h>
1816
#include <auth/sql_security_ctx.h>
17+
#include <ctype.h>
1918
#include <mysql/components/my_service.h>
19+
#include <mysql/components/service_implementation.h>
2020
#include <mysql/components/services/dynamic_privilege.h>
21-
#include <stddef.h>
22-
#include "dynamic_privileges_impl.h"
2321
#include <mysql/service_plugin_registry.h>
24-
#include "current_thd.h"
22+
#include <stddef.h>
23+
#include <string>
24+
#include <unordered_map>
25+
#include <utility>
26+
2527
#include "auth/sql_auth_cache.h"
28+
#include "current_thd.h"
29+
#include "dynamic_privileges_impl.h"
30+
#include "m_string.h"
31+
#include "mysql/components/service.h"
32+
#include "mysql/components/services/registry.h"
33+
#include "mysql/psi/psi_base.h"
2634
#include "sql_thd_internal_api.h" // create_thd
2735

36+
class THD;
37+
2838
/**
2939
This helper class is used for either selecting a previous THD or
3040
if it's missing, create a new THD.

0 commit comments

Comments
 (0)