summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-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
228 files changed, 232 insertions, 238 deletions
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