summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysql_plugin.c5
-rw-r--r--client/mysqlslap.c2
-rw-r--r--extra/comp_err.c1
-rw-r--r--include/m_string.h8
-rw-r--r--include/maria.h2
-rw-r--r--libmysqld/emb_qcache.cc2
-rw-r--r--plugin/semisync/semisync.h4
-rw-r--r--sql/datadict.cc1
-rw-r--r--sql/debug_sync.cc1
-rw-r--r--sql/derror.cc1
-rw-r--r--sql/des_key_file.cc2
-rw-r--r--sql/discover.cc1
-rw-r--r--sql/event_data_objects.cc2
-rw-r--r--sql/event_db_repository.cc1
-rw-r--r--sql/event_parse_data.cc1
-rw-r--r--sql/event_queue.cc1
-rw-r--r--sql/event_scheduler.cc1
-rw-r--r--sql/events.cc1
-rw-r--r--sql/field.cc2
-rw-r--r--sql/field_conv.cc1
-rw-r--r--sql/filesort.cc2
-rw-r--r--sql/gstream.cc1
-rw-r--r--sql/ha_ndbcluster.cc1
-rw-r--r--sql/ha_ndbcluster_binlog.cc1
-rw-r--r--sql/ha_ndbcluster_cond.cc1
-rw-r--r--sql/ha_partition.cc1
-rw-r--r--sql/handler.cc1
-rw-r--r--sql/hash_filo.cc1
-rw-r--r--sql/hostname.cc1
-rw-r--r--sql/init.cc1
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_buff.cc1
-rw-r--r--sql/item_cmpfunc.cc1
-rw-r--r--sql/item_create.cc1
-rw-r--r--sql/item_geofunc.cc1
-rw-r--r--sql/item_inetfunc.cc1
-rw-r--r--sql/item_row.cc1
-rw-r--r--sql/item_strfunc.cc6
-rw-r--r--sql/item_subselect.cc1
-rw-r--r--sql/item_sum.cc1
-rw-r--r--sql/item_timefunc.cc1
-rw-r--r--sql/item_xmlfunc.cc1
-rw-r--r--sql/key.cc1
-rw-r--r--sql/lock.cc2
-rw-r--r--sql/log.cc2
-rw-r--r--sql/log_event.cc3
-rw-r--r--sql/log_event_old.cc2
-rw-r--r--sql/mf_iocache.cc1
-rw-r--r--sql/mysql_install_db.cc1
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/net_serv.cc1
-rw-r--r--sql/opt_range.cc1
-rw-r--r--sql/opt_subselect.cc1
-rw-r--r--sql/opt_sum.cc1
-rw-r--r--sql/parse_file.cc2
-rw-r--r--sql/partition_info.cc1
-rw-r--r--sql/procedure.cc1
-rw-r--r--sql/protocol.cc1
-rw-r--r--sql/records.cc1
-rw-r--r--sql/records.h1
-rw-r--r--sql/repl_failsafe.cc1
-rw-r--r--sql/rpl_filter.cc1
-rw-r--r--sql/rpl_gtid.cc2
-rw-r--r--sql/rpl_handler.cc1
-rw-r--r--sql/rpl_injector.cc1
-rw-r--r--sql/rpl_record.cc1
-rw-r--r--sql/rpl_record_old.cc1
-rw-r--r--sql/rpl_reporting.cc1
-rw-r--r--sql/rpl_rli.cc1
-rw-r--r--sql/rpl_tblmap.cc2
-rw-r--r--sql/rpl_utility.cc1
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sp.cc1
-rw-r--r--sql/sp_cache.cc1
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/sp_pcontext.cc1
-rw-r--r--sql/sp_rcontext.cc1
-rw-r--r--sql/spatial.cc2
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_admin.cc2
-rw-r--r--sql/sql_analyse.cc1
-rw-r--r--sql/sql_audit.cc1
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_binlog.cc1
-rw-r--r--sql/sql_bootstrap.cc3
-rw-r--r--sql/sql_cache.cc2
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_client.cc1
-rw-r--r--sql/sql_connect.cc2
-rw-r--r--sql/sql_crypt.cc1
-rw-r--r--sql/sql_cursor.cc1
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_delete.cc1
-rw-r--r--sql/sql_derived.cc2
-rw-r--r--sql/sql_do.cc1
-rw-r--r--sql/sql_error.cc1
-rw-r--r--sql/sql_explain.cc1
-rw-r--r--sql/sql_expression_cache.cc1
-rw-r--r--sql/sql_handler.cc1
-rw-r--r--sql/sql_help.cc1
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_load.cc1
-rw-r--r--sql/sql_locale.cc1
-rw-r--r--sql/sql_manager.cc1
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_partition.cc2
-rw-r--r--sql/sql_plugin.cc2
-rw-r--r--sql/sql_prepare.cc2
-rw-r--r--sql/sql_priv.h4
-rw-r--r--sql/sql_profile.cc4
-rw-r--r--sql/sql_reload.cc1
-rw-r--r--sql/sql_rename.cc1
-rw-r--r--sql/sql_repl.cc1
-rw-r--r--sql/sql_select.cc1
-rw-r--r--sql/sql_servers.cc1
-rw-r--r--sql/sql_show.cc2
-rw-r--r--sql/sql_signal.cc1
-rw-r--r--sql/sql_statistics.cc1
-rw-r--r--sql/sql_table.cc1
-rw-r--r--sql/sql_tablespace.cc1
-rw-r--r--sql/sql_test.cc2
-rw-r--r--sql/sql_time.cc1
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_udf.cc1
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/sql_update.cc2
-rw-r--r--sql/sql_view.cc2
-rw-r--r--sql/sys_vars.cc2
-rw-r--r--sql/table.cc2
-rw-r--r--sql/thr_malloc.cc1
-rw-r--r--sql/transaction.cc1
-rw-r--r--sql/uniques.cc1
-rw-r--r--sql/unireg.cc2
-rw-r--r--sql/unireg.h3
-rw-r--r--storage/archive/ha_archive.cc2
-rw-r--r--storage/blackhole/ha_blackhole.cc1
-rw-r--r--storage/csv/ha_tina.cc3
-rw-r--r--storage/csv/transparent_file.cc1
-rw-r--r--storage/federated/ha_federated.cc1
-rw-r--r--storage/federatedx/federatedx_io.cc2
-rw-r--r--storage/federatedx/federatedx_io_mysql.cc2
-rw-r--r--storage/federatedx/federatedx_io_null.cc2
-rw-r--r--storage/federatedx/federatedx_txn.cc2
-rw-r--r--storage/heap/ha_heap.cc1
-rw-r--r--storage/innobase/handler/handler0alter.cc1
-rw-r--r--storage/maria/ha_maria.cc2
-rw-r--r--storage/maria/unittest/ma_maria_log_cleanup.c1
-rw-r--r--storage/maria/unittest/test_file.c2
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/oqgraph/oqgraph_thunk.cc5
-rw-r--r--storage/spider/ha_spider.cc1
-rw-r--r--storage/spider/hs_client/config.cpp1
-rw-r--r--storage/spider/hs_client/escape.cpp1
-rw-r--r--storage/spider/hs_client/fatal.cpp1
-rw-r--r--storage/spider/hs_client/hstcpcli.cpp1
-rw-r--r--storage/spider/hs_client/socket.cpp1
-rw-r--r--storage/spider/hs_client/string_util.cpp1
-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.cc1
-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/xtradb/handler/handler0alter.cc1
-rw-r--r--storage/xtradb/handler/i_s.cc1
176 files changed, 176 insertions, 88 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index 99da157f8c6..034f021109a 100644
--- a/client/mysql_plugin.c
+++ b/client/mysql_plugin.c
@@ -15,14 +15,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <my_global.h>
#include <m_string.h>
#include <mysql.h>
#include <my_getopt.h>
#include <my_dir.h>
-#include <my_global.h>
-#include <stdio.h>
-#include <string.h>
-
#define SHOW_VERSION "1.0.0"
#define PRINT_VERSION do { printf("%s Ver %s Distrib %s\n", \
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 01064f74261..b67e409ef0b 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -84,9 +84,7 @@ TODO:
#include <mysqld_error.h>
#include <my_dir.h>
#include <signal.h>
-#include <stdarg.h>
#include <sslopt-vars.h>
-#include <sys/types.h>
#ifndef __WIN__
#include <sys/wait.h>
#endif
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 59fa508a7fe..3fc4b05fa61 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -30,7 +30,6 @@
#include <my_sys.h>
#include <m_string.h>
#include <my_getopt.h>
-#include <assert.h>
#include <my_dir.h>
#define MAX_ROWS 2000
diff --git a/include/m_string.h b/include/m_string.h
index 395fd2ddda6..188802bc08b 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -34,14 +34,6 @@
#include <string.h>
#endif
-/* need by my_vsnprintf */
-#include <stdarg.h>
-
-/* This is needed for the definitions of bzero... on solaris */
-#if defined(HAVE_STRINGS_H)
-#include <strings.h>
-#endif
-
/* This is needed for the definitions of memcpy... on solaris */
#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
#include <memory.h>
diff --git a/include/maria.h b/include/maria.h
index 908825b9970..16a9beab62a 100644
--- a/include/maria.h
+++ b/include/maria.h
@@ -23,12 +23,10 @@
extern "C" {
#endif
#include <my_base.h>
-#include <my_sys.h>
#include <m_ctype.h>
#include "my_compare.h"
#include "ft_global.h"
#include <myisamchk.h>
-#include <mysql/plugin.h>
#define MARIA_CANNOT_ROLLBACK
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index ccdfaf286eb..a1a66421db8 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -13,8 +13,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_priv.h"
#include "my_global.h" // HAVE_*
+#include "sql_priv.h"
#ifdef HAVE_QUERY_CACHE
#include <mysql.h>
diff --git a/plugin/semisync/semisync.h b/plugin/semisync/semisync.h
index 0e801428a56..28577296817 100644
--- a/plugin/semisync/semisync.h
+++ b/plugin/semisync/semisync.h
@@ -21,12 +21,10 @@
#define MYSQL_SERVER
#define HAVE_REPLICATION
+#include <my_pthread.h>
#include <sql_priv.h>
#include <sql_class.h>
#include "unireg.h"
-#include <my_global.h>
-#include <my_pthread.h>
-#include <mysql/plugin.h>
#include <replication.h>
#include "log.h" /* sql_print_information */
diff --git a/sql/datadict.cc b/sql/datadict.cc
index deeedcd512d..62d60ed15a1 100644
--- a/sql/datadict.cc
+++ b/sql/datadict.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 <my_global.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 35b838d7c3d..2980ecd7dbf 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -15,6 +15,7 @@
/* see include/mysql/service_debug_sync.h for debug sync documentation */
+#include <my_global.h>
#include "debug_sync.h"
#if defined(ENABLED_DEBUG_SYNC)
diff --git a/sql/derror.cc b/sql/derror.cc
index 74e8209496b..f19f73238fb 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -21,6 +21,7 @@
Read language depeneded messagefile
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "derror.h"
diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc
index b6b6f4536bc..ede2e9fa9d4 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 <my_global.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 9351cf034ab..82648e94bc5 100644
--- a/sql/discover.cc
+++ b/sql/discover.cc
@@ -21,6 +21,7 @@
Functions for discover of frm file from handler
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "discover.h"
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index d65180a60be..09256a34853 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 <my_global.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 b20269b8304..30dffc30edd 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.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 <my_global.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 7647419aff9..56c6c3cc13c 100644
--- a/sql/event_parse_data.cc
+++ b/sql/event_parse_data.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 <my_global.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 0324e05fb27..35187af23ac 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.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 "sql_priv.h"
#include "unireg.h"
#include "event_queue.h"
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index 6091977cc8d..ed89d08d845 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "event_scheduler.h"
diff --git a/sql/events.cc b/sql/events.cc
index 63627b21777..cf4c4a8fe75 100644
--- a/sql/events.cc
+++ b/sql/events.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 <my_global.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 103a8920d7e..1beb5994cd5 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -27,6 +27,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_select.h"
#include "rpl_rli.h" // Pull in Relay_log_info
@@ -41,7 +42,6 @@
#include "filesort.h" // change_double_for_sort
#include "log_event.h" // class Table_map_log_event
#include <m_ctype.h>
-#include <errno.h>
// Maximum allowed exponent value for converting string to decimal
#define MAX_EXPONENT 1024
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 3c65dc157e9..65f3e71f430 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -27,6 +27,7 @@
gives much more speed.
*/
+#include <my_global.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 23cfd6a1817..509a7f8e9b3 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -22,6 +22,7 @@
Sorts a database
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "filesort.h"
#include "unireg.h" // REQUIRED by other includes
@@ -39,7 +40,6 @@
#include "sql_select.h"
#include "log_slow.h"
#include "debug_sync.h"
-#include "sql_base.h"
/// How to write record_ref.
#define WRITE_REF(file,from) \
diff --git a/sql/gstream.cc b/sql/gstream.cc
index 3a9e478c376..adb46083621 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -18,6 +18,7 @@
NOTE: These functions assumes that the string is end \0 terminated!
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "gstream.h"
#include "m_string.h" // LEX_STRING
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 9524a0366d3..ed05521a473 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -25,6 +25,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_table.h" // build_table_filename,
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 531211eb175..73513ac9f40 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -15,6 +15,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_show.h"
diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc
index fd80304d400..f39e72e1549 100644
--- a/sql/ha_ndbcluster_cond.cc
+++ b/sql/ha_ndbcluster_cond.cc
@@ -22,6 +22,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_class.h" // set_var.h: THD
#include "my_global.h" // WITH_*
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 4420f2c7e07..d8fc647d2a2 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -46,6 +46,7 @@
if this file.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_parse.h" // append_file_to_dir
#include "create_options.h"
diff --git a/sql/handler.cc b/sql/handler.cc
index 179311c65bb..41d5501a954 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -20,6 +20,7 @@
Handler-calling-functions
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "rpl_handler.h"
diff --git a/sql/hash_filo.cc b/sql/hash_filo.cc
index 7c275ffc617..fc89bb83a9d 100644
--- a/sql/hash_filo.cc
+++ b/sql/hash_filo.cc
@@ -23,6 +23,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "hash_filo.h"
diff --git a/sql/hostname.cc b/sql/hostname.cc
index c6c58a0db92..1879d056623 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -24,6 +24,7 @@
Hostnames are checked with reverse name lookup and checked that they
doesn't resemble an IP address.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "hostname.h"
#include "my_global.h"
diff --git a/sql/init.cc b/sql/init.cc
index 86915b7aa01..91b4b220bf3 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -21,6 +21,7 @@
Init and dummy functions for interface with unireg
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "init.h"
#include "my_sys.h"
diff --git a/sql/item.cc b/sql/item.cc
index 447137a1f68..2e7012e13f8 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include <mysql.h>
diff --git a/sql/item_buff.cc b/sql/item_buff.cc
index a08ae8d8403..d1134525f7b 100644
--- a/sql/item_buff.cc
+++ b/sql/item_buff.cc
@@ -22,6 +22,7 @@
Buffers to save and compare item values
*/
+#include <my_global.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 289668f24ca..fdc6df6fd94 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -26,6 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 fa8249c3321..852891f7743 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -22,6 +22,7 @@
Functions to create an item. Used by sql_yac.yy
*/
+#include <my_global.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 d9200b3e8d3..6d7a6a5e6ff 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -27,6 +27,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 627ef728a2e..6a09747fa1a 100644
--- a/sql/item_inetfunc.cc
+++ b/sql/item_inetfunc.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 <my_global.h>
#include "item_inetfunc.h"
#include "my_net.h"
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 6345eaa864b..3548a6b9b75 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.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 <my_global.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 01ff2d412f2..f4629b6fc0f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -31,10 +31,10 @@
#pragma implementation // gcc: Class implementation
#endif
-/* May include caustic 3rd-party defs. Use early, so it can override nothing. */
-#include "sha2.h"
-#include "my_global.h" // HAVE_*
+#include <my_global.h> // HAVE_*
+/* May include caustic 3rd-party defs. Use early, so it can override nothing */
+#include "sha2.h"
#include "sql_priv.h"
/*
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 7db7b014d28..a0fca36452c 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -29,6 +29,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 2dadf8b8835..21f14ae8435 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -26,6 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_select.h"
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 4a8bb4cc77d..c872ca631e4 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -30,6 +30,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 932f4245c27..f8bf7cbf93a 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -17,6 +17,7 @@
#pragma implementation
#endif
+#include <my_global.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 3556ecf82d7..e3787ea7869 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -16,6 +16,7 @@
/* Functions to handle keys and fields in forms */
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: by includes later
#include "key.h" // key_rec_cmp
diff --git a/sql/lock.cc b/sql/lock.cc
index 54c7720e750..fbed8d8331c 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -74,6 +74,7 @@
we are forced to use mysql_lock_merge.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "debug_sync.h"
#include "unireg.h" // REQUIRED: for other includes
@@ -82,7 +83,6 @@
#include "sql_parse.h" // is_log_table_write_query
#include "sql_acl.h" // SUPER_ACL
#include <hash.h>
-#include <assert.h>
/**
@defgroup Locking Locking
diff --git a/sql/log.cc b/sql/log.cc
index 4b18c14ff79..ac30f69c860 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "log.h"
#include "sql_base.h" // open_log_table
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 83eeb55bec8..1cb8da55aee 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -16,12 +16,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <my_global.h>
#include "sql_priv.h"
#include "mysqld_error.h"
#ifndef MYSQL_CLIENT
-#include "my_global.h" // REQUIRED by log_event.h > m_string.h > my_bitmap.h
-#include "sql_priv.h"
#include "unireg.h"
#include "log_event.h"
#include "sql_base.h" // close_thread_tables
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 4bff12ce039..181d950bf59 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -13,11 +13,11 @@
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 "sql_priv.h"
#ifndef MYSQL_CLIENT
#include "unireg.h"
#endif
-#include "my_global.h" // REQUIRED by log_event.h > m_string.h > my_bitmap.h
#include "log_event.h"
#ifndef MYSQL_CLIENT
#include "sql_cache.h" // QUERY_CACHE_FLAGS_SIZE
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index 3ed9261f630..6535f16445b 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -32,6 +32,7 @@
flush_io_cache().
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_class.h" // THD
#ifdef HAVE_REPLICATION
diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc
index 6f28760c055..50454f0f66a 100644
--- a/sql/mysql_install_db.cc
+++ b/sql/mysql_install_db.cc
@@ -24,7 +24,6 @@
#include <m_string.h>
#include <windows.h>
-#include <assert.h>
#include <shellapi.h>
#include <accctrl.h>
#include <aclapi.h>
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 5adfc8b6728..4e7dd0a6999 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"
+#include "sql_plugin.h" // Includes my_global.h
#include "sql_priv.h"
#include "unireg.h"
#include <signal.h>
@@ -114,7 +114,6 @@
#endif
extern "C" { // Because of SCO 3.2V4.2
-#include <errno.h>
#include <sys/stat.h>
#ifndef __GNU_LIBRARY__
#define __GNU_LIBRARY__ // Skip warnings in getopt.h
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index eb34fcc2d77..29b8417c698 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -43,7 +43,6 @@
#include <my_net.h>
#include <violite.h>
#include <signal.h>
-#include <errno.h>
#include "probes_mysql.h"
#ifdef EMBEDDED_LIBRARY
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index b38b048c344..07a563d8090 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -108,6 +108,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 6e65b5ea177..7d1f6dfbf9d 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -26,6 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 4e8fcefa6d2..fc3ce09dd8e 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -48,6 +48,7 @@
(assuming a index for column d of table t2 is defined)
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "key.h" // key_cmp_if_same
#include "sql_select.h"
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index a6e3aa7ed66..ee031c1bbc2 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -20,11 +20,11 @@
Text .frm files management routines
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "parse_file.h"
#include "unireg.h" // CREATE_MODE
#include "sql_table.h" // build_table_filename
-#include <errno.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <my_dir.h>
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 98e796879ad..73b88d64224 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -19,6 +19,7 @@
#pragma implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
// Required to get server definitions for mysql/plugin.h right
#include "sql_plugin.h"
diff --git a/sql/procedure.cc b/sql/procedure.cc
index bdaced20586..8f9d6c0a7f3 100644
--- a/sql/procedure.cc
+++ b/sql/procedure.cc
@@ -20,6 +20,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 2400dadfadc..a6d67fd4a91 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -25,6 +25,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "protocol.h"
diff --git a/sql/records.cc b/sql/records.cc
index cce6272a4e3..bfce2f83967 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -25,6 +25,7 @@
Functions for easy reading of records, possible through a cache
*/
+#include <my_global.h>
#include "records.h"
#include "sql_priv.h"
#include "records.h"
diff --git a/sql/records.h b/sql/records.h
index 57467d665d4..21477d4a30b 100644
--- a/sql/records.h
+++ b/sql/records.h
@@ -18,7 +18,6 @@
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
-#include <my_global.h> /* for uint typedefs */
struct st_join_table;
class handler;
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 334de1337d6..3c99becf304 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -24,6 +24,7 @@
functions like register_slave()) are working.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_parse.h" // check_access
#ifdef HAVE_REPLICATION
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc
index 2b4a3093e0f..28859c2eb85 100644
--- a/sql/rpl_filter.cc
+++ b/sql/rpl_filter.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 <my_global.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 c8d5e2a2db0..e5620ec41a2 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -16,7 +16,7 @@
/* Definitions for MariaDB global transaction ID (GTID). */
-
+#include <my_global.h>
#include "sql_priv.h"
#include "my_sys.h"
#include "unireg.h"
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 34d3df23435..09e221e9bd5 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index a4b04d2e047..19b193729fd 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED by later includes
#include "rpl_injector.h"
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 7aed393b031..f0308308fea 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "rpl_rli.h"
diff --git a/sql/rpl_record_old.cc b/sql/rpl_record_old.cc
index 8b43b268c17..061fab78dbd 100644
--- a/sql/rpl_record_old.cc
+++ b/sql/rpl_record_old.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED by other includes
#include "rpl_rli.h"
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc
index eb362941f3e..49708df40f7 100644
--- a/sql/rpl_reporting.cc
+++ b/sql/rpl_reporting.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 <my_global.h>
#include "sql_priv.h"
#include "rpl_reporting.h"
#include "log.h" // sql_print_error, sql_print_warning,
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 754b877f654..34ec0f0393f 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -14,6 +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 "sql_priv.h"
#include "unireg.h" // HAVE_*
#include "rpl_mi.h"
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index 7b55911d887..4c521cf0c16 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -13,8 +13,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 <my_global.h>
#include "sql_priv.h"
-#include "my_global.h" // HAVE_REPLICATION
#ifdef HAVE_REPLICATION
diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc
index 25dff72090c..9067f1e4253 100644
--- a/sql/rpl_utility.cc
+++ b/sql/rpl_utility.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 <my_global.h>
#include "rpl_utility.h"
#include "log_event.h"
diff --git a/sql/set_var.cc b/sql/set_var.cc
index ea577bbfa74..0b9699e39f7 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"
+#include "sql_plugin.h" // Includes my_global.h
#include "sql_class.h" // set_var.h: session_var_ptr
#include "set_var.h"
#include "sql_priv.h"
diff --git a/sql/slave.cc b/sql/slave.cc
index edfc92a1666..0285318bf55 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -25,8 +25,8 @@
replication slave.
*/
+#include <my_global.h>
#include "sql_priv.h"
-#include "my_global.h"
#include "slave.h"
#include "sql_parse.h" // execute_init_command
#include "sql_table.h" // mysql_rm_table
diff --git a/sql/sp.cc b/sql/sp.cc
index 188b311ae86..35155cf031a 100644
--- a/sql/sp.cc
+++ b/sql/sp.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sp.h"
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 14f49ecc077..bafd0f34ab6 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 13f7facedea..d59e0aec541 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_prepare.h"
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 7c44e675811..11954921e06 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.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 <my_global.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 42476f7a596..a5a6a61f73c 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#ifdef USE_PRAGMA_IMPLEMENTATION
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 34d2417f632..1d9ee1aa0ae 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.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 <my_global.h>
#include "sql_priv.h"
-#include "my_global.h" // REQUIRED for HAVE_* below
#include "spatial.h"
#include "gstream.h" // Gis_read_stream
#include "sql_string.h" // String
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 4842a337fe9..794d20af2f2 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 <my_global.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_admin.cc b/sql/sql_admin.cc
index 0d42294430d..1d917de0c1a 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.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 "sql_class.h" // THD
+#include "sql_class.h" // THD and my_global.h
#include "keycaches.h" // get_key_cache
#include "sql_base.h" // Open_table_context
#include "lock.h" // MYSQL_OPEN_*
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 9b7ea58bee6..32b447797cf 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -29,6 +29,7 @@
#define MYSQL_LEX 1
+#include <my_global.h>
#include "sql_priv.h"
#include "procedure.h"
#include "sql_analyse.h"
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 84f2d95c5da..b659054a50b 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.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 <my_global.h>
#include "sql_priv.h"
#include "sql_audit.h"
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 9b6b18fccf1..8424a71faaf 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -17,8 +17,8 @@
/* Basic functions needed by many modules */
+#include <my_global.h>
#include "sql_base.h" // setup_table_map
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "debug_sync.h"
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index fef959c37ca..f0465cdf5bf 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.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 <my_global.h>
#include "sql_priv.h"
#include "sql_binlog.h"
#include "sql_parse.h" // check_global_access
diff --git a/sql/sql_bootstrap.cc b/sql/sql_bootstrap.cc
index 8e632a02ace..30d03029ce6 100644
--- a/sql/sql_bootstrap.cc
+++ b/sql/sql_bootstrap.cc
@@ -14,8 +14,7 @@
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-#include <stdlib.h>
-#include <errno.h>
+#include <my_global.h>
#include <ctype.h>
#include <string.h>
#include "sql_bootstrap.h"
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 6001517b0c7..3b169b73058 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "sql_cache.h"
#include "sql_parse.h" // check_table_access
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 482178e80b5..54d603adfc5 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_class.h"
diff --git a/sql/sql_client.cc b/sql/sql_client.cc
index e7c555b5947..efac01f9894 100644
--- a/sql/sql_client.cc
+++ b/sql/sql_client.cc
@@ -18,6 +18,7 @@
This files defines some MySQL C API functions that are server specific
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_class.h" // system_variables
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 433f3303ad7..ac50c7bd8f5 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 <my_global.h>
#include "sql_priv.h"
#ifndef __WIN__
#include <netdb.h> // getservbyname, servent
diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc
index bcc8ad0b10f..2460a16551d 100644
--- a/sql/sql_crypt.cc
+++ b/sql/sql_crypt.cc
@@ -26,6 +26,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_crypt.h"
#include "password.h"
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index a38077c40cb..99b7b1e58d0 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -17,6 +17,7 @@
#pragma implementation /* gcc class implementation */
#endif
+#include <my_global.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 063b90a6780..06e6d738db1 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 <my_global.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 a8f7e270891..d776077c4c3 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -20,6 +20,7 @@
Multi-table deletes were introduced by Monty and Sinisa
*/
+#include <my_global.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 8e8dbfc71d4..d3b3c11c4ac 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -21,7 +21,7 @@
*/
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
+#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_derived.h"
diff --git a/sql/sql_do.cc b/sql/sql_do.cc
index 4ba887b5ab2..468b1bc33da 100644
--- a/sql/sql_do.cc
+++ b/sql/sql_do.cc
@@ -16,6 +16,7 @@
/* Execute DO statement */
+#include <my_global.h>
#include "sql_priv.h"
#include "transaction.h"
#include "unireg.h"
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index fb1bb811c9d..3e18b701031 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -41,6 +41,7 @@ This file contains the implementation of error and warnings related
***********************************************************************/
+#include <my_global.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 2b523b323a4..75f6689ab98 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -18,6 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_select.h"
diff --git a/sql/sql_expression_cache.cc b/sql/sql_expression_cache.cc
index 1e64bc10a7c..824d21eea20 100644
--- a/sql/sql_expression_cache.cc
+++ b/sql/sql_expression_cache.cc
@@ -13,6 +13,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_global.h>
#include "sql_base.h"
#include "sql_select.h"
#include "sql_expression_cache.h"
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index a6c471f67d5..110bca96530 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -52,6 +52,7 @@
cursor points at the first record).
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_handler.h"
#include "unireg.h" // REQUIRED: for other includes
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 8f458ea0b9f..afeb9395a55 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.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 02110-1301, USA */
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sql_help.h"
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index e0f6a998e66..041074a815e 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -56,7 +56,7 @@
*/
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
+#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_insert.h"
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index e38075f1746..697988a6bf8 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -18,6 +18,7 @@
/* A lexical scanner on a temporary buffer with a yacc interface */
#define MYSQL_LEX 1
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_class.h" // sql_lex.h: SQLCOM_END
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 534a8fa5484..5ce32305449 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -19,6 +19,7 @@
/* Copy data from a textfile to table */
/* 2006-12 Erik Wetterberg : LOAD XML added */
+#include <my_global.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 c7d21ffd424..d918d5c9cf4 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -20,6 +20,7 @@
!! This file is built from my_locale.pl !!
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sql_locale.h"
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index f13448ca46e..c6c465aa4e2 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -21,6 +21,7 @@
* o Berkeley DB: removing unneeded log files.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_manager.h"
#include "unireg.h" // REQUIRED: for other includes
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index f20c5ee9582..48c22a05448 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 <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_parse.h" // sql_kill, *_precheck, *_prepare
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 18e49d878cd..239d793c633 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -47,6 +47,7 @@
/* Some general useful functions */
#define MYSQL_LEX 1
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_partition.h"
@@ -55,7 +56,6 @@
#include "sql_cache.h" // query_cache_invalidate3
#include "lock.h" // mysql_lock_remove
#include "sql_show.h" // append_identifier
-#include <errno.h>
#include <m_ctype.h>
#include "my_md5.h"
#include "transaction.h"
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 0521baaf77f..3741712160e 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.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 "sql_plugin.h"
+#include "sql_plugin.h" // Includes my_global.h
#include "sql_priv.h" // SHOW_MY_BOOL
#include "unireg.h"
#include "sql_class.h" // set_var.h: THD
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index ebceae70ee5..48d7415a7b3 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 <my_global.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_priv.h b/sql/sql_priv.h
index 5dc19181e9b..30fb1a4c29e 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -29,6 +29,10 @@
#ifndef MYSQL_CLIENT
+#ifndef MY_GLOBAL_INCLUDED
+#error "You must include my_global.h first!"
+#endif
+
/*
Generates a warning that a feature is deprecated. After a specified
version asserts that the feature is removed.
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index dc7aacb3d94..26d515842ed 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -29,11 +29,11 @@
- "profiling_history_size", integer, session + global, "Num queries stored?"
*/
-
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_profile.h"
-#include "my_sys.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 95e06ddbbd5..7390aa0bb0f 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.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 <my_global.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 897aa183b60..2c17898f07c 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -19,6 +19,7 @@
Atomic rename of table; RENAME TABLE t1 to t2, tmp to t1 [,...]
*/
+#include <my_global.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 8a441dd2737..68535938484 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.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 <my_global.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 eff1c382945..a84c727669d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -29,6 +29,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sql_select.h"
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index 637ee78e314..2b0576ffba9 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -33,6 +33,7 @@
currently running transactions etc will not be disrupted.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_servers.h"
#include "unireg.h"
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 7c730d3fd6e..01b6e2bf672 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"
+#include "sql_plugin.h" // Includes my_global.h
#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 a0a47b77591..374a24f75e5 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.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 <my_global.h>
#include "sql_priv.h"
#include "sp_head.h"
#include "sp_pcontext.h"
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 9acd3d98322..bf79747f9a0 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -23,6 +23,7 @@
@{
*/
+#include <my_global.h>
#include "sql_base.h"
#include "key.h"
#include "sql_statistics.h"
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f4412512522..7e3d1dbd308 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -18,6 +18,7 @@
/* drop and alter of tables */
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "debug_sync.h"
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
index 48eeb94f7c9..2991b16350c 100644
--- a/sql/sql_tablespace.cc
+++ b/sql/sql_tablespace.cc
@@ -15,6 +15,7 @@
/* drop and alter of tablespaces */
+#include <my_global.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 60e9b2cc54c..8992ff24a1e 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -16,7 +16,7 @@
/* Write some debug info */
-
+#include <my_global.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 cc824298bc5..ca689d55a2b 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -17,6 +17,7 @@
/* Functions to handle date and time */
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h" // REQUIRED by other includes
#include "sql_time.h"
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 70ac6265046..a59bbb5bc61 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sp_head.h"
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index fdc932957b2..bd5732c3696 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -31,6 +31,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.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 fe8bb7a6620..2126db4bf19 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 "sql_priv.h"
#include "unireg.h"
#include "sql_union.h"
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 1eda5b2681a..f83e11912d1 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_update.h"
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 07169f299d7..6a81301a6d9 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
#include "sql_view.h"
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index f56f2674ac2..34165e07843 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"
+#include "sql_plugin.h" // Includes my_global.h
#include "sql_priv.h"
#include "sql_class.h" // set_var.h: THD
#include "sys_vars.h"
diff --git a/sql/table.cc b/sql/table.cc
index 2347e74e13c..aba9779667f 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 <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "table.h"
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index a14ed36837b..9786f1a6942 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -17,6 +17,7 @@
/* Mallocs for used in threads */
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "thr_malloc.h"
diff --git a/sql/transaction.cc b/sql/transaction.cc
index 933e39ae357..51d8a08e981 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -18,6 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include "transaction.h"
#include "rpl_handler.h"
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 0990182dbdb..912a38f8927 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -30,6 +30,7 @@
deletes in disk order.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sql_sort.h"
diff --git a/sql/unireg.cc b/sql/unireg.cc
index c60a13e5f44..12d3c265a86 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -25,6 +25,7 @@
str is a (long) to record position where 0 is the first position.
*/
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sql_partition.h" // struct partition_info
@@ -32,7 +33,6 @@
#include "create_options.h"
#include "discover.h"
#include <m_ctype.h>
-#include <assert.h>
#define FCOMP 17 /* Bytes for a packed field */
diff --git a/sql/unireg.h b/sql/unireg.h
index 5f133da674f..2d51aa39fd4 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -18,8 +18,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "my_global.h" /* ulonglong */
-#include "mysql_version.h" /* FRM_VER */
+#include <mysql_version.h> /* FRM_VER */
/* Extra functions used by unireg library */
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 6c308e7eef1..c1acef4596f 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -21,7 +21,7 @@
#pragma implementation // gcc: Class implementation
#endif
-#include "sql_class.h" // SSV
+#include "sql_class.h" // SSV and my_global.h
#include "sql_table.h" // build_table_filename
#include <myisam.h> // T_EXTEND
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 91a2c70cb9f..56d8000d64d 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -19,6 +19,7 @@
#endif
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "ha_blackhole.h"
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 9db78065bb3..92ac20a8f82 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -41,10 +41,9 @@ TODO:
-Brian
*/
-#include "my_global.h"
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_class.h" // SSV
-#include <mysql/plugin.h>
#include <mysql/psi/mysql_file.h>
#include "ha_tina.h"
#include "probes_mysql.h"
diff --git a/storage/csv/transparent_file.cc b/storage/csv/transparent_file.cc
index a307f9885c0..1f1123aefc2 100644
--- a/storage/csv/transparent_file.cc
+++ b/storage/csv/transparent_file.cc
@@ -17,6 +17,7 @@
#pragma implementation // gcc: Class implementation
#endif
+#include <my_global.h>
#include "sql_priv.h"
#include <mysql/psi/mysql_file.h>
#include "transparent_file.h"
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 4608aedd129..6d3d665b9f1 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -372,6 +372,7 @@
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_servers.h" // FOREIGN_SERVER, get_server_by_name
#include "sql_class.h" // SSV
diff --git a/storage/federatedx/federatedx_io.cc b/storage/federatedx/federatedx_io.cc
index 34d3dde3ebb..1e0348e3bf8 100644
--- a/storage/federatedx/federatedx_io.cc
+++ b/storage/federatedx/federatedx_io.cc
@@ -28,8 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*#define MYSQL_SERVER 1*/
+#include <my_global.h>
#include "sql_priv.h"
-#include <mysql/plugin.h>
#include "ha_federatedx.h"
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc
index 2933073a679..1ff6abc4c77 100644
--- a/storage/federatedx/federatedx_io_mysql.cc
+++ b/storage/federatedx/federatedx_io_mysql.cc
@@ -28,8 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_priv.h"
-#include <mysql/plugin.h>
#include "ha_federatedx.h"
diff --git a/storage/federatedx/federatedx_io_null.cc b/storage/federatedx/federatedx_io_null.cc
index 4322422ef37..aa35d4bdecc 100644
--- a/storage/federatedx/federatedx_io_null.cc
+++ b/storage/federatedx/federatedx_io_null.cc
@@ -28,8 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*#define MYSQL_SERVER 1*/
+#include <my_global.h>
#include "sql_priv.h"
-#include <mysql/plugin.h>
#include "ha_federatedx.h"
diff --git a/storage/federatedx/federatedx_txn.cc b/storage/federatedx/federatedx_txn.cc
index 5049b1ff79f..232ac335dfc 100644
--- a/storage/federatedx/federatedx_txn.cc
+++ b/storage/federatedx/federatedx_txn.cc
@@ -31,8 +31,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_priv.h"
-#include <mysql/plugin.h>
#include "ha_federatedx.h"
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 5631d60a10a..3ad5c6e9e0a 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -20,6 +20,7 @@
#endif
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_priv.h"
#include "sql_plugin.h"
#include "ha_heap.h"
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index cb5faa42199..fe36829ba44 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -21,6 +21,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
Smart ALTER TABLE
*******************************************************/
+#include <my_global.h>
#include <unireg.h>
#include <mysqld_error.h>
#include <log.h>
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 7155faa72f4..e80ce15165b 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -21,7 +21,7 @@
#endif
#define MYSQL_SERVER 1
-#include <mysql/plugin.h>
+#include <my_global.h>
#include <m_ctype.h>
#include <my_dir.h>
#include <myisampack.h>
diff --git a/storage/maria/unittest/ma_maria_log_cleanup.c b/storage/maria/unittest/ma_maria_log_cleanup.c
index 3e4bc755832..6ecec9bbc19 100644
--- a/storage/maria/unittest/ma_maria_log_cleanup.c
+++ b/storage/maria/unittest/ma_maria_log_cleanup.c
@@ -14,7 +14,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "../maria_def.h"
-#include <my_dir.h>
#ifdef _WIN32
#include <direct.h> /* rmdir */
#endif
diff --git a/storage/maria/unittest/test_file.c b/storage/maria/unittest/test_file.c
index 567f4ef8b94..1a14f2e8ec5 100644
--- a/storage/maria/unittest/test_file.c
+++ b/storage/maria/unittest/test_file.c
@@ -13,7 +13,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 <tap.h>
+#include <tap.h> /* Includes my_global.h */
#include <my_sys.h>
#include <my_dir.h>
#include "test_file.h"
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index f90e01d8cc9..f21845bae63 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -21,9 +21,9 @@
#endif
#define MYSQL_SERVER 1
+#include "sql_plugin.h"
#include "sql_priv.h"
#include "key.h" // key_copy
-#include "sql_plugin.h"
#include <m_ctype.h>
#include <my_bit.h>
#include "ha_myisam.h"
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 191ccd5ed89..93722162d86 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -90,12 +90,12 @@
#endif
#define MYSQL_SERVER 1
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "sql_cache.h" // query_cache_*
#include "sql_show.h" // append_identifier
#include "sql_table.h" // build_table_filename
-#include <mysql/plugin.h>
#include <m_ctype.h>
#include "../myisam/ha_myisam.h"
#include "ha_myisammrg.h"
diff --git a/storage/oqgraph/oqgraph_thunk.cc b/storage/oqgraph/oqgraph_thunk.cc
index e929ca3f5b0..0e7b1f2b8ed 100644
--- a/storage/oqgraph/oqgraph_thunk.cc
+++ b/storage/oqgraph/oqgraph_thunk.cc
@@ -22,17 +22,18 @@
======================================================================
*/
+#include <my_config.h>
#include "oqgraph_thunk.h"
#include <boost/tuple/tuple.hpp>
#define MYSQL_SERVER
-#include "mysql_version.h"
+#include <my_global.h>
+#include "unireg.h"
#include "sql_base.h"
#include "table.h"
#include "field.h"
#include "key.h"
-#include "unireg.h"
#if MYSQL_VERSION_ID < 100000
// Allow compatibility with build for 5.5.32
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 03fa6440d43..2944e750b88 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/hs_client/config.cpp b/storage/spider/hs_client/config.cpp
index 8f6447829e1..b546230ca03 100644
--- a/storage/spider/hs_client/config.cpp
+++ b/storage/spider/hs_client/config.cpp
@@ -7,6 +7,7 @@
* See COPYRIGHT.txt for details.
*/
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/hs_client/escape.cpp b/storage/spider/hs_client/escape.cpp
index d382dfbc07e..c3194e1d111 100644
--- a/storage/spider/hs_client/escape.cpp
+++ b/storage/spider/hs_client/escape.cpp
@@ -6,6 +6,7 @@
* See COPYRIGHT.txt for details.
*/
+#include <my_global.h>
#include "mysql_version.h"
#include "hs_compat.h"
#include "escape.hpp"
diff --git a/storage/spider/hs_client/fatal.cpp b/storage/spider/hs_client/fatal.cpp
index b26fb50f4fb..bec031153e4 100644
--- a/storage/spider/hs_client/fatal.cpp
+++ b/storage/spider/hs_client/fatal.cpp
@@ -7,6 +7,7 @@
* See COPYRIGHT.txt for details.
*/
+#include <my_global.h>
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50500
#include "mysql_priv.h"
diff --git a/storage/spider/hs_client/hstcpcli.cpp b/storage/spider/hs_client/hstcpcli.cpp
index 6aa83e60a27..fed87803f9c 100644
--- a/storage/spider/hs_client/hstcpcli.cpp
+++ b/storage/spider/hs_client/hstcpcli.cpp
@@ -7,6 +7,7 @@
* See COPYRIGHT.txt for details.
*/
+#include <my_global.h>
#include "mysql_version.h"
#include "hs_compat.h"
#if MYSQL_VERSION_ID < 50500
diff --git a/storage/spider/hs_client/socket.cpp b/storage/spider/hs_client/socket.cpp
index 769bd0b497c..2082d1f024e 100644
--- a/storage/spider/hs_client/socket.cpp
+++ b/storage/spider/hs_client/socket.cpp
@@ -7,6 +7,7 @@
* See COPYRIGHT.txt for details.
*/
+#include <my_global.h>
#ifndef __WIN__
#include <sys/types.h>
#include <sys/un.h>
diff --git a/storage/spider/hs_client/string_util.cpp b/storage/spider/hs_client/string_util.cpp
index 133143165c2..9cf2f04d5b6 100644
--- a/storage/spider/hs_client/string_util.cpp
+++ b/storage/spider/hs_client/string_util.cpp
@@ -7,6 +7,7 @@
* See COPYRIGHT.txt for details.
*/
+#include <my_global.h>
#include "mysql_version.h"
#include "hs_compat.h"
#if MYSQL_VERSION_ID < 50500
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
index e19222c99f6..ce786a7b697 100644
--- a/storage/spider/spd_conn.cc
+++ b/storage/spider/spd_conn.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 10fed696134..dae0d94d7aa 100644
--- a/storage/spider/spd_copy_tables.cc
+++ b/storage/spider/spd_copy_tables.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 64e2dc59b65..81b6fae841f 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 f7f974a0142..d1eb68679b2 100644
--- a/storage/spider/spd_db_handlersocket.cc
+++ b/storage/spider/spd_db_handlersocket.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 81e2fc41a57..f60220ee38b 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 0d8a218c5f6..0464d2b576d 100644
--- a/storage/spider/spd_db_oracle.cc
+++ b/storage/spider/spd_db_oracle.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 27041790d63..7149502d8f6 100644
--- a/storage/spider/spd_direct_sql.cc
+++ b/storage/spider/spd_direct_sql.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 49824693984..025878b6253 100644
--- a/storage/spider/spd_i_s.cc
+++ b/storage/spider/spd_i_s.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 4a033c1e7cf..56fb3c9ccd2 100644
--- a/storage/spider/spd_malloc.cc
+++ b/storage/spider/spd_malloc.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 2b1e87313d1..387d17134e5 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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_ping_table.cc b/storage/spider/spd_ping_table.cc
index d32dbec2421..8c55b0fc683 100644
--- a/storage/spider/spd_ping_table.cc
+++ b/storage/spider/spd_ping_table.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 1ff3496d83e..7b46889a135 100644
--- a/storage/spider/spd_sys_table.cc
+++ b/storage/spider/spd_sys_table.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 388f32afb7c..b00eb4710a8 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 a66fa5a7f5d..dd0cc1d3101 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -14,6 +14,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index f98b8671862..a561ae22f86 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -21,6 +21,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
Smart ALTER TABLE
*******************************************************/
+#include <my_global.h>
#include <unireg.h>
#include <mysqld_error.h>
#include <log.h>
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 69a75f5a4fe..d7ab6628757 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -22,6 +22,7 @@ InnoDB INFORMATION SCHEMA tables interface to MySQL.
Created July 18, 2007 Vasil Dimov
*******************************************************/
+#include <my_global.h>
#ifndef MYSQL_SERVER
#define MYSQL_SERVER /* For Item_* classes */
#include <item.h>