Skip to content

Commit

Permalink
Bug #26597243: AMBIGUOUS INCLUDE PATHS [noclose, sql/]
Browse files Browse the repository at this point in the history
Clean up more #includes from sql/ that were either missed or deliberately
left out in the last pass.

Change-Id: Ic097ce50a3c0c4ee87d5792502a132ee3d83df99
  • Loading branch information
Steinar H. Gunderson committed Aug 22, 2017
1 parent 4e3a623 commit ec6fada
Show file tree
Hide file tree
Showing 159 changed files with 753 additions and 769 deletions.
2 changes: 0 additions & 2 deletions cmake/plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ MACRO(MYSQL_ADD_PLUGIN)

# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/libbinlogevents/include
${CMAKE_SOURCE_DIR}/sql/auth
${SSL_INCLUDE_DIRS})

LIST(GET ARG_DEFAULT_ARGS 0 plugin)
Expand Down
2 changes: 0 additions & 2 deletions components/mysql_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/libbinlogevents/include
${CMAKE_SOURCE_DIR}/storage/perfschema
${CMAKE_SOURCE_DIR}/sql/auth
)

SET(MYSQL_SERVER_COMPONENT_SOURCES
Expand Down
13 changes: 6 additions & 7 deletions include/mysql/group_replication_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
@file include/mysql/group_replication_priv.h
*/

#include <debug_sync.h>
#include <log_event.h>
#include <replication.h>
#include <rpl_channel_service_interface.h>
#include <rpl_gtid.h>
#include <rpl_write_set_handler.h>

#include "my_sys.h"
#include "my_thread.h"
#include "sql/debug_sync.h"
#include "sql/log_event.h"
#include "sql/replication.h"
#include "sql/rpl_channel_service_interface.h"
#include "sql/rpl_gtid.h"
#include "sql/rpl_write_set_handler.h"


/**
Expand Down
2 changes: 1 addition & 1 deletion plugin/connection_control/connection_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "connection_delay_api.h" /* Constants */
#include "lf.h" /* LF Hash */
#include "my_inttypes.h"
#include "table.h" /* TABLE_LIST */
#include "sql/table.h" /* TABLE_LIST */

namespace connection_control
{
Expand Down
2 changes: 1 addition & 1 deletion plugin/daemon_example/daemon_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "my_sys.h" // my_write, my_malloc
#include "my_thread.h"
#include "mysql/psi/mysql_memory.h"
#include "sql_plugin.h" // st_plugin_int
#include "sql/sql_plugin.h" // st_plugin_int

PSI_memory_key key_memory_mysql_heartbeat_context;

Expand Down
7 changes: 4 additions & 3 deletions plugin/fulltext/mecab_parser/plugin_mecab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#include <fts0tokenize.h>
#include <log.h>
#include "my_config.h"

#include <mecab.h>
#include <string>

#include "my_config.h"
#include "my_dbug.h"
#include "mysqld_error.h"
#include "sql/log.h"
#include "storage/innobase/include/fts0tokenize.h"

/* We are following InnoDB coding guidelines. */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Created 04/12/2011 Jimmy Yang
#include <ctype.h>
#include <mysql_version.h>
#include "plugin.h"
#include "sql_plugin.h"
#include "sql/sql_plugin.h"

/** Configuration info passed to memcached, including
the name of our Memcached InnoDB engine and memcached configure
Expand Down
42 changes: 21 additions & 21 deletions plugin/innodb_memcached/innodb_memcache/src/handler_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ Created 3/14/2011 Jimmy Yang

#include "handler_api.h"

#include <stdlib.h>
#include <ctype.h>
#include <mysql_version.h>
#include <stdlib.h>
#include <mysql/plugin.h>
#include <my_dir.h>
#include "my_thread.h"
#include "my_sys.h"

#include "m_string.h"
#include "sql_plugin.h"
#include "table.h"
#include "sql_class.h"
#include <sql_base.h>
#include "key.h"
#include "lock.h"
#include "transaction.h"
#include "sql_handler.h"
#include "handler.h"
#include "mysqld_thd_manager.h"
#include "current_thd.h"
#include "mysqld.h"

#include "log_event.h"
#include "innodb_config.h"
#include "binlog.h"
#include "my_dir.h"
#include "my_sys.h"
#include "my_thread.h"
#include "mysql_version.h"
#include "plugin/innodb_memcached/innodb_memcache/include/innodb_config.h"
#include "sql/binlog.h"
#include "sql/current_thd.h"
#include "sql/handler.h"
#include "sql/key.h"
#include "sql/lock.h"
#include "sql/log_event.h"
#include "sql/mysqld.h"
#include "sql/mysqld_thd_manager.h"
#include "sql/sql_handler.h"
#include "sql/sql_plugin.h"
#include "sql/table.h"
#include "sql/transaction.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"

/** Some handler functions defined in sql/sql_table.cc and sql/handler.cc etc.
and being used here */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

#include <assert.h>
#include <current_thd.h>
#include <mysql/group_replication_priv.h>
#include <mysql/plugin.h>
#include <mysql/service_my_plugin_log.h>
Expand All @@ -30,6 +29,7 @@

#include "my_dbug.h"
#include "my_inttypes.h"
#include "sql/current_thd.h"

static MYSQL_PLUGIN plugin_info_ptr;

Expand Down
4 changes: 2 additions & 2 deletions plugin/semisync/semisync.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#define SEMISYNC_H

#include <mysql/plugin.h>
#include <replication.h>

#include "log.h" /* sql_print_information */
#include "my_io.h"
#include "my_thread.h"
#include "sql/log.h" /* sql_print_information */
#include "sql/replication.h"

typedef struct st_mysql_show_var SHOW_VAR;
typedef struct st_mysql_sys_var SYS_VAR;
Expand Down
2 changes: 1 addition & 1 deletion plugin/semisync/semisync_master_ack_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "my_inttypes.h"
#include "my_io.h"
#include "my_thread.h"
#include "sql_class.h"
#include "sql/sql_class.h"

struct Slave
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
#include "config.h"
#endif

#include <my_thread.h>
#include <my_sys.h>
#include <my_stacktrace.h>
#include <my_sys.h>
#include <my_thread.h>

/*
We should have a different access to these definitions.
*/
#include "current_thd.h" // current_thd
#include "mysqld.h" // mysql_tmpdir, stage_executing
#include "sql/current_thd.h" // current_thd
#include "sql/mysqld.h" // mysql_tmpdir, stage_executing

#endif /* PLUGIN_SERVER_INCLUDE */
6 changes: 4 additions & 2 deletions rapid/plugin/x/src/mysql_variables.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand All @@ -18,8 +18,10 @@
*/

#include "mysql_variables.h"

#include <mysql/plugin.h>
#include "mysqld.h"

#include "sql/mysqld.h"

namespace mysqld
{
Expand Down
2 changes: 1 addition & 1 deletion rapid/plugin/x/src/xpl_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "cap_handles_expired_passwords.h"
// needed for ip_to_hostname(), should probably be turned into a service
#include "hostname.h"
#include "my_inttypes.h"
#include "mysql_show_variable_wrapper.h"
#include "mysql_variables.h"
Expand All @@ -33,6 +32,7 @@
#include "ngs/capabilities/handler_readonly_value.h"
#include "ngs/thread.h"
#include "ngs_common/string_formatter.h"
#include "sql/hostname.h"
#include "xpl_server.h"
#include "xpl_session.h"

Expand Down
4 changes: 2 additions & 2 deletions scripts/comp_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <stdlib.h>

#include "../include/my_compiler.h"
#include "../sql/sql_bootstrap.h"
/*
This is an internal tool used during the build process only,
- do not make a library just for this,
Expand All @@ -34,7 +33,8 @@
- do not duplicate the code either.
so just add the sql_bootstrap.cc code as is.
*/
#include "../sql/sql_bootstrap.cc"
#include "sql/sql_bootstrap.cc"
#include "sql/sql_bootstrap.h"

FILE *in;
FILE *out;
Expand Down
1 change: 0 additions & 1 deletion sql/auth/dynamic_privilege_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysql/service_plugin_registry.h"
#include "mysql/udf_registration_types.h"
#include "mysqld_error.h"
#include "records.h"
#include "sql/auth/auth_common.h"
#include "sql/auth/auth_internal.h"
#include "sql/auth/sql_auth_cache.h"
Expand Down
11 changes: 5 additions & 6 deletions sql/auth/i_sha2_password.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef I_SHA2_PASSWORD_INCLUDED
#define I_SHA2_PASSWORD_INCLUDED

#include "i_sha2_password_common.h"

#include "mysql/psi/mysql_rwlock.h" /* mysql_rwlock_t */
#include "mysql/plugin.h" /* MYSQL_PLUGIN */
#include "crypt_genhash_impl.h" /* For salt, sha2 digest */

#include <string>
#include <unordered_map>

#include "crypt_genhash_impl.h" /* For salt, sha2 digest */
#include "mysql/plugin.h" /* MYSQL_PLUGIN */
#include "mysql/psi/mysql_rwlock.h" /* mysql_rwlock_t */
#include "sql/auth/i_sha2_password_common.h"

/**
@file sql/auth/i_sha2_password.h
Classes for caching_sha2_authentication plugin
Expand Down
25 changes: 13 additions & 12 deletions sql/auth/sha2_password.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#include "i_sha2_password.h" /* Internal classes */
#include "auth_internal.h" /* Rsa_authentication_keys */
#include "sql_auth_cache.h" /* ACL_USER */
#include "sql_authentication.h"
#include "my_inttypes.h" /* typedefs */
#include <iomanip> /* std::setfill(), std::setw() */
#include <iostream> /* For debugging */
/* my_validate_password_policy */
#include <sstream> /* std::stringstream */

#include "my_dbug.h" /* DBUG instrumentation */
#include "mysql/plugin_auth_common.h" /* MYSQL_PLUGIN_VIO */
#include "my_inttypes.h" /* typedefs */
#include "mysql/plugin_auth.h" /* MYSQL_SERVER_AUTH_INFO */
#include "mysql/plugin_auth_common.h" /* MYSQL_PLUGIN_VIO */
#include "mysql/service_my_plugin_log.h"/* plugin_log_level */
#include "mysql/service_mysql_password_policy.h"
/* my_validate_password_policy */
#include <sstream> /* std::stringstream */
#include <iomanip> /* std::setfill(), std::setw() */
#include <iostream> /* For debugging */
#include <sql/sql_const.h> /* MAX_FIELD_WIDTH */
#include <sql/protocol_classic.h> /* Protocol_classic */
#include "rwlock_scoped_lock.h" /* rwlock_scoped_lock */
#include "sql/auth/auth_internal.h" /* Rsa_authentication_keys */
#include "sql/auth/i_sha2_password.h" /* Internal classes */
#include "sql/auth/sql_auth_cache.h" /* ACL_USER */
#include "sql/auth/sql_authentication.h"
#include "sql/protocol_classic.h" /* Protocol_classic */
#include "sql/sql_const.h" /* MAX_FIELD_WIDTH */

#if defined(HAVE_YASSL)
#include <openssl/ssl.h>
Expand Down
9 changes: 5 additions & 4 deletions sql/auth/sha2_password_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#include "i_sha2_password.h" /* Internal classes */
#include "mysql_com.h" /* generate_sha256_scramble */
#include "sha2_password_common.h" /* validate_sha256_scramble */
#include "my_inttypes.h" /* typedefs */
#include "sql/auth/sha2_password_common.h" /* validate_sha256_scramble */

#include "my_dbug.h" /* DBUG instrumentation */
#include "my_inttypes.h" /* typedefs */
#include "mysql_com.h" /* generate_sha256_scramble */
#include "sql/auth/i_sha2_password.h" /* Internal classes */

namespace sha2_password
{
Expand Down
2 changes: 1 addition & 1 deletion sql/auth/sql_user.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ bool mysql_show_create_user(THD *thd, LEX_USER *user_name)
}


#include "tztime.h" // Time_zone
#include "sql/tztime.h" // Time_zone

/**
Perform credentials history check and update the password history table
Expand Down
8 changes: 4 additions & 4 deletions sql/conn_handler/named_pipe_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include "violite.h" // Vio
#include "channel_info.h" // Channel_info
#include "connection_handler_manager.h" // Connection_handler_manager
#include "log.h"
#include "mysqld.h" // global_system_variables
#include "named_pipe.h" // create_server_named_pipe.
#include "sql_class.h" // THD
#include "init_net_server_extension.h" // init_net_server_extension
#include "sql/log.h"
#include "sql/mysqld.h" // global_system_variables
#include "sql/named_pipe.h" // create_server_named_pipe.
#include "sql/sql_class.h" // THD


///////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions sql/conn_handler/shared_memory_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

#include <errno.h>

#include "violite.h" // Vio
#include "channel_info.h" // Channel_info
#include "connection_handler_manager.h" // Connection_handler_manager
#include "log.h"
#include "mysqld.h" // connection_events_loop_aborted
#include "my_shm_defaults.h"
#include "sql_class.h" // THD
#include "psi_memory_key.h"
#include "sql/log.h"
#include "sql/mysqld.h" // connection_events_loop_aborted
#include "sql/psi_memory_key.h"
#include "sql/sql_class.h" // THD
#include "violite.h" // Vio

///////////////////////////////////////////////////////////////////////////
// Channel_info_shared_mem implementation
Expand Down
2 changes: 1 addition & 1 deletion sql/dd/dd_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#include "dd_event.h"
#include "sql/dd/dd_event.h"

#include <memory>
#include <string>
Expand Down
Loading

0 comments on commit ec6fada

Please sign in to comment.