summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2017-06-18 06:42:16 +0300
committerSergei Golubchik <serg@mariadb.org>2017-08-24 01:05:44 +0200
commit4aaa38d26ed95127b8424100c8a14c77af15fc11 (patch)
treefd96b83db1e58971f25b7a27239b07cdca0f0793
parentb0da8897b08b0717ccae418f880b5ab0f5960312 (diff)
downloadmariadb-git-4aaa38d26ed95127b8424100c8a14c77af15fc11.tar.gz
Enusure that my_global.h is included first
- Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
-rw-r--r--include/hash.h1
-rw-r--r--include/m_ctype.h1
-rw-r--r--include/m_string.h1
-rw-r--r--include/my_base.h1
-rw-r--r--include/my_bit.h2
-rw-r--r--include/my_compiler.h2
-rw-r--r--include/my_dir.h2
-rw-r--r--include/my_net.h2
-rw-r--r--include/my_pthread.h2
-rw-r--r--include/my_stacktrace.h2
-rw-r--r--include/my_sys.h2
-rw-r--r--include/my_time.h1
-rw-r--r--include/my_user.h2
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/password.h2
-rw-r--r--include/queues.h2
-rw-r--r--include/waiting_threads.h1
-rw-r--r--include/wqueue.h1
-rw-r--r--libmysqld/emb_qcache.cc2
-rw-r--r--mysys/my_basename.c1
-rw-r--r--mysys/waiting_threads.c1
-rw-r--r--mysys/wqueue.c1
-rw-r--r--plugin/auth_gssapi/client_plugin.cc5
-rw-r--r--plugin/auth_gssapi/gssapi_client.cc3
-rw-r--r--plugin/auth_gssapi/gssapi_errmsg.cc2
-rw-r--r--plugin/auth_gssapi/gssapi_server.cc3
-rw-r--r--plugin/auth_gssapi/server_plugin.cc1
-rw-r--r--plugin/auth_gssapi/sspi_client.cc5
-rw-r--r--plugin/auth_gssapi/sspi_errmsg.cc3
-rw-r--r--plugin/auth_gssapi/sspi_server.cc1
-rw-r--r--plugin/cracklib_password_check/cracklib_password_check.c2
-rw-r--r--plugin/feedback/feedback.h1
-rw-r--r--plugin/file_key_management/parser.cc1
-rw-r--r--plugin/handler_socket/handlersocket/database.cpp5
-rw-r--r--plugin/handler_socket/handlersocket/handlersocket.cpp3
-rw-r--r--plugin/handler_socket/handlersocket/hstcpsvr.cpp6
-rw-r--r--plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp4
-rw-r--r--plugin/handler_socket/handlersocket/mysql_incl.hpp3
-rw-r--r--plugin/handler_socket/libhsclient/auto_addrinfo.hpp3
-rw-r--r--plugin/handler_socket/libhsclient/hstcpcli.cpp3
-rw-r--r--plugin/handler_socket/libhsclient/socket.cpp5
-rw-r--r--plugin/locale_info/locale_info.cc1
-rw-r--r--plugin/metadata_lock_info/metadata_lock_info.cc2
-rw-r--r--plugin/query_response_time/plugin.cc1
-rw-r--r--plugin/semisync/semisync.cc1
-rw-r--r--plugin/semisync/semisync_master.cc1
-rw-r--r--plugin/semisync/semisync_master_plugin.cc1
-rw-r--r--plugin/semisync/semisync_slave.cc1
-rw-r--r--plugin/semisync/semisync_slave_plugin.cc1
-rw-r--r--plugin/server_audit/server_audit.c8
-rw-r--r--plugin/server_audit/test_audit_v4.c1
-rw-r--r--plugin/simple_password_check/simple_password_check.c1
-rw-r--r--plugin/user_variables/user_variables.cc1
-rw-r--r--plugin/userstat/userstat.cc2
-rw-r--r--plugin/wsrep_info/plugin.cc2
-rw-r--r--sql-common/my_time.c1
-rw-r--r--sql-common/my_user.c1
-rw-r--r--sql/bounded_queue.h3
-rw-r--r--sql/compat56.cc2
-rw-r--r--sql/create_options.cc1
-rw-r--r--sql/datadict.cc2
-rw-r--r--sql/debug_sync.cc2
-rw-r--r--sql/debug_sync.h2
-rw-r--r--sql/derror.cc2
-rw-r--r--sql/derror.h2
-rw-r--r--sql/des_key_file.cc2
-rw-r--r--sql/discover.cc2
-rw-r--r--sql/discover.h2
-rw-r--r--sql/encryption.cc2
-rw-r--r--sql/event_data_objects.cc2
-rw-r--r--sql/event_db_repository.cc2
-rw-r--r--sql/event_parse_data.cc2
-rw-r--r--sql/event_queue.cc2
-rw-r--r--sql/event_scheduler.cc2
-rw-r--r--sql/events.cc2
-rw-r--r--sql/field.cc2
-rw-r--r--sql/field_conv.cc2
-rw-r--r--sql/filesort.cc2
-rw-r--r--sql/filesort_utils.cc2
-rw-r--r--sql/filesort_utils.h1
-rw-r--r--sql/gcalc_slicescan.cc2
-rw-r--r--sql/gcalc_tools.cc2
-rw-r--r--sql/gen_lex_hash.cc4
-rw-r--r--sql/gen_lex_token.cc4
-rw-r--r--sql/group_by_handler.cc1
-rw-r--r--sql/gstream.cc2
-rw-r--r--sql/gstream.h3
-rw-r--r--sql/ha_partition.cc2
-rw-r--r--sql/ha_sequence.cc2
-rw-r--r--sql/handler.cc2
-rw-r--r--sql/handler.h1
-rw-r--r--sql/hash_filo.cc2
-rw-r--r--sql/hostname.cc2
-rw-r--r--sql/hostname.h1
-rw-r--r--sql/init.cc3
-rw-r--r--sql/init.h2
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_buff.cc2
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/item_create.cc2
-rw-r--r--sql/item_geofunc.cc2
-rw-r--r--sql/item_inetfunc.cc2
-rw-r--r--sql/item_jsonfunc.cc2
-rw-r--r--sql/item_row.cc2
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/item_sum.cc2
-rw-r--r--sql/item_timefunc.cc2
-rw-r--r--sql/item_windowfunc.cc3
-rw-r--r--sql/item_windowfunc.h1
-rw-r--r--sql/item_xmlfunc.cc2
-rw-r--r--sql/key.cc2
-rw-r--r--sql/key.h2
-rw-r--r--sql/keycaches.cc1
-rw-r--r--sql/lock.cc2
-rw-r--r--sql/log.cc4
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/log_event_old.cc2
-rw-r--r--sql/mariadb.h30
-rw-r--r--sql/mdl.cc1
-rw-r--r--sql/mf_iocache.cc2
-rw-r--r--sql/multi_range_read.cc1
-rw-r--r--sql/my_apc.cc1
-rw-r--r--sql/my_decimal.cc2
-rw-r--r--sql/my_json_writer.cc2
-rw-r--r--sql/mysql_install_db.cc3
-rw-r--r--sql/mysql_upgrade_service.cc4
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/mysqld.h1
-rw-r--r--sql/net_serv.cc2
-rw-r--r--sql/opt_index_cond_pushdown.cc1
-rw-r--r--sql/opt_range.cc2
-rw-r--r--sql/opt_subselect.cc2
-rw-r--r--sql/opt_sum.cc2
-rw-r--r--sql/opt_table_elimination.cc1
-rw-r--r--sql/parse_file.cc3
-rw-r--r--sql/parse_file.h1
-rw-r--r--sql/partition_info.cc2
-rw-r--r--sql/password.c2
-rw-r--r--sql/procedure.cc2
-rw-r--r--sql/protocol.cc2
-rw-r--r--sql/records.cc2
-rw-r--r--sql/repl_failsafe.cc2
-rw-r--r--sql/repl_failsafe.h2
-rw-r--r--sql/rpl_filter.cc2
-rw-r--r--sql/rpl_gtid.cc5
-rw-r--r--sql/rpl_handler.cc2
-rw-r--r--sql/rpl_injector.cc2
-rw-r--r--sql/rpl_injector.h1
-rw-r--r--sql/rpl_mi.cc2
-rw-r--r--sql/rpl_mi.h2
-rw-r--r--sql/rpl_parallel.cc2
-rw-r--r--sql/rpl_record.cc2
-rw-r--r--sql/rpl_record.h1
-rw-r--r--sql/rpl_record_old.cc2
-rw-r--r--sql/rpl_reporting.cc2
-rw-r--r--sql/rpl_reporting.h2
-rw-r--r--sql/rpl_rli.cc2
-rw-r--r--sql/rpl_tblmap.cc2
-rw-r--r--sql/rpl_utility.cc2
-rw-r--r--sql/scheduler.cc1
-rw-r--r--sql/scheduler.h2
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/signal_handler.cc2
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sp.cc2
-rw-r--r--sql/sp_cache.cc2
-rw-r--r--sql/sp_cache.h2
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/sp_head.h1
-rw-r--r--sql/sp_pcontext.cc2
-rw-r--r--sql/sp_rcontext.cc2
-rw-r--r--sql/spatial.cc2
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_acl.h1
-rw-r--r--sql/sql_admin.cc3
-rw-r--r--sql/sql_alter.cc1
-rw-r--r--sql/sql_analyse.cc2
-rw-r--r--sql/sql_analyze_stmt.cc2
-rw-r--r--sql/sql_audit.cc2
-rw-r--r--sql/sql_audit.h2
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_binlog.cc2
-rw-r--r--sql/sql_bootstrap.cc2
-rw-r--r--sql/sql_cache.cc2
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_client.cc2
-rw-r--r--sql/sql_connect.cc2
-rw-r--r--sql/sql_connect.h2
-rw-r--r--sql/sql_crypt.cc2
-rw-r--r--sql/sql_cte.cc1
-rw-r--r--sql/sql_cursor.cc2
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_delete.cc2
-rw-r--r--sql/sql_derived.cc2
-rw-r--r--sql/sql_digest.cc7
-rw-r--r--sql/sql_do.cc2
-rw-r--r--sql/sql_error.cc2
-rw-r--r--sql/sql_explain.cc2
-rw-r--r--sql/sql_expression_cache.cc2
-rw-r--r--sql/sql_get_diagnostics.cc1
-rw-r--r--sql/sql_handler.cc2
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_hset.h1
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_join_cache.cc1
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/sql_lex.h1
-rw-r--r--sql/sql_list.cc1
-rw-r--r--sql/sql_list.h2
-rw-r--r--sql/sql_load.cc2
-rw-r--r--sql/sql_locale.cc3
-rw-r--r--sql/sql_locale.h1
-rw-r--r--sql/sql_manager.cc2
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_parse.h1
-rw-r--r--sql/sql_partition.cc2
-rw-r--r--sql/sql_partition_admin.cc1
-rw-r--r--sql/sql_plist.h2
-rw-r--r--sql/sql_plugin.cc4
-rw-r--r--sql/sql_plugin.h2
-rw-r--r--sql/sql_prepare.cc2
-rw-r--r--sql/sql_profile.cc3
-rw-r--r--sql/sql_reload.cc2
-rw-r--r--sql/sql_rename.cc2
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_sequence.cc1
-rw-r--r--sql/sql_servers.cc2
-rw-r--r--sql/sql_servers.h1
-rw-r--r--sql/sql_show.cc2
-rw-r--r--sql/sql_signal.cc2
-rw-r--r--sql/sql_sort.h2
-rw-r--r--sql/sql_state.c2
-rw-r--r--sql/sql_statistics.cc2
-rw-r--r--sql/sql_string.cc3
-rw-r--r--sql/sql_string.h2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_table.h3
-rw-r--r--sql/sql_tablespace.cc2
-rw-r--r--sql/sql_test.cc2
-rw-r--r--sql/sql_time.cc2
-rw-r--r--sql/sql_time.h1
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_truncate.cc1
-rw-r--r--sql/sql_type.cc1
-rw-r--r--sql/sql_udf.cc2
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_union.h2
-rw-r--r--sql/sql_update.cc2
-rw-r--r--sql/sql_view.cc2
-rw-r--r--sql/sql_window.cc2
-rw-r--r--sql/sql_window.h1
-rw-r--r--sql/sql_yacc.yy2
-rw-r--r--sql/sql_yacc_ora.yy2
-rw-r--r--sql/strfunc.cc2
-rw-r--r--sql/strfunc.h2
-rw-r--r--sql/sys_vars.cc2
-rw-r--r--sql/table.cc2
-rw-r--r--sql/table.h1
-rw-r--r--sql/table_cache.cc2
-rw-r--r--sql/temporary_tables.cc1
-rw-r--r--sql/thr_malloc.cc2
-rw-r--r--sql/thr_malloc.h2
-rw-r--r--sql/threadpool_common.cc2
-rw-r--r--sql/threadpool_generic.cc2
-rw-r--r--sql/threadpool_win.cc2
-rw-r--r--sql/transaction.cc2
-rw-r--r--sql/transaction.h1
-rw-r--r--sql/tztime.cc5
-rw-r--r--sql/udf_example.c2
-rw-r--r--sql/uniques.cc2
-rw-r--r--sql/unireg.cc2
-rw-r--r--sql/wsrep_applier.cc1
-rw-r--r--sql/wsrep_binlog.cc1
-rw-r--r--sql/wsrep_check_opts.cc1
-rw-r--r--sql/wsrep_dummy.cc2
-rw-r--r--sql/wsrep_hton.cc1
-rw-r--r--sql/wsrep_mysqld.cc1
-rw-r--r--sql/wsrep_notify.cc1
-rw-r--r--sql/wsrep_sst.cc3
-rw-r--r--sql/wsrep_thd.cc2
-rw-r--r--sql/wsrep_utils.cc1
-rw-r--r--sql/wsrep_xid.cc1
-rw-r--r--storage/archive/ha_archive.cc3
-rw-r--r--storage/connect/connect.cc1
-rw-r--r--storage/connect/ha_connect.cc1
-rw-r--r--storage/connect/mycat.cc8
-rw-r--r--storage/connect/user_connect.cc1
-rw-r--r--storage/heap/ha_heap.cc3
-rw-r--r--storage/heap/heapdef.h3
-rw-r--r--storage/innobase/log/log0crypt.cc1
-rw-r--r--storage/innobase/row/row0merge.cc2
-rw-r--r--storage/maria/ma_crypt.c1
-rw-r--r--storage/maria/ma_crypt.h2
-rw-r--r--storage/maria/ma_sp_test.c1
-rw-r--r--storage/maria/maria_def.h1
-rw-r--r--storage/mroonga/mrn_mysql.h2
-rw-r--r--storage/myisam/ftdefs.h2
-rw-r--r--storage/myisam/ha_myisam.cc3
-rw-r--r--storage/myisam/mi_cache.c1
-rw-r--r--storage/myisam/mi_check.c1
-rw-r--r--storage/myisam/mi_rnext.c1
-rw-r--r--storage/myisam/mi_test1.c1
-rw-r--r--storage/myisam/mi_test3.c1
-rw-r--r--storage/myisam/myisamdef.h1
-rw-r--r--storage/myisam/rt_test.c1
-rw-r--r--storage/myisam/sp_test.c1
-rw-r--r--storage/oqgraph/ha_oqgraph.cc2
-rw-r--r--storage/oqgraph/oqgraph_thunk.cc18
-rw-r--r--storage/perfschema/pfs.h1
-rw-r--r--storage/perfschema/pfs_defaults.cc1
-rw-r--r--storage/perfschema/pfs_global.cc1
-rw-r--r--storage/perfschema/pfs_global.h1
-rw-r--r--storage/perfschema/pfs_instr.h2
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.cc1
-rw-r--r--storage/perfschema/table_session_connect.cc1
-rw-r--r--storage/perfschema/table_session_connect_attrs.cc1
-rw-r--r--storage/rocksdb/event_listener.cc3
-rw-r--r--storage/rocksdb/ha_rocksdb.cc2
-rw-r--r--storage/rocksdb/properties_collector.cc4
-rw-r--r--storage/rocksdb/rdb_cf_manager.cc2
-rw-r--r--storage/rocksdb/rdb_cf_options.cc2
-rw-r--r--storage/rocksdb/rdb_datadic.cc2
-rw-r--r--storage/rocksdb/rdb_i_s.cc2
-rw-r--r--storage/rocksdb/rdb_index_merge.cc2
-rw-r--r--storage/rocksdb/rdb_mariadb_server_port.cc3
-rw-r--r--storage/rocksdb/rdb_mutex_wrapper.cc2
-rw-r--r--storage/rocksdb/rdb_perf_context.cc2
-rw-r--r--storage/rocksdb/rdb_sst_info.cc2
-rw-r--r--storage/rocksdb/rdb_threads.cc2
-rw-r--r--storage/rocksdb/rdb_utils.cc2
-rw-r--r--storage/rocksdb/tools/mysql_ldb.cc2
-rw-r--r--storage/sphinx/ha_sphinx.cc1
-rw-r--r--storage/sphinx/snippets_udf.cc3
-rw-r--r--storage/spider/ha_spider.cc1
-rw-r--r--storage/spider/spd_conn.cc1
-rw-r--r--storage/spider/spd_copy_tables.cc1
-rw-r--r--storage/spider/spd_db_conn.cc1
-rw-r--r--storage/spider/spd_db_handlersocket.cc1
-rw-r--r--storage/spider/spd_db_mysql.cc1
-rw-r--r--storage/spider/spd_db_oracle.cc1
-rw-r--r--storage/spider/spd_direct_sql.cc1
-rw-r--r--storage/spider/spd_i_s.cc1
-rw-r--r--storage/spider/spd_malloc.cc1
-rw-r--r--storage/spider/spd_param.cc2
-rw-r--r--storage/spider/spd_ping_table.cc1
-rw-r--r--storage/spider/spd_sys_table.cc1
-rw-r--r--storage/spider/spd_table.cc1
-rw-r--r--storage/spider/spd_trx.cc1
-rw-r--r--storage/test_sql_discovery/test_sql_discovery.cc1
-rw-r--r--storage/tokudb/hatoku_defines.h2
-rw-r--r--strings/json_lib.c2
-rw-r--r--unittest/mysys/dynstring-t.c2
-rw-r--r--unittest/sql/mf_iocache-t.cc1
356 files changed, 361 insertions, 362 deletions
diff --git a/include/hash.h b/include/hash.h
index 892922d81a3..75ad0b6d9a0 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -19,7 +19,6 @@
#ifndef _hash_h
#define _hash_h
-#include "my_global.h" /* uchar */
#include "my_sys.h" /* DYNAMIC_ARRAY */
/*
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 04a82953f0a..b78443f88f8 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -21,7 +21,6 @@
#define _m_ctype_h
#include <my_attribute.h>
-#include "my_global.h" /* uint16, uchar */
enum loglevel {
ERROR_LEVEL= 0,
diff --git a/include/m_string.h b/include/m_string.h
index f06acbea358..c50d37a361b 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -22,7 +22,6 @@
#ifndef _m_string_h
#define _m_string_h
-#include "my_global.h" /* HAVE_* */
#include "my_decimal_limits.h"
#ifndef __USE_GNU
diff --git a/include/my_base.h b/include/my_base.h
index 57b16ad985b..b93300d7562 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -20,7 +20,6 @@
#ifndef _my_base_h
#define _my_base_h
-#include <my_global.h>
#include <my_dir.h> /* This includes types */
#include <my_sys.h>
#include <m_string.h>
diff --git a/include/my_bit.h b/include/my_bit.h
index 0afeffff918..221e7d274ea 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -17,8 +17,6 @@
#ifndef MY_BIT_INCLUDED
#define MY_BIT_INCLUDED
-#include <my_global.h>
-
/*
Some useful bit functions
*/
diff --git a/include/my_compiler.h b/include/my_compiler.h
index 000d4e42848..833eedbf7c4 100644
--- a/include/my_compiler.h
+++ b/include/my_compiler.h
@@ -24,8 +24,6 @@
specific to a target compiler.
*/
-#include <my_global.h> /* stddef.h offsetof */
-
/**
Compiler-dependent internal convenience macros.
*/
diff --git a/include/my_dir.h b/include/my_dir.h
index 949a9a4d354..a1a03ffe1d2 100644
--- a/include/my_dir.h
+++ b/include/my_dir.h
@@ -16,8 +16,6 @@
#ifndef MY_DIR_H
#define MY_DIR_H
-#include "my_global.h"
-
#include <sys/stat.h>
#ifdef __cplusplus
diff --git a/include/my_net.h b/include/my_net.h
index 91d780a276d..222abdb2f37 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -22,8 +22,6 @@
#ifndef _my_net_h
#define _my_net_h
-#include "my_global.h" /* C_MODE_START, C_MODE_END */
-
C_MODE_START
#include <errno.h>
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 672bca5ab39..037ac0a062f 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -19,8 +19,6 @@
#ifndef _my_pthread_h
#define _my_pthread_h
-#include "my_global.h" /* myf */
-
#ifndef ETIME
#define ETIME ETIMEDOUT /* For FreeBSD */
#endif
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index fad6e532de9..f5eeffbd969 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -17,8 +17,6 @@
#ifndef _my_stacktrace_h_
#define _my_stacktrace_h_
-#include <my_global.h>
-
#ifdef TARGET_OS_LINUX
#if defined (__x86_64__) || defined (__i386__) || \
(defined(__alpha__) && defined(__GNUC__))
diff --git a/include/my_sys.h b/include/my_sys.h
index fb3e15b64a4..afe50d9a67c 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -17,8 +17,6 @@
#ifndef _my_sys_h
#define _my_sys_h
-#include "my_global.h" /* C_MODE_START, C_MODE_END */
-
#include <m_string.h>
C_MODE_START
diff --git a/include/my_time.h b/include/my_time.h
index 02e8f32ee23..1e99b14421d 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -22,7 +22,6 @@
#ifndef _my_time_h_
#define _my_time_h_
-#include "my_global.h"
#include "mysql_time.h"
#include "my_decimal_limits.h"
diff --git a/include/my_user.h b/include/my_user.h
index 404996e996c..6d4cd3ab4bd 100644
--- a/include/my_user.h
+++ b/include/my_user.h
@@ -22,8 +22,6 @@
#ifndef _my_user_h_
#define _my_user_h_
-#include <my_global.h>
-
C_MODE_START
int parse_user(const char *user_id_str, size_t user_id_len,
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index be9d7116b9b..801c26086f5 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -16,8 +16,6 @@
#ifndef MYSQL_FILE_H
#define MYSQL_FILE_H
-#include <my_global.h>
-
/* For strlen() */
#include <string.h>
/* For MY_STAT */
diff --git a/include/password.h b/include/password.h
index 082f917e7c0..1abd014ceb4 100644
--- a/include/password.h
+++ b/include/password.h
@@ -16,8 +16,6 @@
#ifndef PASSWORD_INCLUDED
#define PASSWORD_INCLUDED
-#include "my_global.h"
-
C_MODE_START
void my_make_scrambled_password_323(char *to, const char *password,
diff --git a/include/queues.h b/include/queues.h
index f341bbb8148..09c096311a3 100644
--- a/include/queues.h
+++ b/include/queues.h
@@ -31,8 +31,6 @@
#ifndef _queues_h
#define _queues_h
-#include "my_global.h" /* uchar */
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/include/waiting_threads.h b/include/waiting_threads.h
index cd4db35701c..0145f68837a 100644
--- a/include/waiting_threads.h
+++ b/include/waiting_threads.h
@@ -16,7 +16,6 @@
#ifndef _waiting_threads_h
#define _waiting_threads_h
-#include <my_global.h>
#include <my_sys.h>
#include <lf.h>
diff --git a/include/wqueue.h b/include/wqueue.h
index 69cb715a97d..119416abe4a 100644
--- a/include/wqueue.h
+++ b/include/wqueue.h
@@ -18,7 +18,6 @@
#ifndef WQUEUE_INCLUDED
#define WQUEUE_INCLUDED
-#include <my_global.h>
#include <my_pthread.h>
/* info about requests in a waiting queue */
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index 429b16b2dee..78620f5d940 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -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 "my_global.h" // HAVE_*
+#include "mariadb.h"
#include "sql_priv.h"
#ifdef HAVE_QUERY_CACHE
diff --git a/mysys/my_basename.c b/mysys/my_basename.c
index 9d1eaf53efa..4a1de782863 100644
--- a/mysys/my_basename.c
+++ b/mysys/my_basename.c
@@ -13,6 +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 <my_global.h>
#include <my_sys.h>
/**
@brief retrieve last component of the filename.
diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c
index 2549bd8a587..df208507590 100644
--- a/mysys/waiting_threads.c
+++ b/mysys/waiting_threads.c
@@ -172,6 +172,7 @@
!! thread4 should not wait for thread2.
*/
+#include <my_global.h>
#include <waiting_threads.h>
#include <m_string.h>
diff --git a/mysys/wqueue.c b/mysys/wqueue.c
index 1dafc03b935..d4f699fd9bc 100644
--- a/mysys/wqueue.c
+++ b/mysys/wqueue.c
@@ -15,6 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include <my_global.h>
#include <wqueue.h>
#define STRUCT_PTR(TYPE, MEMBER, a) \
diff --git a/plugin/auth_gssapi/client_plugin.cc b/plugin/auth_gssapi/client_plugin.cc
index 0ab619a08e6..032300b5537 100644
--- a/plugin/auth_gssapi/client_plugin.cc
+++ b/plugin/auth_gssapi/client_plugin.cc
@@ -31,13 +31,12 @@ POSSIBILITY OF SUCH DAMAGE.
GSSAPI authentication plugin, client side
*/
-#include <string.h>
-#include <stdarg.h>
+#include <my_global.h>
#include <mysqld_error.h>
#include <mysql/client_plugin.h>
#include <mysql.h>
-#include <stdio.h>
#include "common.h"
+#include <string.h>
extern int auth_client(char *principal_name,
char *mech,
diff --git a/plugin/auth_gssapi/gssapi_client.cc b/plugin/auth_gssapi/gssapi_client.cc
index a05ea158e4d..05ce62a31a3 100644
--- a/plugin/auth_gssapi/gssapi_client.cc
+++ b/plugin/auth_gssapi/gssapi_client.cc
@@ -26,9 +26,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+#include <my_global.h>
#include <gssapi/gssapi.h>
-#include <string.h>
-#include <stdio.h>
#include <mysql/plugin_auth.h>
#include <mysqld_error.h>
#include <mysql.h>
diff --git a/plugin/auth_gssapi/gssapi_errmsg.cc b/plugin/auth_gssapi/gssapi_errmsg.cc
index 8ea4cab5b02..f92a03983ba 100644
--- a/plugin/auth_gssapi/gssapi_errmsg.cc
+++ b/plugin/auth_gssapi/gssapi_errmsg.cc
@@ -26,8 +26,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+#include <my_global.h>
#include <gssapi.h>
#include <string.h>
+
void gssapi_errmsg(OM_uint32 major, OM_uint32 minor, char *buf, size_t size)
{
OM_uint32 message_context;
diff --git a/plugin/auth_gssapi/gssapi_server.cc b/plugin/auth_gssapi/gssapi_server.cc
index 50c34ecc573..269e5691da9 100644
--- a/plugin/auth_gssapi/gssapi_server.cc
+++ b/plugin/auth_gssapi/gssapi_server.cc
@@ -1,6 +1,5 @@
-#include <my_config.h>
+#include <my_global.h>
#include <gssapi/gssapi.h>
-#include <stdio.h>
#include <mysql/plugin_auth.h>
#include <my_sys.h>
#include <mysqld_error.h>
diff --git a/plugin/auth_gssapi/server_plugin.cc b/plugin/auth_gssapi/server_plugin.cc
index 0c0bcbbbb72..5d6a92fe5ca 100644
--- a/plugin/auth_gssapi/server_plugin.cc
+++ b/plugin/auth_gssapi/server_plugin.cc
@@ -31,6 +31,7 @@
GSSAPI authentication plugin, server side
*/
+#include <my_global.h>
#include <my_sys.h>
#include <mysqld_error.h>
#include <mysql/plugin_auth.h>
diff --git a/plugin/auth_gssapi/sspi_client.cc b/plugin/auth_gssapi/sspi_client.cc
index 34c1ce2e7ee..c9fb9d62fe5 100644
--- a/plugin/auth_gssapi/sspi_client.cc
+++ b/plugin/auth_gssapi/sspi_client.cc
@@ -27,11 +27,10 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#define SECURITY_WIN32
+#include <my_global.h>
#include <windows.h>
#include <sspi.h>
#include <SecExt.h>
-#include <stdarg.h>
-#include <stdio.h>
#include <mysql/plugin_auth.h>
#include <mysql.h>
@@ -180,4 +179,4 @@ cleanup:
FreeCredentialsHandle(&cred);
free(out);
return ret;
-} \ No newline at end of file
+}
diff --git a/plugin/auth_gssapi/sspi_errmsg.cc b/plugin/auth_gssapi/sspi_errmsg.cc
index 961ef51f42e..48adad72677 100644
--- a/plugin/auth_gssapi/sspi_errmsg.cc
+++ b/plugin/auth_gssapi/sspi_errmsg.cc
@@ -26,8 +26,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+#include <my_global.h>
#include <windows.h>
-#include <stdio.h>
+#include <string.h>
#define ERRSYM(x) {x, #x}
static struct {
diff --git a/plugin/auth_gssapi/sspi_server.cc b/plugin/auth_gssapi/sspi_server.cc
index d2c2ae7e4b9..866e9d55c26 100644
--- a/plugin/auth_gssapi/sspi_server.cc
+++ b/plugin/auth_gssapi/sspi_server.cc
@@ -26,6 +26,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
+#include <my_global.h>
#include "sspi.h"
#include "common.h"
#include "server_plugin.h"
diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c
index 94587a6d659..d4c3aba5b77 100644
--- a/plugin/cracklib_password_check/cracklib_password_check.c
+++ b/plugin/cracklib_password_check/cracklib_password_check.c
@@ -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 <my_config.h>
+#include <my_global.h>
#include <mysql/plugin_password_validation.h>
#include <crack.h>
#include <string.h>
diff --git a/plugin/feedback/feedback.h b/plugin/feedback/feedback.h
index 5e7e7b1516e..43c9f4ee844 100644
--- a/plugin/feedback/feedback.h
+++ b/plugin/feedback/feedback.h
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include <sql_class.h>
namespace feedback {
diff --git a/plugin/file_key_management/parser.cc b/plugin/file_key_management/parser.cc
index ac78186a488..03f78422c47 100644
--- a/plugin/file_key_management/parser.cc
+++ b/plugin/file_key_management/parser.cc
@@ -69,6 +69,7 @@ Example:
openssl enc -aes-256-cbc -md sha1 -k "secret" -in keys.txt -out keys.enc
***********************************************************************/
+#include <my_global.h>
#include "parser.h"
#include <m_string.h>
#include <mysys_err.h>
diff --git a/plugin/handler_socket/handlersocket/database.cpp b/plugin/handler_socket/handlersocket/database.cpp
index 2ddff7689ad..0761c1bc09d 100644
--- a/plugin/handler_socket/handlersocket/database.cpp
+++ b/plugin/handler_socket/handlersocket/database.cpp
@@ -6,10 +6,7 @@
* See COPYRIGHT.txt for details.
*/
-#include <my_config.h>
-
-#include <stdlib.h>
-#include <stdio.h>
+#include <my_global.h>
#include <string.h>
#include "database.hpp"
diff --git a/plugin/handler_socket/handlersocket/handlersocket.cpp b/plugin/handler_socket/handlersocket/handlersocket.cpp
index 6e4c03fcc24..8133497044c 100644
--- a/plugin/handler_socket/handlersocket/handlersocket.cpp
+++ b/plugin/handler_socket/handlersocket/handlersocket.cpp
@@ -6,8 +6,7 @@
* See COPYRIGHT.txt for details.
*/
-#include <my_config.h>
-
+#include <my_global.h>
#include <memory>
#include <string>
#include <stdio.h>
diff --git a/plugin/handler_socket/handlersocket/hstcpsvr.cpp b/plugin/handler_socket/handlersocket/hstcpsvr.cpp
index 925020023bc..250ef2c7be5 100644
--- a/plugin/handler_socket/handlersocket/hstcpsvr.cpp
+++ b/plugin/handler_socket/handlersocket/hstcpsvr.cpp
@@ -6,15 +6,11 @@
* See COPYRIGHT.txt for details.
*/
-#include <my_config.h>
-
-#include <stdlib.h>
+#include <my_global.h>
#include <vector>
-#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
-#include <fcntl.h>
#include <sys/resource.h>
#include "hstcpsvr.hpp"
diff --git a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
index c254d17dff5..9863602af7a 100644
--- a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
+++ b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
@@ -6,13 +6,11 @@
* See COPYRIGHT.txt for details.
*/
-#include <my_config.h>
-#include <sys/types.h>
+#include <my_global.h>
#include <netinet/in.h>
#include <errno.h>
#include <poll.h>
#include <unistd.h>
-#include <fcntl.h>
#include <stdexcept>
#include <signal.h>
#include <list>
diff --git a/plugin/handler_socket/handlersocket/mysql_incl.hpp b/plugin/handler_socket/handlersocket/mysql_incl.hpp
index 0fb4fceb143..0d056a7ed4a 100644
--- a/plugin/handler_socket/handlersocket/mysql_incl.hpp
+++ b/plugin/handler_socket/handlersocket/mysql_incl.hpp
@@ -19,8 +19,7 @@
#define MYSQL_SERVER 1
-#include <my_config.h>
-
+#include <my_global.h>
#include <mysql_version.h>
#if MYSQL_VERSION_ID >= 50505
diff --git a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
index aee22a1d0f6..f9db70fe971 100644
--- a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
+++ b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
@@ -9,8 +9,7 @@
#ifndef DENA_AUTO_ADDRINFO_HPP
#define DENA_AUTO_ADDRINFO_HPP
-#include <my_config.h>
-#include <sys/types.h>
+#include <my_global.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
diff --git a/plugin/handler_socket/libhsclient/hstcpcli.cpp b/plugin/handler_socket/libhsclient/hstcpcli.cpp
index 21c964cb046..461bed3f5d0 100644
--- a/plugin/handler_socket/libhsclient/hstcpcli.cpp
+++ b/plugin/handler_socket/libhsclient/hstcpcli.cpp
@@ -6,8 +6,7 @@
* See COPYRIGHT.txt for details.
*/
-#include <my_config.h>
-
+#include <my_global.h>
#include <stdexcept>
#include "hstcpcli.hpp"
diff --git a/plugin/handler_socket/libhsclient/socket.cpp b/plugin/handler_socket/libhsclient/socket.cpp
index 2c93a3b4846..f1cdc9fb20f 100644
--- a/plugin/handler_socket/libhsclient/socket.cpp
+++ b/plugin/handler_socket/libhsclient/socket.cpp
@@ -6,13 +6,10 @@
* See COPYRIGHT.txt for details.
*/
-#include <my_config.h>
+#include <my_global.h>
#include <stdexcept>
#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
#include <signal.h>
#include <sys/un.h>
diff --git a/plugin/locale_info/locale_info.cc b/plugin/locale_info/locale_info.cc
index 3d775c0be7c..e444b4fade0 100644
--- a/plugin/locale_info/locale_info.cc
+++ b/plugin/locale_info/locale_info.cc
@@ -26,6 +26,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <my_global.h>
#include <sql_class.h> // THD
#include <table.h> // ST_SCHEMA_TABLE
#include <mysql/plugin.h>
diff --git a/plugin/metadata_lock_info/metadata_lock_info.cc b/plugin/metadata_lock_info/metadata_lock_info.cc
index f2cdb99b82b..9fe764ea30b 100644
--- a/plugin/metadata_lock_info/metadata_lock_info.cc
+++ b/plugin/metadata_lock_info/metadata_lock_info.cc
@@ -14,7 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
-#include "my_config.h"
+#include <my_global.h>
#include "mysql_version.h"
#include "mysql/plugin.h"
#include "sql_class.h"
diff --git a/plugin/query_response_time/plugin.cc b/plugin/query_response_time/plugin.cc
index 0ed8b88dc60..7c4a7076c59 100644
--- a/plugin/query_response_time/plugin.cc
+++ b/plugin/query_response_time/plugin.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER
+#include <my_global.h>
#include <sql_class.h>
#include <table.h>
#include <sql_show.h>
diff --git a/plugin/semisync/semisync.cc b/plugin/semisync/semisync.cc
index 4a80360ba4d..df37f03ec2f 100644
--- a/plugin/semisync/semisync.cc
+++ b/plugin/semisync/semisync.cc
@@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <my_global.h>
#include "semisync.h"
const unsigned char ReplSemiSyncBase::kPacketMagicNum = 0xef;
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index 7901853c3f8..092ab38f6bf 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <my_global.h>
#include "semisync_master.h"
#define TIME_THOUSAND 1000
diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc
index 309910312c4..b46cf5d79cb 100644
--- a/plugin/semisync/semisync_master_plugin.cc
+++ b/plugin/semisync/semisync_master_plugin.cc
@@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <my_global.h>
#include "semisync_master.h"
#include "sql_class.h" // THD
diff --git a/plugin/semisync/semisync_slave.cc b/plugin/semisync/semisync_slave.cc
index 5f98472d5d7..ff8a40aafac 100644
--- a/plugin/semisync/semisync_slave.cc
+++ b/plugin/semisync/semisync_slave.cc
@@ -15,6 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <my_global.h>
#include "semisync_slave.h"
char rpl_semi_sync_slave_enabled;
diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc
index 3a6c7625d93..df9e8e10429 100644
--- a/plugin/semisync/semisync_slave_plugin.cc
+++ b/plugin/semisync/semisync_slave_plugin.cc
@@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <my_global.h>
#include "semisync_slave.h"
#include <mysql.h>
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 65de695ac9e..af6d2d95a42 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -20,10 +20,6 @@
#define _my_thread_var loc_thread_var
#include <my_config.h>
-#include <stdio.h>
-#include <time.h>
-#include <string.h>
-#include <fcntl.h>
#ifndef _WIN32
#include <syslog.h>
@@ -75,6 +71,7 @@ static void closelog() {}
*/
#if !defined(MYSQL_DYNAMIC_PLUGIN) && !defined(MARIADB_ONLY)
+#include <typelib.h>
#define MARIADB_ONLY
#endif /*MYSQL_PLUGIN_DYNAMIC*/
@@ -82,11 +79,12 @@ static void closelog() {}
#define MYSQL_SERVICE_LOGGER_INCLUDED
#endif /*MARIADB_ONLY*/
+#include <my_global.h>
#include <my_base.h>
-//#include <my_dir.h>
#include <typelib.h>
#include <mysql/plugin.h>
#include <mysql/plugin_audit.h>
+#include <string.h>
#ifndef RTLD_DEFAULT
#define RTLD_DEFAULT NULL
#endif
diff --git a/plugin/server_audit/test_audit_v4.c b/plugin/server_audit/test_audit_v4.c
index ae7527f8449..65571b14c11 100644
--- a/plugin/server_audit/test_audit_v4.c
+++ b/plugin/server_audit/test_audit_v4.c
@@ -1,5 +1,6 @@
#define PLUGIN_CONTEXT
+/* Can't use <my_global.h> as this includes plugin.h */
#include <stdio.h>
typedef void *MYSQL_THD;
diff --git a/plugin/simple_password_check/simple_password_check.c b/plugin/simple_password_check/simple_password_check.c
index f1cd5aaf17f..60d8a9ea815 100644
--- a/plugin/simple_password_check/simple_password_check.c
+++ b/plugin/simple_password_check/simple_password_check.c
@@ -14,6 +14,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 <my_global.h>
#include <my_sys.h>
#include <mysqld_error.h>
#include <mysql/plugin_password_validation.h>
diff --git a/plugin/user_variables/user_variables.cc b/plugin/user_variables/user_variables.cc
index 9190b2effb7..227455e5696 100644
--- a/plugin/user_variables/user_variables.cc
+++ b/plugin/user_variables/user_variables.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define MYSQL_SERVER
+#include <my_global.h>
#include <sql_class.h>
#include <table.h>
#include <sql_show.h>
diff --git a/plugin/userstat/userstat.cc b/plugin/userstat/userstat.cc
index 96d926ac908..2084453fbca 100644
--- a/plugin/userstat/userstat.cc
+++ b/plugin/userstat/userstat.cc
@@ -1,4 +1,4 @@
-#include <my_config.h>
+#include <my_global.h>
#include <mysql/plugin.h>
#include <mysql_version.h>
#include "table.h"
diff --git a/plugin/wsrep_info/plugin.cc b/plugin/wsrep_info/plugin.cc
index ed502d30f88..428bcc5dcfc 100644
--- a/plugin/wsrep_info/plugin.cc
+++ b/plugin/wsrep_info/plugin.cc
@@ -17,7 +17,7 @@
#define MYSQL_SERVER
#endif
-#include <my_config.h>
+#include <my_global.h>
#include <mysql/plugin.h>
#include <table.h> /* ST_SCHEMA_TABLE */
#include <sql_show.h>
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 5571b87e08a..4f415d83573 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -15,6 +15,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 <my_global.h>
#include <my_time.h>
#include <m_string.h>
#include <m_ctype.h>
diff --git a/sql-common/my_user.c b/sql-common/my_user.c
index a486f77bc1e..712101b471f 100644
--- a/sql-common/my_user.c
+++ b/sql-common/my_user.c
@@ -14,6 +14,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 <my_global.h>
#include <my_user.h>
#include <m_string.h>
#include <mysql_com.h>
diff --git a/sql/bounded_queue.h b/sql/bounded_queue.h
index 3573c5ceb27..d7c28215631 100644
--- a/sql/bounded_queue.h
+++ b/sql/bounded_queue.h
@@ -16,9 +16,8 @@
#ifndef BOUNDED_QUEUE_INCLUDED
#define BOUNDED_QUEUE_INCLUDED
-#include "my_global.h"
#include "my_base.h"
-#include "my_sys.h"
+#include <my_sys.h>
#include "queues.h"
#include <string.h>
diff --git a/sql/compat56.cc b/sql/compat56.cc
index 704d1db9a98..6cbf4a66ac8 100644
--- a/sql/compat56.cc
+++ b/sql/compat56.cc
@@ -15,7 +15,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 "my_global.h"
+#include "mariadb.h"
#include "compat56.h"
#include "myisampack.h"
#include "my_time.h"
diff --git a/sql/create_options.cc b/sql/create_options.cc
index a56357db588..ca3ace5a5b9 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -19,6 +19,7 @@
Engine defined options of tables/fields/keys in CREATE/ALTER TABLE.
*/
+#include "mariadb.h"
#include "create_options.h"
#include <my_getopt.h>
#include "set_var.h"
diff --git a/sql/datadict.cc b/sql/datadict.cc
index edc9fe5681b..7ea83236cd6 100644
--- a/sql/datadict.cc
+++ b/sql/datadict.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "datadict.h"
#include "sql_priv.h"
#include "sql_class.h"
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index b2a187b07cb..f0bab73a048 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -15,7 +15,7 @@
/* see include/mysql/service_debug_sync.h for debug sync documentation */
-#include <my_global.h>
+#include "mariadb.h"
#include "debug_sync.h"
#if defined(ENABLED_DEBUG_SYNC)
diff --git a/sql/debug_sync.h b/sql/debug_sync.h
index 999667b9efc..70d28cb982b 100644
--- a/sql/debug_sync.h
+++ b/sql/debug_sync.h
@@ -26,8 +26,6 @@
#pragma interface /* gcc class implementation */
#endif
-#include <my_global.h>
-
class THD;
#if defined(ENABLED_DEBUG_SYNC)
diff --git a/sql/derror.cc b/sql/derror.cc
index 5a1bee23f4a..8be1c26b7e4 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -21,7 +21,7 @@
Read language depeneded messagefile
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "derror.h"
diff --git a/sql/derror.h b/sql/derror.h
index 9f2aee71c7e..a171a248190 100644
--- a/sql/derror.h
+++ b/sql/derror.h
@@ -16,8 +16,6 @@
#ifndef DERROR_INCLUDED
#define DERROR_INCLUDED
-#include "my_global.h" /* uint */
-
bool init_errmessage(void);
void free_error_messages();
bool read_texts(const char *file_name, const char *language,
diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc
index ede2e9fa9d4..e7785a0a223 100644
--- a/sql/des_key_file.cc
+++ b/sql/des_key_file.cc
@@ -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 <my_global.h> // HAVE_*
+#include "mariadb.h" // HAVE_*
#include "sql_priv.h"
#include "des_key_file.h" // st_des_keyschedule, st_des_keyblock
#include "log.h" // sql_print_error
diff --git a/sql/discover.cc b/sql/discover.cc
index d8bf6ca79c5..8785845d6e5 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -21,7 +21,7 @@
Functions for discover of frm file from handler
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "discover.h"
diff --git a/sql/discover.h b/sql/discover.h
index e1508107235..c3127c3bff3 100644
--- a/sql/discover.h
+++ b/sql/discover.h
@@ -16,8 +16,6 @@
#ifndef DISCOVER_INCLUDED
#define DISCOVER_INCLUDED
-#include "my_global.h" /* uchar */
-
int extension_based_table_discovery(MY_DIR *dirp, const char *ext,
handlerton::discovered_list *tl);
diff --git a/sql/encryption.cc b/sql/encryption.cc
index a92296e8b66..84a9904c393 100644
--- a/sql/encryption.cc
+++ b/sql/encryption.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include <mysql/plugin_encryption.h>
#include "log.h"
#include "sql_plugin.h"
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 2ab06fb34f2..631e3388084 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define MYSQL_LEX 1
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_parse.h" // parse_sql
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index e71cfdc1e16..7e00edb2502 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_base.h" // close_thread_tables
diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc
index 7932f228309..c598c8a15ee 100644
--- a/sql/event_parse_data.cc
+++ b/sql/event_parse_data.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sp_head.h"
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 9ffb9935634..a8ddff81110 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "event_queue.h"
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index c889cbeba67..a38425a7c4e 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "event_scheduler.h"
diff --git a/sql/events.cc b/sql/events.cc
index 86e85d7f757..3c66945fbd9 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -15,7 +15,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_parse.h" // check_access
diff --git a/sql/field.cc b/sql/field.cc
index fbb2ad79ba9..45c0e20f757 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -27,7 +27,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
#include "rpl_rli.h" // Pull in Relay_log_info
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index a744af76626..fc3667c0f87 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -25,7 +25,7 @@
gives much more speed.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h" // THD
#include <m_ctype.h>
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 31ff2e511a9..8c0b0010b75 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -22,7 +22,7 @@
Sorts a database
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "filesort.h"
#ifdef HAVE_STDDEF_H
diff --git a/sql/filesort_utils.cc b/sql/filesort_utils.cc
index a0bc5ee6aa2..11be9229c1d 100644
--- a/sql/filesort_utils.cc
+++ b/sql/filesort_utils.cc
@@ -13,11 +13,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include "filesort_utils.h"
#include "sql_const.h"
#include "sql_sort.h"
#include "table.h"
-#include "my_sys.h"
namespace {
diff --git a/sql/filesort_utils.h b/sql/filesort_utils.h
index d537b602edf..544cd3e0f2b 100644
--- a/sql/filesort_utils.h
+++ b/sql/filesort_utils.h
@@ -16,7 +16,6 @@
#ifndef FILESORT_UTILS_INCLUDED
#define FILESORT_UTILS_INCLUDED
-#include "my_global.h"
#include "my_base.h"
#include "sql_array.h"
diff --git a/sql/gcalc_slicescan.cc b/sql/gcalc_slicescan.cc
index ab48542add6..da70daea4a8 100644
--- a/sql/gcalc_slicescan.cc
+++ b/sql/gcalc_slicescan.cc
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include <my_sys.h>
#include <m_string.h>
diff --git a/sql/gcalc_tools.cc b/sql/gcalc_tools.cc
index 71118ae1c9f..2aeaafc1a76 100644
--- a/sql/gcalc_tools.cc
+++ b/sql/gcalc_tools.cc
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#ifdef HAVE_SPATIAL
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 3a3273d279b..b2bc1aee091 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -78,11 +78,9 @@ So, we can read full search-structure as 32-bit word
*/
#define NO_YACC_SYMBOLS
-#include <my_global.h>
+#include "mariadb.h"
#include "mysql_version.h"
#include "lex.h"
-#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
diff --git a/sql/gen_lex_token.cc b/sql/gen_lex_token.cc
index eefe9163819..91b91f49e37 100644
--- a/sql/gen_lex_token.cc
+++ b/sql/gen_lex_token.cc
@@ -14,9 +14,7 @@
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-#include <my_global.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include "mariadb.h"
#include <string.h>
/* We only need the tokens here */
diff --git a/sql/group_by_handler.cc b/sql/group_by_handler.cc
index c1b5cfbe254..e75800d8986 100644
--- a/sql/group_by_handler.cc
+++ b/sql/group_by_handler.cc
@@ -21,6 +21,7 @@
upper level.
*/
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
diff --git a/sql/gstream.cc b/sql/gstream.cc
index adb46083621..ff3604ac7a4 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -18,7 +18,7 @@
NOTE: These functions assumes that the string is end \0 terminated!
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "gstream.h"
#include "m_string.h" // LEX_STRING
diff --git a/sql/gstream.h b/sql/gstream.h
index f10b7e9b830..b9310b716ba 100644
--- a/sql/gstream.h
+++ b/sql/gstream.h
@@ -17,8 +17,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "my_global.h" /* NULL, NullS */
-#include "my_sys.h" /* MY_ALLOW_ZERO_PTR */
+#include <my_sys.h> /* MY_ALLOW_ZERO_PTR */
#include "m_ctype.h" /* my_charset_latin1, my_charset_bin */
class Gis_read_stream
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 2bb43ec794f..44e14c7a643 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -46,7 +46,7 @@
if this file.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_parse.h" // append_file_to_dir
#include "create_options.h"
diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc
index 7f2248bf3cb..e5db6781464 100644
--- a/sql/ha_sequence.cc
+++ b/sql/ha_sequence.cc
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_list.h"
#include "table.h"
#include "sql_sequence.h"
diff --git a/sql/handler.cc b/sql/handler.cc
index 90fe6dfa7fd..cdf72b1b935 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -20,7 +20,7 @@
Handler-calling-functions
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "rpl_handler.h"
diff --git a/sql/handler.h b/sql/handler.h
index e20d07fccef..75205dda957 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -25,7 +25,6 @@
#pragma interface /* gcc class implementation */
#endif
-#include <my_global.h> /* For handlers */
#include "sql_const.h"
#include "sql_basic_types.h"
#include "mysqld.h" /* server_id */
diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc
index fc89bb83a9d..641d1a20f73 100644
--- a/sql/hash_filo.cc
+++ b/sql/hash_filo.cc
@@ -23,7 +23,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "hash_filo.h"
diff --git a/sql/hostname.cc b/sql/hostname.cc
index e8d6780d095..0e60dde893c 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -24,7 +24,7 @@
Hostnames are checked with reverse name lookup and checked that they
doesn't resemble an IP address.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h" // SPECIAL_NO_HOST_CACHE
#include "hostname.h"
diff --git a/sql/hostname.h b/sql/hostname.h
index d6137b7c260..3e1669b29ed 100644
--- a/sql/hostname.h
+++ b/sql/hostname.h
@@ -16,7 +16,6 @@
#ifndef HOSTNAME_INCLUDED
#define HOSTNAME_INCLUDED
-#include "my_global.h" /* uint */
#include "my_net.h"
#include "hash_filo.h"
diff --git a/sql/init.cc b/sql/init.cc
index 8001e60b65e..0d00e3cf846 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -21,10 +21,9 @@
Init and dummy functions for interface with unireg
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "init.h"
-#include "my_sys.h"
#include "mysqld.h" // abort_loop, ...
#include "my_time.h" // my_init_time
#include "unireg.h" // SPECIAL_SAME_DB_NAME
diff --git a/sql/init.h b/sql/init.h
index 88cd8e6e178..11d74314f98 100644
--- a/sql/init.h
+++ b/sql/init.h
@@ -16,8 +16,6 @@
#ifndef INIT_INCLUDED
#define INIT_INCLUDED
-#include "my_global.h" /* ulong */
-
void unireg_init(ulong options);
void unireg_end(void) __attribute__((noreturn));
diff --git a/sql/item.cc b/sql/item.cc
index f84c2aff0a3..d67301e8d04 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -19,7 +19,7 @@
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include <mysql.h>
#include <m_ctype.h>
diff --git a/sql/item_buff.cc b/sql/item_buff.cc
index 488eb52fb77..4d03462d7c3 100644
--- a/sql/item_buff.cc
+++ b/sql/item_buff.cc
@@ -22,7 +22,7 @@
Buffers to save and compare item values
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index fc076b766c2..30b92bf774b 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -26,7 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include <m_ctype.h>
#include "sql_select.h"
diff --git a/sql/item_create.cc b/sql/item_create.cc
index e0bfe7a4402..1ac85b2f0b2 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -22,7 +22,7 @@
Functions to create an item. Used by sql_yac.yy
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 04952739e85..3047595b58c 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -26,7 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_inetfunc.cc b/sql/item_inetfunc.cc
index 6a09747fa1a..c4cb9b2bae2 100644
--- a/sql/item_inetfunc.cc
+++ b/sql/item_inetfunc.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "item_inetfunc.h"
#include "my_net.h"
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 3d24c8137c9..772e1a3075a 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -14,7 +14,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h"
#include "item.h"
diff --git a/sql/item_row.cc b/sql/item_row.cc
index fc484f560ee..8b7cc814694 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 6138b67c02e..acb2038e7e5 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -31,7 +31,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h> // HAVE_*
+#include "mariadb.h" // HAVE_*
#include "sql_priv.h"
/*
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 36ce86fca29..b184ba86ea4 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -29,7 +29,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 1b81773c1ed..1ad55cf9f7a 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -26,7 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
#include "uniques.h"
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index e0ee85dd5a2..6af25c67d91 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -30,7 +30,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index f3a64e608a5..835a3cbfdae 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -14,9 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include "mariadb.h"
#include "item_windowfunc.h"
-#include "my_dbug.h"
-#include "my_global.h"
#include "sql_select.h" // test if group changed
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 3e09b5b349d..64a974d55d6 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -17,7 +17,6 @@
#ifndef ITEM_WINDOWFUNC_INCLUDED
#define ITEM_WINDOWFUNC_INCLUDED
-#include "my_global.h"
#include "item.h"
class Window_spec;
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index ba33d103d0c..a427cba5956 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/key.cc b/sql/key.cc
index c2d22005736..9e44bc2e6b0 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -16,7 +16,7 @@
/* Functions to handle keys and fields in forms */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "key.h" // key_rec_cmp
#include "field.h" // Field
diff --git a/sql/key.h b/sql/key.h
index 7b83d74c901..523d0b7f10b 100644
--- a/sql/key.h
+++ b/sql/key.h
@@ -16,8 +16,6 @@
#ifndef KEY_INCLUDED
#define KEY_INCLUDED
-#include "my_global.h" /* uchar */
-
class Field;
class String;
struct TABLE;
diff --git a/sql/keycaches.cc b/sql/keycaches.cc
index 336f2611a7e..6de775d3f2d 100644
--- a/sql/keycaches.cc
+++ b/sql/keycaches.cc
@@ -13,6 +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 "mariadb.h"
#include "keycaches.h"
/****************************************************************************
diff --git a/sql/lock.cc b/sql/lock.cc
index a34613fb7fe..5c80a2c98cd 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -70,7 +70,7 @@
in case external_lock() fails.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "debug_sync.h"
#include "lock.h"
diff --git a/sql/log.cc b/sql/log.cc
index 166180e08a4..97982eed7fa 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -25,7 +25,7 @@
Abort logging when we get an error in reading or writing log files
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "log.h"
#include "sql_base.h" // open_log_table
@@ -5870,6 +5870,8 @@ MYSQL_BIN_LOG::write_gtid_event(THD *thd, bool standalone,
local_server_id= thd->variables.server_id;
seq_no= thd->variables.gtid_seq_no;
+ DBUG_ASSERT(local_server_id != 0);
+
if (thd->variables.option_bits & OPTION_GTID_BEGIN)
{
DBUG_PRINT("error", ("OPTION_GTID_BEGIN is set. "
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 5029145c3fd..2f02d1db2c8 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "mysqld_error.h"
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 8f1cfe17656..a7f491671c1 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#ifndef MYSQL_CLIENT
#include "unireg.h"
diff --git a/sql/mariadb.h b/sql/mariadb.h
new file mode 100644
index 00000000000..00cf2ed1d9c
--- /dev/null
+++ b/sql/mariadb.h
@@ -0,0 +1,30 @@
+/* Copyright (c) 2010, 2017, MariaDB Corporation.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/*
+ Include file that should always be included first in all file in the sql
+ directory. Used to ensure that some files, like my_global.h and my_config.h
+ are always included first.
+ It can also be used to speed up compilation by using precompiled headers.
+
+ This file should include a minum set of header files used by all files
+ and header files that are very seldom changed.
+ It can also include some defines that all files should be aware of.
+*/
+
+#ifndef MARIADB_INCLUDED
+#define MARIADB_INCLUDED
+#include <my_global.h>
+#endif /* MARIADB_INCLUDED */
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 87a0171a193..350d27298de 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -14,6 +14,7 @@
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+#include "mariadb.h"
#include "sql_class.h"
#include "debug_sync.h"
#include "sql_array.h"
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index 6535f16445b..3d3b4da11db 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -32,7 +32,7 @@
flush_io_cache().
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h" // THD
#ifdef HAVE_REPLICATION
diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc
index 53d0c3204a1..bc214a90e56 100644
--- a/sql/multi_range_read.cc
+++ b/sql/multi_range_read.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include "sql_parse.h"
#include <my_bit.h>
#include "sql_select.h"
diff --git a/sql/my_apc.cc b/sql/my_apc.cc
index b165a801ce5..c86e554e591 100644
--- a/sql/my_apc.cc
+++ b/sql/my_apc.cc
@@ -17,6 +17,7 @@
#ifndef MY_APC_STANDALONE
+#include "mariadb.h"
#include "sql_class.h"
#endif
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index be732d4a927..6d1c746fca8 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include <time.h>
diff --git a/sql/my_json_writer.cc b/sql/my_json_writer.cc
index 390123fbba9..1d61986034a 100644
--- a/sql/my_json_writer.cc
+++ b/sql/my_json_writer.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_string.h"
diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc
index 5960346c60e..30f2d4f6526 100644
--- a/sql/mysql_install_db.cc
+++ b/sql/mysql_install_db.cc
@@ -18,9 +18,8 @@
on Windows.
*/
#define DONT_DEFINE_VOID
-#include <my_global.h>
+#include "mariadb.h"
#include <my_getopt.h>
-#include <my_sys.h>
#include <m_string.h>
#include <windows.h>
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc
index 36de05e54e4..2f242bebb0d 100644
--- a/sql/mysql_upgrade_service.cc
+++ b/sql/mysql_upgrade_service.cc
@@ -20,8 +20,8 @@
*/
#define DONT_DEFINE_VOID
+#include "mariadb.h"
#include <process.h>
-#include <my_global.h>
#include <my_getopt.h>
#include <my_sys.h>
#include <m_string.h>
@@ -519,4 +519,4 @@ int main(int argc, char **argv)
CloseHandle(logfile_handle);
my_end(0);
exit(0);
-} \ No newline at end of file
+}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 01f754955b6..630a5d64c8f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "sql_plugin.h" // Includes my_global.h
+#include "sql_plugin.h" // Includes mariadb.h
#include "sql_priv.h"
#include "unireg.h"
#include <signal.h>
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 0b15d5ac322..ceefcd2f576 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -17,7 +17,6 @@
#ifndef MYSQLD_INCLUDED
#define MYSQLD_INCLUDED
-#include <my_global.h> /* MYSQL_PLUGIN_IMPORT, FN_REFLEN, FN_EXTLEN */
#include "sql_basic_types.h" /* query_id_t */
#include "sql_plugin.h"
#include "sql_bitmap.h" /* Bitmap */
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 849f5689f58..82725052ab3 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -35,7 +35,7 @@
embedded library
*/
-#include <my_global.h>
+#include "mariadb.h"
#include <mysql.h>
#include <mysql_com.h>
#include <mysqld_error.h>
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc
index 1dde5228263..b21cbb33c64 100644
--- a/sql/opt_index_cond_pushdown.cc
+++ b/sql/opt_index_cond_pushdown.cc
@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include "sql_select.h"
#include "sql_test.h"
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 9161dee7836..e45772e9b0d 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -108,7 +108,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "key.h" // is_key_used, key_copy, key_cmp, key_restore
#include "sql_parse.h" // check_stack_overrun
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 4024ae26b8b..a57bc44449d 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -26,7 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_base.h"
#include "sql_select.h"
#include "filesort.h"
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index ab587b8b279..6cdf0e0f26a 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -48,7 +48,7 @@
(assuming a index for column d of table t2 is defined)
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "key.h" // key_cmp_if_same
#include "sql_select.h"
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index d3d1bc97a70..1d6fb4dabfe 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -28,6 +28,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include "mariadb.h"
#include "my_bit.h"
#include "sql_select.h"
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index b091259d273..1cc40e3e39b 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -20,13 +20,12 @@
Text .frm files management routines
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "parse_file.h"
#include "unireg.h" // CREATE_MODE
#include "sql_table.h" // build_table_filename
#include <m_ctype.h>
-#include <my_sys.h>
#include <my_dir.h>
/* from sql_db.cc */
diff --git a/sql/parse_file.h b/sql/parse_file.h
index 3f48b2072db..fdc74f3a809 100644
--- a/sql/parse_file.h
+++ b/sql/parse_file.h
@@ -17,7 +17,6 @@
#ifndef _PARSE_FILE_H_
#define _PARSE_FILE_H_
-#include "my_global.h" // uchar
#include "sql_string.h" // LEX_STRING
#include "sql_list.h" // Sql_alloc
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 31e48a85104..a52c7873817 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -20,7 +20,7 @@
#pragma implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
// Required to get server definitions for mysql/plugin.h right
#include "sql_plugin.h"
diff --git a/sql/password.c b/sql/password.c
index 1f0a55a10fe..47f4fd1d422 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -60,7 +60,7 @@
*****************************************************************************/
-#include <my_global.h>
+#include "mariadb.h"
#include <my_sys.h>
#include <m_string.h>
#include <password.h>
diff --git a/sql/procedure.cc b/sql/procedure.cc
index 3d36b7adfa3..e4bf589958e 100644
--- a/sql/procedure.cc
+++ b/sql/procedure.cc
@@ -20,7 +20,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "procedure.h"
#include "sql_analyse.h" // Includes procedure
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 33742dc01a2..205b640dcb1 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -25,7 +25,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "protocol.h"
#include "sql_class.h" // THD
diff --git a/sql/records.cc b/sql/records.cc
index 3ec9ea814cc..e50c924284a 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -25,7 +25,7 @@
Functions for easy reading of records, possible through a cache
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "records.h"
#include "sql_priv.h"
#include "records.h"
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 4cf7df5227f..20290e8bad8 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -24,7 +24,7 @@
functions like register_slave()) are working.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_parse.h" // check_access
#ifdef HAVE_REPLICATION
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index 2cc031a462d..c3584fb17f2 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -19,7 +19,7 @@
#ifdef HAVE_REPLICATION
#include "mysql.h"
-#include "my_sys.h"
+#include <my_sys.h>
#include "slave.h"
typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE,
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index b82e7bada45..8af919990d0 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "mysqld.h" // system_charset_info
#include "rpl_filter.h"
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 4101c2ff4ea..965af7e9b69 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -16,11 +16,10 @@
/* Definitions for MariaDB global transaction ID (GTID). */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
-#include "my_sys.h"
#include "unireg.h"
-#include "my_global.h"
+#include "mariadb.h"
#include "sql_base.h"
#include "sql_parse.h"
#include "key.h"
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 733af6c61c8..2ac7806e019 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index bff0da26862..d7081f766ec 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "rpl_injector.h"
#include "transaction.h"
diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h
index 41e1fcf460c..dc7bfb6503a 100644
--- a/sql/rpl_injector.h
+++ b/sql/rpl_injector.h
@@ -17,7 +17,6 @@
#define INJECTOR_H
/* Pull in 'byte', 'my_off_t', and 'uint32' */
-#include <my_global.h>
#include <my_bitmap.h>
#include "rpl_constants.h"
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 43c5eceecf4..63c891a7790 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -14,7 +14,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 <my_global.h> // For HAVE_REPLICATION
+#include "mariadb.h" // For HAVE_REPLICATION
#include "sql_priv.h"
#include <my_dir.h>
#include "rpl_mi.h"
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index 58333ad1aa8..610bc77b683 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -20,7 +20,7 @@
#include "rpl_rli.h"
#include "rpl_reporting.h"
-#include "my_sys.h"
+#include <my_sys.h>
#include "rpl_filter.h"
#include "keycaches.h"
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 0994bce4f7a..5797b82d8fe 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -1,4 +1,4 @@
-#include "my_global.h"
+#include "mariadb.h"
#include "rpl_parallel.h"
#include "slave.h"
#include "rpl_mi.h"
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index c07fe0464a1..01d9da52d4e 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "rpl_rli.h"
diff --git a/sql/rpl_record.h b/sql/rpl_record.h
index be69716d9d5..8d565845c4b 100644
--- a/sql/rpl_record.h
+++ b/sql/rpl_record.h
@@ -18,7 +18,6 @@
#define RPL_RECORD_H
#include <rpl_reporting.h>
-#include "my_global.h" /* uchar */
struct rpl_group_info;
struct TABLE;
diff --git a/sql/rpl_record_old.cc b/sql/rpl_record_old.cc
index a252bbff0f5..4180557f018 100644
--- a/sql/rpl_record_old.cc
+++ b/sql/rpl_record_old.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "rpl_rli.h"
#include "rpl_record_old.h"
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc
index ad949402511..800682fab91 100644
--- a/sql/rpl_reporting.cc
+++ b/sql/rpl_reporting.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "rpl_reporting.h"
#include "log.h" // sql_print_error, sql_print_warning,
diff --git a/sql/rpl_reporting.h b/sql/rpl_reporting.h
index d90b7ad6650..17748f587b1 100644
--- a/sql/rpl_reporting.h
+++ b/sql/rpl_reporting.h
@@ -16,7 +16,7 @@
#ifndef RPL_REPORTING_H
#define RPL_REPORTING_H
-#include "my_sys.h" /* loglevel */
+#include <my_sys.h> /* loglevel */
/**
Maximum size of an error message from a slave thread.
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 14b176f7388..3f85593f29e 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h" // HAVE_*
#include "rpl_mi.h"
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index 4c521cf0c16..1f4aa45a101 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#ifdef HAVE_REPLICATION
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 9a984c5c953..1d8cd15dc51 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include <my_bit.h>
#include "rpl_utility.h"
#include "log_event.h"
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index de472ae2504..818bb3818f4 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -22,6 +22,7 @@
#pragma implementation
#endif
+#include "mariadb.h"
#include "mysqld.h"
#include "sql_connect.h" // init_new_connection_handler_thread
#include "scheduler.h"
diff --git a/sql/scheduler.h b/sql/scheduler.h
index 71553372999..b067763d9b4 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -25,8 +25,6 @@
#pragma interface
#endif
-#include <my_global.h>
-
class THD;
/* Functions used when manipulating threads */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 5f3aff29913..474bfe683a6 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -16,7 +16,7 @@
/* variable declarations are in sys_vars.cc now !!! */
-#include "sql_plugin.h" // Includes my_global.h
+#include "sql_plugin.h"
#include "sql_class.h" // set_var.h: session_var_ptr
#include "set_var.h"
#include "sql_priv.h"
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index efcc9a3f0b2..d7f26ea5aa3 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -14,7 +14,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 "my_global.h"
+#include "mariadb.h"
#include <signal.h>
//#include "sys_vars.h"
diff --git a/sql/slave.cc b/sql/slave.cc
index f632cf4abc8..a48acc13102 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -25,7 +25,7 @@
replication slave.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "slave.h"
#include "sql_parse.h" // execute_init_command
diff --git a/sql/sp.cc b/sql/sp.cc
index 015e2f77b21..85cef2a7d81 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -15,7 +15,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sp.h"
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 70ba5084914..342673bf619 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/sql/sp_cache.h b/sql/sp_cache.h
index 51886a61ee9..a045ff5d3c5 100644
--- a/sql/sp_cache.h
+++ b/sql/sp_cache.h
@@ -21,8 +21,6 @@
#pragma interface /* gcc class implementation */
#endif
-#include "my_global.h" /* ulong */
-
/*
Stored procedures/functions cache. This is used as follows:
* Each thread has its own cache.
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 2ea40e37754..11f4a0dcfde 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -15,7 +15,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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_prepare.h"
diff --git a/sql/sp_head.h b/sql/sp_head.h
index c3dab609823..d7ef6fd0921 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -27,7 +27,6 @@
are dependencies on include order for set_var.h and item.h. This
will be resolved later.
*/
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_class.h" // THD, set_var.h: THD
#include "set_var.h" // Item
#include "sp_pcontext.h" // sp_pcontext
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index d98f8005945..f8193f8a9a7 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 3ceba42b0e4..c3fc596d9ec 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 1ba754b6b13..36c19115311 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -15,7 +15,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "spatial.h"
#include "gstream.h" // Gis_read_stream
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 41d0e73a84e..faadcb3dcf1 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -25,7 +25,7 @@
in the relevant fields. Empty strings comes last.
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "sql_acl.h" // MYSQL_DB_FIELD_COUNT, ACL_ACCESS
#include "sql_base.h" // close_mysql_tables
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 6164c6fa57d..dacddd603dd 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -17,7 +17,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "violite.h" /* SSL_type */
#include "sql_class.h" /* LEX_COLUMN */
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 16f4a1266e5..d052c040d19 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -14,7 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "sql_class.h" // THD and my_global.h
+#include "mariadb.h"
+#include "sql_class.h" // THD
#include "keycaches.h" // get_key_cache
#include "sql_base.h" // Open_table_context
#include "lock.h" // MYSQL_OPEN_*
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 0194f26d217..867b5218fa3 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -14,6 +14,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 "mariadb.h"
#include "sql_parse.h" // check_access
#include "sql_table.h" // mysql_alter_table,
// mysql_exchange_partition
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 1022dde079d..351ddb452d8 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -29,7 +29,7 @@
#define MYSQL_LEX 1
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "procedure.h"
#include "sql_analyse.h"
diff --git a/sql/sql_analyze_stmt.cc b/sql/sql_analyze_stmt.cc
index ac3797aae60..2c09772bd66 100644
--- a/sql/sql_analyze_stmt.cc
+++ b/sql/sql_analyze_stmt.cc
@@ -18,7 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
#include "my_json_writer.h"
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 8134adca13f..7c8b355b8d0 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_audit.h"
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index f7ad8d3cd20..50613e5e439 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -18,8 +18,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <my_global.h>
-
#include <mysql/plugin_audit.h>
#include "sql_class.h"
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 60247c83a08..53efd9bc4ba 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -17,7 +17,7 @@
/* Basic functions needed by many modules */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_base.h" // setup_table_map
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 5f554a3cd92..d9d057938eb 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_binlog.h"
#include "sql_parse.h"
diff --git a/sql/sql_bootstrap.cc b/sql/sql_bootstrap.cc
index 30d03029ce6..533459365af 100644
--- a/sql/sql_bootstrap.cc
+++ b/sql/sql_bootstrap.cc
@@ -14,7 +14,7 @@
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include <ctype.h>
#include <string.h>
#include "sql_bootstrap.h"
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 96a64697390..41c3ee33cfd 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -328,7 +328,7 @@ TODO list:
(This could be done with almost no speed penalty)
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "sql_basic_types.h"
#include "sql_cache.h"
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index be613f38b81..a52c97e5c54 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -28,7 +28,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h"
#include "sql_cache.h" // query_cache_abort
diff --git a/sql/sql_class.h b/sql/sql_class.h
index ce002a3c35a..0034b42f853 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -20,7 +20,6 @@
/* Classes in mysql */
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "dur_prop.h"
#include <waiting_threads.h>
#include "sql_const.h"
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
index efac01f9894..0e17360915c 100644
--- a/sql/sql_client.cc
+++ b/sql/sql_client.cc
@@ -18,7 +18,7 @@
This files defines some MySQL C API functions that are server specific
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h" // system_variables
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index a7b31dd6abd..d76c57b7789 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -20,7 +20,7 @@
Functions to autenticate and handle reqests for a connection
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#ifndef __WIN__
#include <netdb.h> // getservbyname, servent
diff --git a/sql/sql_connect.h b/sql/sql_connect.h
index 03a2818b206..cd3650fb2b2 100644
--- a/sql/sql_connect.h
+++ b/sql/sql_connect.h
@@ -16,7 +16,7 @@
#ifndef SQL_CONNECT_INCLUDED
#define SQL_CONNECT_INCLUDED
-#include "my_sys.h" /* pthread_handler_t */
+#include <my_sys.h> /* pthread_handler_t */
#include "mysql_com.h" /* enum_server_command */
#include "structs.h"
#include <mysql/psi/mysql_socket.h>
diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc
index 2460a16551d..19cd780e9c3 100644
--- a/sql/sql_crypt.cc
+++ b/sql/sql_crypt.cc
@@ -26,7 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_crypt.h"
#include "password.h"
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index 3a3918fcbfd..8045eb7eb63 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -14,6 +14,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 "mariadb.h"
#include "sql_class.h"
#include "sql_lex.h"
#include "sql_cte.h"
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 40eb7046108..864b64a9f28 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -17,7 +17,7 @@
#pragma implementation /* gcc class implementation */
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_cursor.h"
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index f91b92b1d4f..4db216a3a41 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -18,7 +18,7 @@
/* create and drop of databases */
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_db.h"
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index a9275bd39fd..370cfd824ca 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -21,7 +21,7 @@
Multi-table deletes were introduced by Monty and Sinisa
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_delete.h"
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index bf1a777f50c..796a8fe13f8 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -22,7 +22,7 @@
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_derived.h"
diff --git a/sql/sql_digest.cc b/sql/sql_digest.cc
index 27c33f1c64b..65edcc122f1 100644
--- a/sql/sql_digest.cc
+++ b/sql/sql_digest.cc
@@ -18,7 +18,7 @@
This code needs extra visibility in the lexer structures
*/
-#include "my_global.h"
+#include "mariadb.h"
#include "my_md5.h"
#include "mysqld_error.h"
@@ -31,11 +31,6 @@
#include "sql_get_diagnostics.h"
-#ifdef NEVER
-#include "my_sys.h"
-#include "sql_signal.h"
-#endif
-
/* Generated code */
#include "sql_yacc.h"
#define LEX_TOKEN_WITH_DEFINITION
diff --git a/sql/sql_do.cc b/sql/sql_do.cc
index 6d86ece6a9f..a25bdef3d9d 100644
--- a/sql/sql_do.cc
+++ b/sql/sql_do.cc
@@ -16,7 +16,7 @@
/* Execute DO statement */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "transaction.h"
#include "unireg.h"
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 144cf9d4a30..b1c7481bb8c 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -41,7 +41,7 @@ This file contains the implementation of error and warnings related
***********************************************************************/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_error.h"
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index ca276eb87ac..9fadbd2e6a3 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -18,7 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_select.h"
#include "my_json_writer.h"
diff --git a/sql/sql_expression_cache.cc b/sql/sql_expression_cache.cc
index c79783bf561..00f5bfd792f 100644
--- a/sql/sql_expression_cache.cc
+++ b/sql/sql_expression_cache.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_base.h"
#include "sql_select.h"
#include "sql_expression_cache.h"
diff --git a/sql/sql_get_diagnostics.cc b/sql/sql_get_diagnostics.cc
index 1713cb04ebc..76973b4daa2 100644
--- a/sql/sql_get_diagnostics.cc
+++ b/sql/sql_get_diagnostics.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
+#include "mariadb.h"
#include "sql_list.h" // Sql_alloc, List, List_iterator
#include "sql_cmd.h" // Sql_cmd
#include "sql_class.h" // Diagnostics_area
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index babb09a1267..4a12868979a 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -52,7 +52,7 @@
cursor points at the first record).
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_handler.h"
#include "sql_base.h" // close_thread_tables
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index bd11397e2aa..c5583483ea4 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_help.h"
diff --git a/sql/sql_hset.h b/sql/sql_hset.h
index 4dfddf898f0..dfaf17cf55c 100644
--- a/sql/sql_hset.h
+++ b/sql/sql_hset.h
@@ -15,7 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "my_global.h"
#include "hash.h"
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 6e6a3228d80..ce55e35214c 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -56,7 +56,7 @@
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "sql_insert.h"
#include "sql_update.h" // compare_record
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 12c64caa225..969380721d0 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -27,6 +27,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include "mariadb.h"
#include "key.h"
#include "sql_base.h"
#include "sql_select.h"
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index fbd781a9ae8..223d3c1b86e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -18,7 +18,7 @@
/* A lexical scanner on a temporary buffer with a yacc interface */
#define MYSQL_LEX 1
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h" // sql_lex.h: SQLCOM_END
#include "sql_lex.h"
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 0be7ed2f18d..d2a6a3f43af 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -23,7 +23,6 @@
#include "violite.h" /* SSL_type */
#include "sql_trigger.h"
-#include "item.h" /* From item_subselect.h: subselect_union_engine */
#include "thr_lock.h" /* thr_lock_type, TL_UNLOCK */
#include "mem_root_array.h"
#include "sql_cmd.h"
diff --git a/sql/sql_list.cc b/sql/sql_list.cc
index 2c1b3c47d55..e938d5515c9 100644
--- a/sql/sql_list.cc
+++ b/sql/sql_list.cc
@@ -18,6 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include "mariadb.h"
#include "sql_list.h"
list_node end_of_list;
diff --git a/sql/sql_list.h b/sql/sql_list.h
index e1307f1daa0..031cbd4683e 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -19,7 +19,7 @@
#pragma interface /* gcc class implementation */
#endif
-#include "my_sys.h" /* alloc_root, TRASH, MY_WME,
+#include <my_sys.h> /* alloc_root, TRASH, MY_WME,
MY_FAE, MY_ALLOW_ZERO_PTR */
#include "m_string.h" /* bfill */
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 132da4dff65..8550fc187c1 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -19,7 +19,7 @@
/* Copy data from a textfile to table */
/* 2006-12 Erik Wetterberg : LOAD XML added */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_load.h"
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index a2efa5e072c..f8b96279378 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -20,12 +20,11 @@
!! This file is built from my_locale.pl !!
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_locale.h"
#include "sql_class.h" // THD
-#include "my_sys.h" // MY_*, NullS, NULL
enum err_msgs_index
diff --git a/sql/sql_locale.h b/sql/sql_locale.h
index ec2f3d29e15..d1009832e0c 100644
--- a/sql/sql_locale.h
+++ b/sql/sql_locale.h
@@ -22,7 +22,6 @@ typedef struct my_locale_errmsgs
const char ***errmsgs;
} MY_LOCALE_ERRMSGS;
-#include "my_global.h" /* uint */
typedef struct st_typelib TYPELIB;
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index 8cf849b97d0..eeaf888cc09 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -21,7 +21,7 @@
* o Berkeley DB: removing unneeded log files.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_manager.h"
#include "sql_base.h" // flush_tables
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 5053d311735..3e29853d703 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -15,7 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define MYSQL_LEX 1
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_parse.h" // sql_kill, *_precheck, *_prepare
#include "lock.h" // try_transactional_lock,
diff --git a/sql/sql_parse.h b/sql/sql_parse.h
index b8d7bb46e08..02318442686 100644
--- a/sql/sql_parse.h
+++ b/sql/sql_parse.h
@@ -16,7 +16,6 @@
#ifndef SQL_PARSE_INCLUDED
#define SQL_PARSE_INCLUDED
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_acl.h" /* GLOBAL_ACLS */
class Comp_creator;
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index c3417ce4f08..2614178b622 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -47,7 +47,7 @@
/* Some general useful functions */
#define MYSQL_LEX 1
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_partition.h"
#include "key.h" // key_restore
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index ed330bcc7b9..08e8da3f030 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -15,6 +15,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 "mariadb.h"
#include "sql_parse.h" // check_one_table_access
// check_merge_table_access
// check_one_table_access
diff --git a/sql/sql_plist.h b/sql/sql_plist.h
index df50cccc874..14f6eb5e2aa 100644
--- a/sql/sql_plist.h
+++ b/sql/sql_plist.h
@@ -16,8 +16,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <my_global.h>
-
template <typename T, typename L>
class I_P_List_iterator;
class I_P_List_null_counter;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 81ab849f5e7..9bae754a8c7 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -15,8 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "sql_plugin.h" // Includes my_global.h
-#include "sql_priv.h" // SHOW_MY_BOOL
+#include "sql_plugin.h" // SHOW_MY_BOOL
+#include "sql_priv.h"
#include "unireg.h"
#include "sql_class.h" // set_var.h: THD
#include "sys_vars_shared.h"
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index 469ae5c88a3..f100e8a232a 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -25,7 +25,7 @@
SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_LEX_STRING
-#include <my_global.h>
+#include "mariadb.h"
#undef SHOW_always_last
#include "m_string.h" /* LEX_STRING */
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 4aef8adff09..ef94d06a567 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -84,7 +84,7 @@ When one supplies long data for a placeholder:
at statement execute.
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_class.h" // set_var.h: THD
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 7206162792a..c1a13ebd210 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -29,10 +29,9 @@
- "profiling_history_size", integer, session + global, "Num queries stored?"
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_profile.h"
-#include <my_sys.h>
#include "sql_show.h" // schema_table_store_record
#include "sql_class.h" // THD
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index c01ad90f5d2..057d1a9f46c 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_reload.h"
#include "sql_priv.h"
#include "mysqld.h" // select_errors
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 2cba634e17c..61e312646da 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -19,7 +19,7 @@
Atomic rename of table; RENAME TABLE t1 to t2, tmp to t1 [,...]
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_rename.h"
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index c5fd142f620..3ba81d2195a 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -14,7 +14,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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_base.h"
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5166e7f4c12..047921e6a41 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -29,7 +29,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_select.h"
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index eb9dfe012f7..f19dd540c4e 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -15,6 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "mariadb.h"
#include "sql_class.h"
#include "sql_list.h"
#include "sql_sequence.h"
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index bbed5ac8991..87ff9a99cf2 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -33,7 +33,7 @@
currently running transactions etc will not be disrupted.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_servers.h"
#include "unireg.h"
diff --git a/sql/sql_servers.h b/sql/sql_servers.h
index d5668f0dfcb..1cb05416c63 100644
--- a/sql/sql_servers.h
+++ b/sql/sql_servers.h
@@ -16,7 +16,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "my_global.h" /* uint */
#include "slave.h" // for tables_ok(), rpl_filter
class THD;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ed0d9ae15e9..7e29d7867b9 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -17,7 +17,7 @@
/* Function with list databases, tables or fields */
-#include "sql_plugin.h" // Includes my_global.h
+#include "sql_plugin.h" // SHOW_MY_BOOL
#include "sql_priv.h"
#include "unireg.h"
#include "sql_acl.h" // fill_schema_*_privileges
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
index 6a57b8fc9ce..1e1c2c1d624 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.cc
@@ -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 <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sp_head.h"
#include "sp_pcontext.h"
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index 6c97ad7e9ab..d57239671a8 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_base.h" /* ha_rows */
-#include "my_sys.h" /* qsort2_cmp */
+#include <my_sys.h> /* qsort2_cmp */
#include "queues.h"
typedef struct st_buffpek BUFFPEK;
diff --git a/sql/sql_state.c b/sql/sql_state.c
index 2bfd61d6696..046868a78a7 100644
--- a/sql/sql_state.c
+++ b/sql/sql_state.c
@@ -16,7 +16,7 @@
/* Functions to map mysqld errno to sql_state */
-#include <my_global.h>
+#include "mariadb.h"
#include <mysqld_error.h>
#include <my_base.h>
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 3ec8fea29c6..3c22ad7172f 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -23,7 +23,7 @@
@{
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_base.h"
#include "key.h"
#include "sql_statistics.h"
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 9a21c0a9144..2c35abe3ff0 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -20,8 +20,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
-#include <my_sys.h>
+#include "mariadb.h"
#include <m_string.h>
#include <m_ctype.h>
#include <mysql_com.h>
diff --git a/sql/sql_string.h b/sql/sql_string.h
index adaef04fee4..1551ef361f3 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -25,7 +25,7 @@
#endif
#include "m_ctype.h" /* my_charset_bin */
-#include "my_sys.h" /* alloc_root, my_free, my_realloc */
+#include <my_sys.h> /* alloc_root, my_free, my_realloc */
#include "m_string.h" /* TRASH */
class String;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index beac24ed1c4..e8bc1531de7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -18,7 +18,7 @@
/* drop and alter of tables */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "debug_sync.h"
diff --git a/sql/sql_table.h b/sql/sql_table.h
index 2e080462deb..e45ddef6548 100644
--- a/sql/sql_table.h
+++ b/sql/sql_table.h
@@ -17,8 +17,7 @@
#ifndef SQL_TABLE_INCLUDED
#define SQL_TABLE_INCLUDED
-#include "my_global.h" /* my_bool */
-#include "my_sys.h" // pthread_mutex_t
+#include <my_sys.h> // pthread_mutex_t
#include "m_string.h" // LEX_CUSTRING
class Alter_info;
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
index 8b9e14e5a18..93a3007d1ea 100644
--- a/sql/sql_tablespace.cc
+++ b/sql/sql_tablespace.cc
@@ -15,7 +15,7 @@
/* drop and alter of tablespaces */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_tablespace.h"
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 33a82883f8f..b130cd9ebe2 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -16,7 +16,7 @@
/* Write some debug info */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_test.h"
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index c8ec1fc7f6a..a8a0ffa3cf2 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -17,7 +17,7 @@
/* Functions to handle date and time */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_time.h"
#include "tztime.h" // struct Time_zone
diff --git a/sql/sql_time.h b/sql/sql_time.h
index 03e38c158f6..c6462c93e21 100644
--- a/sql/sql_time.h
+++ b/sql/sql_time.h
@@ -17,7 +17,6 @@
#ifndef SQL_TIME_INCLUDED
#define SQL_TIME_INCLUDED
-#include "my_global.h" /* ulong */
#include "my_time.h"
#include "mysql_time.h" /* timestamp_type */
#include "sql_error.h" /* Sql_condition */
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 291d55d61a2..502d151a60a 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -16,7 +16,7 @@
#define MYSQL_LEX 1
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sp_head.h"
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index d4859efc7af..13b553f8b71 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -14,6 +14,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 "mariadb.h"
#include "debug_sync.h" // DEBUG_SYNC
#include "table.h" // TABLE, FOREIGN_KEY_INFO
#include "sql_class.h" // THD
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 906bc5d0acf..b657bb0b51f 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -14,6 +14,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 "mariadb.h"
#include "sql_type.h"
#include "sql_const.h"
#include "sql_class.h"
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 612cc97f6a2..410b939e10d 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -31,7 +31,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_base.h" // close_mysql_tables
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index d158e1ed571..5cdf726f335 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -20,7 +20,7 @@
UNION's were introduced by Monty and Sinisa <sinisa@mysql.com>
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_union.h"
diff --git a/sql/sql_union.h b/sql/sql_union.h
index 171f607fba7..d5659e5d947 100644
--- a/sql/sql_union.h
+++ b/sql/sql_union.h
@@ -16,8 +16,6 @@
#ifndef SQL_UNION_INCLUDED
#define SQL_UNION_INCLUDED
-#include "my_global.h" /* ulong */
-
class THD;
class select_result;
struct LEX;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 568dd40df46..4d7cef2d752 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -20,7 +20,7 @@
Multi-table updates were introduced by Sinisa & Monty
*/
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "sql_update.h"
#include "sql_cache.h" // query_cache_*
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 5e0cd57f2d9..d6b972d2d73 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -16,7 +16,7 @@
*/
#define MYSQL_LEX 1
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_view.h"
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index ebc668bfd5e..b7d7f0b1785 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -14,6 +14,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 "mariadb.h"
#include "sql_parse.h"
#include "sql_select.h"
#include "sql_list.h"
@@ -21,7 +22,6 @@
#include "filesort.h"
#include "sql_base.h"
#include "sql_window.h"
-#include "my_dbug.h"
bool
diff --git a/sql/sql_window.h b/sql/sql_window.h
index 190b5de9714..4cb9c1362f5 100644
--- a/sql/sql_window.h
+++ b/sql/sql_window.h
@@ -17,7 +17,6 @@
#ifndef SQL_WINDOW_INCLUDED
#define SQL_WINDOW_INCLUDED
-#include "my_global.h"
#include "item.h"
#include "filesort.h"
#include "records.h"
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 283ec486a0d..e337b624e4c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -33,7 +33,7 @@
#define Lex (thd->lex)
#define Select Lex->current_select
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_parse.h" /* comp_*_creator */
#include "sql_table.h" /* primary_key_name */
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index abd3807a9cf..4a093373b49 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -33,7 +33,7 @@
#define Lex (thd->lex)
#define Select Lex->current_select
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "sql_parse.h" /* comp_*_creator */
#include "sql_table.h" /* primary_key_name */
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index 01c9fe4e70b..43a2698c4be 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -15,7 +15,7 @@
/* Some useful string utility functions used by the MySQL server */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "strfunc.h"
diff --git a/sql/strfunc.h b/sql/strfunc.h
index 7f3021e1a6d..1aba0bff422 100644
--- a/sql/strfunc.h
+++ b/sql/strfunc.h
@@ -16,8 +16,6 @@
#ifndef STRFUNC_INCLUDED
#define STRFUNC_INCLUDED
-#include "my_global.h" /* ulonglong, uint */
-
typedef struct st_typelib TYPELIB;
ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs,
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 6c60766edd2..f637a6d5c5a 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -31,7 +31,7 @@
(for example in storage/myisam/ha_myisam.cc) !
*/
-#include "sql_plugin.h" // Includes my_global.h
+#include "sql_plugin.h"
#include "sql_priv.h"
#include "sql_class.h" // set_var.h: THD
#include "sys_vars.ic"
diff --git a/sql/table.cc b/sql/table.cc
index 7432277f448..9641f8c0ca4 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -17,7 +17,7 @@
/* Some general useful functions */
-#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "table.h"
#include "key.h" // find_ref_key
diff --git a/sql/table.h b/sql/table.h
index c9e392c217e..71cf72e6a5f 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -17,7 +17,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_plist.h"
#include "sql_list.h" /* Sql_alloc */
#include "mdl.h"
diff --git a/sql/table_cache.cc b/sql/table_cache.cc
index 2feace30672..0cbc06ff81e 100644
--- a/sql/table_cache.cc
+++ b/sql/table_cache.cc
@@ -46,7 +46,7 @@
TABLE_SHARE::tdc.flushed is true
*/
-#include "my_global.h"
+#include "mariadb.h"
#include "lf.h"
#include "table.h"
#include "sql_base.h"
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc
index 0fc5150cfe1..6474e612097 100644
--- a/sql/temporary_tables.cc
+++ b/sql/temporary_tables.cc
@@ -19,6 +19,7 @@
All methods pertaining to temporary tables.
*/
+#include "mariadb.h"
#include "sql_acl.h" /* TMP_TABLE_ACLS */
#include "sql_base.h" /* tdc_create_key */
#include "lock.h" /* mysql_lock_remove */
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index cbed769a424..74763e81b15 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -17,7 +17,7 @@
/* Mallocs for used in threads */
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "thr_malloc.h"
diff --git a/sql/thr_malloc.h b/sql/thr_malloc.h
index fc23c87c9fd..574dc7966b0 100644
--- a/sql/thr_malloc.h
+++ b/sql/thr_malloc.h
@@ -16,8 +16,6 @@
#ifndef THR_MALLOC_INCLUDED
#define THR_MALLOC_INCLUDED
-#include "my_global.h" // uint, size_t
-
typedef struct st_mem_root MEM_ROOT;
void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size,
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index ae7960da73d..b6e7d0818a5 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include <violite.h>
#include <sql_priv.h>
#include <sql_class.h>
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index 2ab874b2232..7365e99dca6 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include <violite.h>
#include <sql_priv.h>
#include <sql_class.h>
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc
index 855b9b38d78..adaca08982f 100644
--- a/sql/threadpool_win.cc
+++ b/sql/threadpool_win.cc
@@ -19,7 +19,7 @@
#define _WIN32_WINNT 0x0601
-#include <my_global.h>
+#include "mariadb.h"
#include <violite.h>
#include <sql_priv.h>
#include <sql_class.h>
diff --git a/sql/transaction.cc b/sql/transaction.cc
index 78cd3047f82..cbd875e3114 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -18,7 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "transaction.h"
#include "rpl_handler.h"
diff --git a/sql/transaction.h b/sql/transaction.h
index b6b22053150..7e34693a2eb 100644
--- a/sql/transaction.h
+++ b/sql/transaction.h
@@ -20,7 +20,6 @@
#pragma interface /* gcc class implementation */
#endif
-#include <my_global.h>
#include <m_string.h>
class THD;
diff --git a/sql/tztime.cc b/sql/tztime.cc
index a9db91668bb..4581461f8b3 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -29,22 +29,21 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_global.h>
+#include "mariadb.h"
#if !defined(TZINFO2SQL) && !defined(TESTTIME)
#include "sql_priv.h"
#include "unireg.h"
-#include "tztime.h"
#include "sql_time.h" // localtime_to_TIME
#include "sql_base.h" // open_system_tables_for_read,
// close_system_tables
#else
#include <my_time.h>
-#include "tztime.h"
#include <my_sys.h>
#include <mysql_version.h>
#include <my_getopt.h>
#endif
+#include "tztime.h"
#include "tzfile.h"
#include <m_string.h>
#include <my_dir.h>
diff --git a/sql/udf_example.c b/sql/udf_example.c
index 6a0d78078a6..ce39b3461b3 100644
--- a/sql/udf_example.c
+++ b/sql/udf_example.c
@@ -125,7 +125,7 @@ typedef unsigned long long ulonglong;
typedef long long longlong;
#endif /*__WIN__*/
#else
-#include <my_global.h>
+#include "mariadb.h"
#include <my_sys.h>
#if defined(MYSQL_SERVER)
#include <m_string.h> /* To get strmov() */
diff --git a/sql/uniques.cc b/sql/uniques.cc
index da334cc4b8a..ac2f74adced 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -31,7 +31,7 @@
deletes in disk order.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_sort.h"
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 655cfa20c61..cc5e19d1104 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -25,7 +25,7 @@
str is a (long) to record position where 0 is the first position.
*/
-#include <my_global.h>
+#include "mariadb.h"
#include "sql_priv.h"
#include "unireg.h"
#include "sql_partition.h" // struct partition_info
diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc
index cef59513485..93d4ebc495d 100644
--- a/sql/wsrep_applier.cc
+++ b/sql/wsrep_applier.cc
@@ -13,6 +13,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
+#include "mariadb.h"
#include "wsrep_priv.h"
#include "wsrep_binlog.h" // wsrep_dump_rbr_buf()
#include "wsrep_xid.h"
diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc
index ad5ef9c5c55..bddbbb95f4d 100644
--- a/sql/wsrep_binlog.cc
+++ b/sql/wsrep_binlog.cc
@@ -13,6 +13,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
+#include "mariadb.h"
#include "wsrep_binlog.h"
#include "wsrep_priv.h"
#include "log.h"
diff --git a/sql/wsrep_check_opts.cc b/sql/wsrep_check_opts.cc
index 8da791b3429..bf4ce7c9d90 100644
--- a/sql/wsrep_check_opts.cc
+++ b/sql/wsrep_check_opts.cc
@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include "mysqld.h"
#include "sys_vars_shared.h"
#include "wsrep.h"
diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc
index 0aa7f9b0aad..c83f64e9cb4 100644
--- a/sql/wsrep_dummy.cc
+++ b/sql/wsrep_dummy.cc
@@ -13,7 +13,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
-#include <my_global.h>
+#include "mariadb.h"
#include <sql_class.h>
#include <mysql/service_wsrep.h>
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 1121bb65fe3..5eaa89a5be9 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include <mysqld.h>
#include "sql_base.h"
#include "rpl_filter.h"
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 58342b0b97a..05ec182b318 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include <mysqld.h>
#include <sql_class.h>
#include <sql_parse.h>
diff --git a/sql/wsrep_notify.cc b/sql/wsrep_notify.cc
index 92c685ba485..92bcc8eda43 100644
--- a/sql/wsrep_notify.cc
+++ b/sql/wsrep_notify.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include <mysqld.h>
#include "wsrep_priv.h"
#include "wsrep_utils.h"
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 076da23967a..30564a51547 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -13,11 +13,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include "mariadb.h"
#include "wsrep_sst.h"
-
#include <mysqld.h>
#include <m_ctype.h>
-#include <my_sys.h>
#include <strfunc.h>
#include <sql_class.h>
#include <set_var.h>
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index f8db20ace99..cf8c39e89a3 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -13,8 +13,8 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
+#include "mariadb.h"
#include "wsrep_thd.h"
-
#include "transaction.h"
#include "rpl_rli.h"
#include "log_event.h"
diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc
index 9c77cb49256..bff4b10ad83 100644
--- a/sql/wsrep_utils.cc
+++ b/sql/wsrep_utils.cc
@@ -20,6 +20,7 @@
#define _GNU_SOURCE // POSIX_SPAWN_USEVFORK flag
#endif
+#include "mariadb.h"
#include "wsrep_utils.h"
#include "wsrep_mysqld.h"
diff --git a/sql/wsrep_xid.cc b/sql/wsrep_xid.cc
index 2ff6ea0b32e..5af39bfc230 100644
--- a/sql/wsrep_xid.cc
+++ b/sql/wsrep_xid.cc
@@ -16,6 +16,7 @@
//! @file some utility functions and classes not directly related to replication
+#include "mariadb.h"
#include "wsrep_xid.h"
#include "sql_class.h"
#include "wsrep_mysqld.h" // for logging macros
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 7f83905547b..15c5c6a603e 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -21,7 +21,8 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "sql_class.h" // SSV and my_global.h
+#include <my_global.h>
+#include "sql_class.h" // SSV
#include "sql_table.h" // build_table_filename
#include <myisam.h> // T_EXTEND
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 08d35b05932..7d95f06b88e 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -32,6 +32,7 @@
/* plgdbsem.h is header containing the DB applic. declarations. */
/***********************************************************************/
#define DONT_DEFINE_VOID
+#include <my_global.h>
#include "handler.h"
#undef OFFSET
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 72d6ddda8b1..2c19be27bd2 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -107,6 +107,7 @@
#define MYSQL_SERVER 1
#define DONT_DEFINE_VOID
+#include <my_global.h>
#include "sql_class.h"
#include "create_options.h"
#include "mysql_com.h"
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index 906ac734157..2dcf807e9b5 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -28,20 +28,16 @@
/***********************************************************************/
/* Include relevant MariaDB header file. */
/***********************************************************************/
-#include <my_config.h>
+#define DONT_DEFINE_VOID
+#include <my_global.h>
#if defined(__WIN__)
//#include <windows.h>
//#include <sqlext.h>
#elif defined(UNIX)
-#include <sys/types.h>
#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
#endif
-#define DONT_DEFINE_VOID
-//#include <mysql/plugin.h>
#include "handler.h"
#undef OFFSET
diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc
index 32119c34900..4a20226fb31 100644
--- a/storage/connect/user_connect.cc
+++ b/storage/connect/user_connect.cc
@@ -36,6 +36,7 @@
#define DONT_DEFINE_VOID
#define MYSQL_SERVER
+#include <my_global.h>
#include "sql_class.h"
#undef OFFSET
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index ef6530e98e1..d10edb52340 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -20,11 +20,10 @@
#endif
#define MYSQL_SERVER 1
-#include <my_global.h>
+#include "heapdef.h"
#include "sql_priv.h"
#include "sql_plugin.h"
#include "ha_heap.h"
-#include "heapdef.h"
#include "sql_base.h" // enum_tdc_remove_table_type
static handler *heap_create_handler(handlerton *hton,
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index 8706819c182..8d9d1f81c53 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -15,7 +15,8 @@
/* This file is included in all heap-files */
-#include <my_base.h> /* This includes global */
+#include <my_global.h>
+#include <my_base.h>
C_MODE_START
#include <my_pthread.h>
#include "heap.h" /* Structs & some defines */
diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc
index 69cfec10fed..dec641e73b2 100644
--- a/storage/innobase/log/log0crypt.cc
+++ b/storage/innobase/log/log0crypt.cc
@@ -24,6 +24,7 @@ Created 11/25/2013 Minli Zhu Google
Modified Jan Lindström jan.lindstrom@mariadb.com
MDEV-11782: Rewritten for MariaDB 10.2 by Marko Mäkelä, MariaDB Corporation.
*******************************************************/
+#include <my_global.h>
#include "m_string.h"
#include "log0crypt.h"
#include <mysql/service_my_crypt.h>
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index de1f35a876e..ccff9726732 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -24,7 +24,7 @@ New index creation routines using a merge sort
Created 12/4/2005 Jan Lindstrom
Completed by Sunny Bains and Marko Makela
*******************************************************/
-#include <my_config.h>
+#include <my_global.h>
#include <log.h>
#include <sql_class.h>
diff --git a/storage/maria/ma_crypt.c b/storage/maria/ma_crypt.c
index cc605d79933..42895dcdfa4 100644
--- a/storage/maria/ma_crypt.c
+++ b/storage/maria/ma_crypt.c
@@ -15,7 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <my_global.h>
#include "maria_def.h"
#include "ma_blockrec.h"
#include <my_crypt.h>
diff --git a/storage/maria/ma_crypt.h b/storage/maria/ma_crypt.h
index 309a8300eb8..a4e6508977c 100644
--- a/storage/maria/ma_crypt.h
+++ b/storage/maria/ma_crypt.h
@@ -18,8 +18,6 @@
#ifndef STORAGE_MARIA_MA_CRYPT_INCLUDED
#define STORAGE_MARIA_MA_CRYPT_INCLUDED
-#include <my_global.h>
-
struct st_maria_share;
struct st_pagecache_file;
diff --git a/storage/maria/ma_sp_test.c b/storage/maria/ma_sp_test.c
index 64c56a194b5..d3b540e8f7c 100644
--- a/storage/maria/ma_sp_test.c
+++ b/storage/maria/ma_sp_test.c
@@ -16,6 +16,7 @@
/* Testing of the basic functions of a MARIA spatial table */
/* Written by Alex Barkov, who has a shared copyright to this code */
+#include <my_global.h>
#include "maria.h"
#ifdef HAVE_SPATIAL
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index 6f8964fd479..5a8f6178ed6 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -15,6 +15,7 @@
/* This file is included by all internal maria files */
+#include <my_global.h>
#include "maria.h" /* Structs & some defines */
#include "ma_pagecache.h"
#include <myisampack.h> /* packing of keys */
diff --git a/storage/mroonga/mrn_mysql.h b/storage/mroonga/mrn_mysql.h
index 644825dcf39..8a42637a8e4 100644
--- a/storage/mroonga/mrn_mysql.h
+++ b/storage/mroonga/mrn_mysql.h
@@ -21,7 +21,7 @@
#define MRN_MYSQL_H_
#ifdef HAVE_CONFIG_H
-# include <config.h>
+# include <my_global.h>
/* We need to undefine them because my_config.h defines them. :< */
# undef VERSION
# undef PACKAGE
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h
index 5c7f4c64a51..f48403e9119 100644
--- a/storage/myisam/ftdefs.h
+++ b/storage/myisam/ftdefs.h
@@ -18,6 +18,8 @@
/* some definitions for full-text indices */
+/* ftdefs.h is is always included first when used, so we have to include my_global.h here */
+#include <my_global.h>
#include "fulltext.h"
#include <m_ctype.h>
#include <my_tree.h>
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index e9de4cde6fa..f39826d1b50 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -21,13 +21,14 @@
#endif
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_plugin.h"
+#include "myisamdef.h"
#include "sql_priv.h"
#include "key.h" // key_copy
#include <m_ctype.h>
#include <my_bit.h>
#include "ha_myisam.h"
-#include "myisamdef.h"
#include "rt_index.h"
#include "sql_table.h" // tablename_to_filename
#include "sql_class.h" // THD
diff --git a/storage/myisam/mi_cache.c b/storage/myisam/mi_cache.c
index edcc3520c35..6fa599ff981 100644
--- a/storage/myisam/mi_cache.c
+++ b/storage/myisam/mi_cache.c
@@ -33,7 +33,6 @@
as these reads will be cached by OS cache (and mysql_file_pread is always atomic)
*/
-
#include "myisamdef.h"
int _mi_read_cache(IO_CACHE *info, uchar *buff, my_off_t pos, uint length,
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index b65bb8b78bd..503fa1a50ee 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -42,7 +42,6 @@
#include "ftdefs.h"
#include <m_ctype.h>
-#include <stdarg.h>
#include <my_getopt.h>
#ifdef HAVE_SYS_VADVISE_H
#include <sys/vadvise.h>
diff --git a/storage/myisam/mi_rnext.c b/storage/myisam/mi_rnext.c
index 509cd75fbab..6e3701abe6b 100644
--- a/storage/myisam/mi_rnext.c
+++ b/storage/myisam/mi_rnext.c
@@ -15,7 +15,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "myisamdef.h"
-
#include "rt_index.h"
/*
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index d90a8549e1e..bc1f6438e31 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -16,6 +16,7 @@
/* Testing of the basic functions of a MyISAM table */
+#include <my_global.h>
#include "myisam.h"
#include <my_getopt.h>
#include <m_string.h>
diff --git a/storage/myisam/mi_test3.c b/storage/myisam/mi_test3.c
index e05398f7c4a..6922655450b 100644
--- a/storage/myisam/mi_test3.c
+++ b/storage/myisam/mi_test3.c
@@ -17,6 +17,7 @@
#ifndef _WIN32 /*no fork() in Windows*/
+#include <my_global.h>
#include "myisam.h"
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 0d718f0a22e..1431f98ec1b 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -17,6 +17,7 @@
/* This file is included by all internal myisam files */
+#include <my_global.h>
#include <myisam.h> /* Structs & some defines */
#include <myisampack.h> /* packing of keys */
#include <my_tree.h>
diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c
index 8b537d134ef..a24009e90ac 100644
--- a/storage/myisam/rt_test.c
+++ b/storage/myisam/rt_test.c
@@ -17,6 +17,7 @@
/* Written by Alex Barkov who has a shared copyright to this code */
+#include <my_global.h>
#include "myisam.h"
#ifdef HAVE_RTREE_KEYS
diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c
index d573d96086e..474468ab0ff 100644
--- a/storage/myisam/sp_test.c
+++ b/storage/myisam/sp_test.c
@@ -16,6 +16,7 @@
/* Testing of the basic functions of a MyISAM spatial table */
/* Written by Alex Barkov, who has a shared copyright to this code */
+#include <my_global.h>
#include "myisam.h"
#ifdef HAVE_SPATIAL
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 4b858d468f5..82b78285a49 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -39,7 +39,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_config.h>
+#include <my_global.h>
#define MYSQL_SERVER 1 // to have THD
/* For the moment, include code to deal with integer latches.
* I have wrapped it with this #ifdef to make it easier to find and remove in the future.
diff --git a/storage/oqgraph/oqgraph_thunk.cc b/storage/oqgraph/oqgraph_thunk.cc
index 2ebd0171f9c..1d0c651bec4 100644
--- a/storage/oqgraph/oqgraph_thunk.cc
+++ b/storage/oqgraph/oqgraph_thunk.cc
@@ -22,13 +22,24 @@
======================================================================
*/
-#include <my_config.h>
+#define MYSQL_SERVER
+#include <my_global.h>
#include "oqgraph_thunk.h"
#include <boost/tuple/tuple.hpp>
-#define MYSQL_SERVER
-#include <my_global.h>
+/* This is needed as boost undef's isfinite */
+#ifndef isfinite
+#ifdef HAVE_FINITE
+#define isfinite(x) finite(x)
+#else
+#define isfinite(x) (1.0 / fabs(x) > 0.0)
+#endif /* HAVE_FINITE */
+#elif (__cplusplus >= 201103L)
+#include <cmath>
+static inline bool isfinite(double x) { return std::isfinite(x); }
+#endif /* isfinite */
+
#include "unireg.h"
#include "sql_base.h"
#include "table.h"
@@ -40,7 +51,6 @@
#define user_defined_key_parts key_parts
#endif
-
static int debugid = 0;
oqgraph3::vertex_id oqgraph3::edge_info::origid() const
diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h
index 5f543d80375..6ab365d6a43 100644
--- a/storage/perfschema/pfs.h
+++ b/storage/perfschema/pfs.h
@@ -23,7 +23,6 @@
#define HAVE_PSI_1
-#include <my_global.h>
#include <my_pthread.h>
#include <mysql/psi/psi.h>
diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc
index 01cf0d73771..db3011c606b 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -18,6 +18,7 @@
Default setup (implementation).
*/
+#include <my_global.h>
#include "pfs.h"
#include "pfs_defaults.h"
#include "pfs_instr.h"
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index bd346f2b235..fe1670d0192 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -18,6 +18,7 @@
Miscellaneous global dependencies (implementation).
*/
+#include <my_global.h>
#include "pfs_global.h"
#include <my_sys.h>
#include <my_net.h>
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index 7373f459599..c6ff2dce361 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -16,7 +16,6 @@
#ifndef PFS_GLOBAL_H
#define PFS_GLOBAL_H
-#include "my_global.h"
#include "my_compiler.h"
/**
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index b25f5769b69..131533fcc73 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -29,12 +29,12 @@ struct PFS_table_share;
struct PFS_thread_class;
struct PFS_socket_class;
+#include "my_global.h"
#ifdef __WIN__
#include <winsock2.h>
#else
#include <arpa/inet.h>
#endif
-#include "my_global.h"
#include "my_compiler.h"
#include "pfs_lock.h"
#include "pfs_stat.h"
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 2aed519a903..d1ed87d5bb9 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+#include <my_global.h>
#include "table_session_account_connect_attrs.h"
THR_LOCK table_session_account_connect_attrs::m_table_lock;
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index 17c608a7f4c..935ea5c7d30 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+#include <my_global.h>
#include "table_session_connect.h"
table_session_connect::table_session_connect(const PFS_engine_table_share *share)
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index 840167a40e9..886a8dc6725 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+#include <my_global.h>
#include "table_session_connect_attrs.h"
THR_LOCK table_session_connect_attrs::m_table_lock;
diff --git a/storage/rocksdb/event_listener.cc b/storage/rocksdb/event_listener.cc
index 5854da54210..f949f166b2e 100644
--- a/storage/rocksdb/event_listener.cc
+++ b/storage/rocksdb/event_listener.cc
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
+#include <my_global.h>
/* The C++ file's header */
#include "./event_listener.h"
@@ -24,7 +24,6 @@
#include <vector>
/* MySQL includes */
-#include <my_global.h>
#include <mysql/plugin.h>
/* MyRocks includes */
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 239bb47ab2c..b31b430b159 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -23,7 +23,7 @@
/* For use of 'PRIu64': */
#define __STDC_FORMAT_MACROS
-#include <my_config.h>
+#include <my_global.h>
#include <inttypes.h>
diff --git a/storage/rocksdb/properties_collector.cc b/storage/rocksdb/properties_collector.cc
index 368e6d88d1c..ee47306afa9 100644
--- a/storage/rocksdb/properties_collector.cc
+++ b/storage/rocksdb/properties_collector.cc
@@ -14,9 +14,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
#ifdef _WIN32
#define _CRT_RAND_S
+#endif
+#include <my_global.h>
+#ifdef _WIN32
#include <stdlib.h>
#define rand_r rand_s
#endif
diff --git a/storage/rocksdb/rdb_cf_manager.cc b/storage/rocksdb/rdb_cf_manager.cc
index 9e2594ee246..531243dcd0f 100644
--- a/storage/rocksdb/rdb_cf_manager.cc
+++ b/storage/rocksdb/rdb_cf_manager.cc
@@ -21,7 +21,7 @@
/* For use of 'PRIu64': */
#define __STDC_FORMAT_MACROS
-#include <my_config.h>
+#include <my_global.h>
#include <inttypes.h>
diff --git a/storage/rocksdb/rdb_cf_options.cc b/storage/rocksdb/rdb_cf_options.cc
index e608580c666..d5521e62cab 100644
--- a/storage/rocksdb/rdb_cf_options.cc
+++ b/storage/rocksdb/rdb_cf_options.cc
@@ -18,7 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_config.h>
+#include <my_global.h>
/* This C++ files header file */
#include "./rdb_cf_options.h"
diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc
index 54cb5e5d402..f0beb42fc24 100644
--- a/storage/rocksdb/rdb_datadic.cc
+++ b/storage/rocksdb/rdb_datadic.cc
@@ -21,7 +21,7 @@
/* For use of 'PRIu64': */
#define __STDC_FORMAT_MACROS
-#include <my_config.h>
+#include <my_global.h>
/* This C++ file's header file */
#include "./rdb_datadic.h"
diff --git a/storage/rocksdb/rdb_i_s.cc b/storage/rocksdb/rdb_i_s.cc
index e89ff6eedb8..631cb2e06b3 100644
--- a/storage/rocksdb/rdb_i_s.cc
+++ b/storage/rocksdb/rdb_i_s.cc
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
+#include <my_global.h>
/* C++ standard header files */
#include <algorithm>
diff --git a/storage/rocksdb/rdb_index_merge.cc b/storage/rocksdb/rdb_index_merge.cc
index c31d0864b7b..3a6e1cdaf97 100644
--- a/storage/rocksdb/rdb_index_merge.cc
+++ b/storage/rocksdb/rdb_index_merge.cc
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
+#include <my_global.h>
/* This C++ file's header file */
#include "./rdb_index_merge.h"
diff --git a/storage/rocksdb/rdb_mariadb_server_port.cc b/storage/rocksdb/rdb_mariadb_server_port.cc
index 84a800807eb..eab208d51a3 100644
--- a/storage/rocksdb/rdb_mariadb_server_port.cc
+++ b/storage/rocksdb/rdb_mariadb_server_port.cc
@@ -1,4 +1,4 @@
-#include <my_config.h>
+#include <my_global.h>
/* MySQL includes */
@@ -6,7 +6,6 @@
#include "./my_bit.h"
#include "./my_stacktrace.h"
#include "./sql_table.h"
-#include "./my_global.h"
#include "./log.h"
#include <mysys_err.h>
#include <mysql/psi/mysql_table.h>
diff --git a/storage/rocksdb/rdb_mutex_wrapper.cc b/storage/rocksdb/rdb_mutex_wrapper.cc
index ed81bc0dc90..ae41baf5dc0 100644
--- a/storage/rocksdb/rdb_mutex_wrapper.cc
+++ b/storage/rocksdb/rdb_mutex_wrapper.cc
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
+#include <my_global.h>
/* This C++ file's header file */
#include "./rdb_mutex_wrapper.h"
diff --git a/storage/rocksdb/rdb_perf_context.cc b/storage/rocksdb/rdb_perf_context.cc
index 8dd7b6ff0d5..6047a9f404e 100644
--- a/storage/rocksdb/rdb_perf_context.cc
+++ b/storage/rocksdb/rdb_perf_context.cc
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
+#include <my_global.h>
#include "rdb_mariadb_port.h"
/* This C++ file's header file */
diff --git a/storage/rocksdb/rdb_sst_info.cc b/storage/rocksdb/rdb_sst_info.cc
index 8ca00bb30f5..75a9a182fab 100644
--- a/storage/rocksdb/rdb_sst_info.cc
+++ b/storage/rocksdb/rdb_sst_info.cc
@@ -17,7 +17,7 @@
/* For PRIu64 use below: */
#define __STDC_FORMAT_MACROS
-#include <my_config.h>
+#include <my_global.h>
/* This C++ file's header file */
#include "./rdb_sst_info.h"
diff --git a/storage/rocksdb/rdb_threads.cc b/storage/rocksdb/rdb_threads.cc
index b4bba8d3087..1349133876f 100644
--- a/storage/rocksdb/rdb_threads.cc
+++ b/storage/rocksdb/rdb_threads.cc
@@ -19,7 +19,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include <my_config.h>
+#include <my_global.h>
/* The C++ file's header */
#include "./rdb_threads.h"
diff --git a/storage/rocksdb/rdb_utils.cc b/storage/rocksdb/rdb_utils.cc
index 6f14e5048dd..f6275acce36 100644
--- a/storage/rocksdb/rdb_utils.cc
+++ b/storage/rocksdb/rdb_utils.cc
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#include <my_config.h>
+#include <my_global.h>
/* This C++ file's header */
#include "./rdb_utils.h"
diff --git a/storage/rocksdb/tools/mysql_ldb.cc b/storage/rocksdb/tools/mysql_ldb.cc
index ac61eb4f257..b1eec03f214 100644
--- a/storage/rocksdb/tools/mysql_ldb.cc
+++ b/storage/rocksdb/tools/mysql_ldb.cc
@@ -3,7 +3,7 @@
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
-#include <my_config.h>
+#include <my_global.h>
#include "../rdb_comparator.h"
#include "rocksdb/ldb_tool.h"
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index be57c04806b..db61e91d320 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -22,6 +22,7 @@
#define _CRT_NONSTDC_NO_DEPRECATE 1
#endif
+#include <my_global.h>
#include <mysql_version.h>
#if MYSQL_VERSION_ID>=50515
diff --git a/storage/sphinx/snippets_udf.cc b/storage/sphinx/snippets_udf.cc
index 2a290bd8de9..2015483d347 100644
--- a/storage/sphinx/snippets_udf.cc
+++ b/storage/sphinx/snippets_udf.cc
@@ -13,8 +13,7 @@
// did not, you can find it at http://www.gnu.org/
//
-#include <my_config.h>
-#include <stdio.h>
+#include <my_global.h>
#include <string.h>
#include <assert.h>
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 7ed8661cc74..daf2a6fe213 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -18,6 +18,7 @@
#endif
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
index 5c96fe321bd..01ed4a19ee0 100644
--- a/storage/spider/spd_conn.cc
+++ b/storage/spider/spd_conn.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc
index d29ea635d97..58ec690bd8d 100644
--- a/storage/spider/spd_copy_tables.cc
+++ b/storage/spider/spd_copy_tables.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index ce425e9a65e..d235fe1eba7 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_db_handlersocket.cc b/storage/spider/spd_db_handlersocket.cc
index 51b1d1f1752..5ffa00f5fe6 100644
--- a/storage/spider/spd_db_handlersocket.cc
+++ b/storage/spider/spd_db_handlersocket.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 385b122c274..89aefe4c080 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_db_oracle.cc b/storage/spider/spd_db_oracle.cc
index 5b322b9c4d7..3e0b96c8492 100644
--- a/storage/spider/spd_db_oracle.cc
+++ b/storage/spider/spd_db_oracle.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_direct_sql.cc b/storage/spider/spd_direct_sql.cc
index dc1786796e6..1aa532e500b 100644
--- a/storage/spider/spd_direct_sql.cc
+++ b/storage/spider/spd_direct_sql.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_i_s.cc b/storage/spider/spd_i_s.cc
index a525928344f..a9bdab638a1 100644
--- a/storage/spider/spd_i_s.cc
+++ b/storage/spider/spd_i_s.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_malloc.cc b/storage/spider/spd_malloc.cc
index 8d348682edf..acf32e48966 100644
--- a/storage/spider/spd_malloc.cc
+++ b/storage/spider/spd_malloc.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index 39d5ba87c0b..390dec43a16 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -14,6 +14,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc
index 77a2969d061..a4d731bb0a5 100644
--- a/storage/spider/spd_ping_table.cc
+++ b/storage/spider/spd_ping_table.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc
index a140fba7915..0700aeec6b2 100644
--- a/storage/spider/spd_sys_table.cc
+++ b/storage/spider/spd_sys_table.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 4b677b3b2fe..64bfce88d1c 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index 8ba46774cfb..f0519bb334b 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/test_sql_discovery/test_sql_discovery.cc b/storage/test_sql_discovery/test_sql_discovery.cc
index e9efa47a4ec..6314903aa48 100644
--- a/storage/test_sql_discovery/test_sql_discovery.cc
+++ b/storage/test_sql_discovery/test_sql_discovery.cc
@@ -22,6 +22,7 @@
uses discovery via frm shipping.
*/
+#include <my_global.h>
#include <mysql_version.h>
#include <handler.h>
#include <table.h>
diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h
index a03f365d724..f6d70c7026a 100644
--- a/storage/tokudb/hatoku_defines.h
+++ b/storage/tokudb/hatoku_defines.h
@@ -26,8 +26,8 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#ifndef _HATOKU_DEFINES_H
#define _HATOKU_DEFINES_H
-#include <my_config.h>
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "mysql_version.h"
#include "sql_table.h"
#include "handler.h"
diff --git a/strings/json_lib.c b/strings/json_lib.c
index b0c843caec1..ebbf45fc668 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -1,8 +1,6 @@
#include <my_global.h>
#include <string.h>
#include <m_ctype.h>
-
-
#include "json_lib.h"
/*
diff --git a/unittest/mysys/dynstring-t.c b/unittest/mysys/dynstring-t.c
index fed8488da2c..5343f854acd 100644
--- a/unittest/mysys/dynstring-t.c
+++ b/unittest/mysys/dynstring-t.c
@@ -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 <my_global.h>
+#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
#include <tap.h>
diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc
index 36860892508..2f36127af6d 100644
--- a/unittest/sql/mf_iocache-t.cc
+++ b/unittest/sql/mf_iocache-t.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
+#include <my_global.h>
#include <my_sys.h>
#include <my_crypt.h>
#include <tap.h>