summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysqlbinlog.cc3
-rw-r--r--libmysqld/emb_qcache.cc1
-rw-r--r--plugin/qc_info/qc_info.cc3
-rw-r--r--sql/event_data_objects.h4
-rw-r--r--sql/event_db_repository.cc6
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_cmpfunc.cc2
-rw-r--r--sql/item_create.cc2
-rw-r--r--sql/item_timefunc.h2
-rw-r--r--sql/log_event.cc13
-rw-r--r--sql/log_event.h5
-rw-r--r--sql/mysqld.h4
-rw-r--r--sql/set_var.h2
-rw-r--r--sql/sp.cc19
-rw-r--r--sql/sp.h5
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/sp_head.h4
-rw-r--r--sql/sql_acl.cc6
-rw-r--r--sql/sql_basic_types.h25
-rw-r--r--sql/sql_cache.cc1
-rw-r--r--sql/sql_cache.h2
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_select.h4
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_trigger.cc4
-rw-r--r--sql/sql_trigger.h2
-rw-r--r--sql/sql_view.cc4
-rw-r--r--sql/sys_vars.cc4
-rw-r--r--sql/table.cc4
-rw-r--r--sql/wsrep_mysqld.cc2
33 files changed, 88 insertions, 59 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 1a184e2ffe8..6a52c9fe29a 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -37,13 +37,12 @@
#include <sslopt-vars.h>
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
#include "sql_priv.h"
+#include "sql_basic_types.h"
#include "log_event.h"
#include "compat56.h"
#include "sql_common.h"
#include "my_dir.h"
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
-
-
#include "sql_string.h" // needed for Rpl_filter
#include "sql_list.h" // needed for Rpl_filter
#include "rpl_filter.h"
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index a1a66421db8..429b16b2dee 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -18,6 +18,7 @@
#ifdef HAVE_QUERY_CACHE
#include <mysql.h>
+#include "sql_basic_types.h"
#include "emb_qcache.h"
#include "embedded_priv.h"
#include "sql_class.h" // THD
diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc
index 4ccfdc8f8c2..aec542b6935 100644
--- a/plugin/qc_info/qc_info.cc
+++ b/plugin/qc_info/qc_info.cc
@@ -32,10 +32,11 @@
#define MYSQL_SERVER
#endif
-#include <sql_cache.h>
+#include <my_global.h>
#include <sql_parse.h> // check_global_access
#include <sql_acl.h> // PROCESS_ACL
#include <sql_class.h> // THD
+#include <sql_cache.h>
#include <table.h> // ST_SCHEMA_TABLE
#include <set_var.h> // sql_mode_string_representation
#include <tztime.h>
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index 8113fcb0e2e..7ad8191f4d2 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -132,7 +132,7 @@ public:
ulonglong created;
ulonglong modified;
- ulong sql_mode;
+ sql_mode_t sql_mode;
class Stored_program_creation_ctx *creation_ctx;
LEX_STRING body_utf8;
@@ -158,7 +158,7 @@ public:
LEX_STRING definer_user;
LEX_STRING definer_host;
- ulong sql_mode;
+ sql_mode_t sql_mode;
class Stored_program_creation_ctx *creation_ctx;
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 5d0754cf766..9de55c44dd0 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -202,7 +202,7 @@ mysql_event_fill_row(THD *thd,
TABLE *table,
Event_parse_data *et,
sp_head *sp,
- ulonglong sql_mode,
+ sql_mode_t sql_mode,
my_bool is_update)
{
CHARSET_INFO *scs= system_charset_info;
@@ -658,7 +658,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
int ret= 1;
TABLE *table= NULL;
sp_head *sp= thd->lex->sphead;
- ulonglong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
/*
Take a savepoint to release only the lock on mysql.event
table at the end but keep the global read lock and
@@ -787,7 +787,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
CHARSET_INFO *scs= system_charset_info;
TABLE *table= NULL;
sp_head *sp= thd->lex->sphead;
- ulonglong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
/*
Take a savepoint to release only the lock on mysql.event
table at the end but keep the global read lock and
diff --git a/sql/handler.h b/sql/handler.h
index fbb620c696c..c1f6cb5b162 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -25,7 +25,9 @@
#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 */
#include "sql_plugin.h" /* plugin_ref, st_plugin_int, plugin */
#include "thr_lock.h" /* thr_lock_type, THR_LOCK_DATA */
diff --git a/sql/item.cc b/sql/item.cc
index ceb05911a63..8087aad2e7f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1388,7 +1388,7 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
THD *thd= table->in_use;
enum_check_fields tmp= thd->count_cuted_fields;
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
- ulonglong sql_mode= thd->variables.sql_mode;
+ sql_mode_t sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->variables.sql_mode|= MODE_INVALID_DATES;
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 434442cffa9..193af8631ba 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -413,7 +413,7 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item,
if ((*item)->const_item() && !(*item)->is_expensive())
{
TABLE *table= field->table;
- ulonglong orig_sql_mode= thd->variables.sql_mode;
+ sql_mode_t orig_sql_mode= thd->variables.sql_mode;
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
my_bitmap_map *old_maps[2];
ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 82f6bbd3173..7f0d4144177 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -6279,7 +6279,7 @@ Item *create_temporal_literal(THD *thd,
MYSQL_TIME_STATUS status;
MYSQL_TIME ltime;
Item *item= NULL;
- ulonglong flags= sql_mode_for_dates(thd);
+ sql_mode_t flags= sql_mode_for_dates(thd);
switch(type)
{
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index a853c63128d..3d2b5c8c9e9 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -529,7 +529,7 @@ public:
class Item_temporal_func: public Item_func
{
- ulonglong sql_mode;
+ sql_mode_t sql_mode;
public:
Item_temporal_func(THD *thd): Item_func(thd) {}
Item_temporal_func(THD *thd, Item *a): Item_func(thd, a) {}
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 6ad9fcebc78..60d63a416e3 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3591,7 +3591,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
{
CHECK_SPACE(pos, end, 8);
sql_mode_inited= 1;
- sql_mode= (ulong) uint8korr(pos); // QQ: Fix when sql_mode is ulonglong
+ sql_mode= (sql_mode_t) uint8korr(pos);
DBUG_PRINT("info",("In Query_log_event, read sql_mode: %llu", sql_mode));
pos+= 8;
break;
@@ -4073,8 +4073,9 @@ void Query_log_event::print_query_header(IO_CACHE* file,
(unlikely(print_event_info->sql_mode != sql_mode ||
!print_event_info->sql_mode_inited)))
{
- my_b_printf(file,"SET @@session.sql_mode=%lu%s\n",
- (ulong)sql_mode, print_event_info->delimiter);
+ char llbuff[22];
+ my_b_printf(file,"SET @@session.sql_mode=%s%s\n",
+ ullstr(sql_mode, llbuff), print_event_info->delimiter);
print_event_info->sql_mode= sql_mode;
print_event_info->sql_mode_inited= 1;
}
@@ -4304,8 +4305,8 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
*/
if (sql_mode_inited)
thd->variables.sql_mode=
- (ulong) ((thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) |
- (sql_mode & ~(ulong) MODE_NO_DIR_IN_CREATE));
+ (sql_mode_t) ((thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) |
+ (sql_mode & ~(ulong) MODE_NO_DIR_IN_CREATE));
if (charset_inited)
{
rpl_sql_thread_info *sql_info= thd->system_thread_info.rpl_sql_info;
@@ -10042,7 +10043,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
extra columns on the slave. In that case, do not force
MODE_NO_AUTO_VALUE_ON_ZERO.
*/
- ulonglong saved_sql_mode= thd->variables.sql_mode;
+ sql_mode_t saved_sql_mode= thd->variables.sql_mode;
if (!is_auto_inc_in_extra_columns())
thd->variables.sql_mode= MODE_NO_AUTO_VALUE_ON_ZERO;
diff --git a/sql/log_event.h b/sql/log_event.h
index 0ce0e563796..306f78ca4c9 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -754,7 +754,7 @@ typedef struct st_print_event_info
bool flags2_inited;
uint32 flags2;
bool sql_mode_inited;
- ulonglong sql_mode; /* must be same as THD.variables.sql_mode */
+ sql_mode_t sql_mode; /* must be same as THD.variables.sql_mode */
ulong auto_increment_increment, auto_increment_offset;
bool charset_inited;
char charset[6]; // 3 variables, each of them storable in 2 bytes
@@ -1951,8 +1951,7 @@ public:
bool charset_inited;
uint32 flags2;
- /* In connections sql_mode is 32 bits now but will be 64 bits soon */
- ulonglong sql_mode;
+ sql_mode_t sql_mode;
ulong auto_increment_increment, auto_increment_offset;
char charset[6];
uint time_zone_len; /* 0 means uninited */
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 83d723c6ab7..294b463161b 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -17,7 +17,8 @@
#ifndef MYSQLD_INCLUDED
#define MYSQLD_INCLUDED
-#include "my_global.h" /* MYSQL_PLUGIN_IMPORT, FN_REFLEN, FN_EXTLEN */
+#include <my_global.h> /* MYSQL_PLUGIN_IMPORT, FN_REFLEN, FN_EXTLEN */
+#include "sql_basic_types.h" /* query_id_t */
#include "sql_bitmap.h" /* Bitmap */
#include "my_decimal.h" /* my_decimal */
#include "mysql_com.h" /* SERVER_VERSION_LENGTH */
@@ -698,7 +699,6 @@ enum enum_query_type
/* query_id */
-typedef int64 query_id_t;
extern query_id_t global_query_id;
void unireg_end(void) __attribute__((noreturn));
diff --git a/sql/set_var.h b/sql/set_var.h
index ee62f6db7ec..97dc3b5ba51 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -410,7 +410,7 @@ inline bool IS_SYSVAR_AUTOSIZE(void *ptr)
bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type);
-ulonglong expand_sql_mode(ulonglong sql_mode);
+sql_mode_t expand_sql_mode(sql_mode_t sql_mode);
bool sql_mode_string_representation(THD *thd, sql_mode_t sql_mode, LEX_STRING *ls);
int default_regex_flags_pcre(const THD *thd);
diff --git a/sql/sp.cc b/sql/sp.cc
index a518b520786..05f075390c1 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -41,7 +41,7 @@
static int
db_load_routine(THD *thd, stored_procedure_type type, sp_name *name,
sp_head **sphp,
- ulonglong sql_mode, const char *params, const char *returns,
+ sql_mode_t sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
LEX_STRING *definer_user_name, LEX_STRING *definer_host_name,
longlong created, longlong modified,
@@ -539,7 +539,7 @@ db_find_routine(THD *thd, stored_procedure_type type, sp_name *name,
char buff[65];
String str(buff, sizeof(buff), &my_charset_bin);
bool saved_time_zone_used= thd->time_zone_used;
- ulonglong sql_mode, saved_mode= thd->variables.sql_mode;
+ sql_mode_t sql_mode, saved_mode= thd->variables.sql_mode;
Open_tables_backup open_tables_state_backup;
Stored_program_creation_ctx *creation_ctx;
char definer_user_name_holder[USERNAME_LENGTH + 1];
@@ -727,11 +727,11 @@ Silence_deprecated_warning::handle_condition(
@retval 0 error
*/
-static sp_head *sp_compile(THD *thd, String *defstr, ulonglong sql_mode,
+static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
Stored_program_creation_ctx *creation_ctx)
{
sp_head *sp;
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
ha_rows old_select_limit= thd->variables.select_limit;
sp_rcontext *old_spcont= thd->spcont;
Silence_deprecated_warning warning_handler;
@@ -810,7 +810,7 @@ Bad_db_error_handler::handle_condition(THD *thd,
static int
db_load_routine(THD *thd, stored_procedure_type type,
sp_name *name, sp_head **sphp,
- ulonglong sql_mode, const char *params, const char *returns,
+ sql_mode_t sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
LEX_STRING *definer_user_name, LEX_STRING *definer_host_name,
longlong created, longlong modified,
@@ -1024,7 +1024,7 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
TABLE *table;
char definer_buf[USER_HOST_BUFF_SIZE];
LEX_STRING definer;
- ulonglong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ?
MDL_key::FUNCTION : MDL_key::PROCEDURE;
@@ -2212,9 +2212,9 @@ show_create_sp(THD *thd, String *buf,
st_sp_chistics *chistics,
const LEX_STRING *definer_user,
const LEX_STRING *definer_host,
- ulonglong sql_mode)
+ sql_mode_t sql_mode)
{
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
/* Make some room to begin with */
if (buf->alloc(100 + dblen + 1 + namelen + paramslen + returnslen + bodylen +
chistics->comment.length + 10 /* length of " DEFINER= "*/ +
@@ -2301,7 +2301,8 @@ show_create_sp(THD *thd, String *buf,
sp_head *
sp_load_for_information_schema(THD *thd, TABLE *proc_table, String *db,
- String *name, ulong sql_mode, stored_procedure_type type,
+ String *name, sql_mode_t sql_mode,
+ stored_procedure_type type,
const char *returns, const char *params,
bool *free_sp_head)
{
diff --git a/sql/sp.h b/sql/sp.h
index df60482f8fd..96d49cfe676 100644
--- a/sql/sp.h
+++ b/sql/sp.h
@@ -200,7 +200,8 @@ TABLE *open_proc_table_for_read(THD *thd, Open_tables_backup *backup);
sp_head *
sp_load_for_information_schema(THD *thd, TABLE *proc_table, String *db,
- String *name, ulong sql_mode, stored_procedure_type type,
+ String *name, sql_mode_t sql_mode,
+ stored_procedure_type type,
const char *returns, const char *params,
bool *free_sp_head);
@@ -228,5 +229,5 @@ bool show_create_sp(THD *thd, String *buf,
st_sp_chistics *chistics,
const LEX_STRING *definer_user,
const LEX_STRING *definer_host,
- ulonglong sql_mode);
+ sql_mode_t sql_mode);
#endif /* _SP_H_ */
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 37479c14047..e2610fd950c 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -2413,7 +2413,7 @@ sp_head::do_cont_backpatch()
void
sp_head::set_info(longlong created, longlong modified,
- st_sp_chistics *chistics, ulonglong sql_mode)
+ st_sp_chistics *chistics, sql_mode_t sql_mode)
{
m_created= created;
m_modified= modified;
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 65aad1dd5a1..9f1745f2aab 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -182,7 +182,7 @@ public:
const char *m_tmp_query; ///< Temporary pointer to sub query string
st_sp_chistics *m_chistics;
- ulonglong m_sql_mode; ///< For SHOW CREATE and execution
+ sql_mode_t m_sql_mode; ///< For SHOW CREATE and execution
LEX_STRING m_qname; ///< db.name
bool m_explicit_name; ///< Prepend the db name? */
LEX_STRING m_db;
@@ -421,7 +421,7 @@ public:
Column_definition *field_def);
void set_info(longlong created, longlong modified,
- st_sp_chistics *chistics, ulonglong sql_mode);
+ st_sp_chistics *chistics, sql_mode_t sql_mode);
void set_definer(const char *definer, uint definerlen);
void set_definer(const LEX_STRING *user_name, const LEX_STRING *host_name);
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f0f96d340cc..ab6a8032348 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1196,7 +1196,7 @@ static bool acl_load(THD *thd, TABLE_LIST *tables)
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
char tmp_name[SAFE_NAME_LEN+1];
int password_length;
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
DBUG_ENTER("acl_load");
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
@@ -6600,7 +6600,7 @@ static bool grant_load(THD *thd, TABLE_LIST *tables)
TABLE *t_table, *c_table, *p_table;
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
MEM_ROOT *save_mem_root= thd->mem_root;
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
DBUG_ENTER("grant_load");
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
@@ -9643,7 +9643,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
List_iterator <LEX_USER> user_list(list);
TABLE_LIST tables[TABLES_MAX];
bool binlog= false;
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
DBUG_ENTER("mysql_drop_user");
DBUG_PRINT("entry", ("Handle as %s", handle_as_role ? "role" : "user"));
diff --git a/sql/sql_basic_types.h b/sql/sql_basic_types.h
new file mode 100644
index 00000000000..1e97262cdf0
--- /dev/null
+++ b/sql/sql_basic_types.h
@@ -0,0 +1,25 @@
+/*
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2016, MariaDB
+
+ 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 Street, Fifth Floor, Boston, MA 02110-1301, USA */
+
+/* File that includes common types used globally in MariaDB */
+
+#ifndef SQL_TYPES_INCLUDED
+#define SQL_TYPES_INCLUDED
+
+typedef ulonglong sql_mode_t;
+typedef int64 query_id_t;
+#endif
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 8ff4684f0ff..2f4856fc4e2 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -330,6 +330,7 @@ TODO list:
#include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
+#include "sql_basic_types.h"
#include "sql_cache.h"
#include "sql_parse.h" // check_table_access
#include "tztime.h" // struct Time_zone
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 00ba9bf59d8..6984c2115f2 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -548,7 +548,7 @@ struct Query_cache_query_flags
uint collation_connection_num;
ha_rows limit;
Time_zone *time_zone;
- ulonglong sql_mode;
+ sql_mode_t sql_mode;
ulong max_sort_length;
ulong group_concat_max_len;
ulong default_week_format;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 9a41a0d4981..994a161a646 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -502,8 +502,6 @@ enum killed_type
KILL_TYPE_QUERY
};
-typedef ulonglong sql_mode_t;
-
#include "sql_lex.h" /* Must be here */
class Delayed_insert;
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 1ddddaf1b40..fc218cb18f2 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -857,7 +857,7 @@ error2:
bool mysqld_help(THD *thd, const char *mask)
{
- ulonglong sql_mode_backup= thd->variables.sql_mode;
+ sql_mode_t sql_mode_backup= thd->variables.sql_mode;
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
bool rc= mysqld_help_internal(thd, mask);
thd->variables.sql_mode= sql_mode_backup;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 3025c6e36dc..97e9464deb6 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1953,7 +1953,7 @@ public:
enum_duplicates dup;
my_time_t start_time;
ulong start_time_sec_part;
- ulonglong sql_mode;
+ sql_mode_t sql_mode;
bool auto_increment_field_not_null;
bool query_start_used, ignore, log_query, query_start_sec_part_used;
bool stmt_depends_on_first_successful_insert_id_in_prev_stmt;
diff --git a/sql/sql_select.h b/sql/sql_select.h
index fb3f71c0769..f3b59e5d20c 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1757,7 +1757,7 @@ public:
enum store_key_result result;
THD *thd= to_field->table->in_use;
enum_check_fields saved_count_cuted_fields= thd->count_cuted_fields;
- ulonglong sql_mode= thd->variables.sql_mode;
+ sql_mode_t orig_sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->variables.sql_mode|= MODE_INVALID_DATES;
@@ -1766,7 +1766,7 @@ public:
result= copy_inner();
thd->count_cuted_fields= saved_count_cuted_fields;
- thd->variables.sql_mode= sql_mode;
+ thd->variables.sql_mode= orig_sql_mode;
return result;
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 0cee0dc6ad2..38b45a7a2c9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -9669,7 +9669,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
List<Item> all_fields;
bool auto_increment_field_copied= 0;
bool init_read_record_done= 0;
- ulonglong save_sql_mode= thd->variables.sql_mode;
+ sql_mode_t save_sql_mode= thd->variables.sql_mode;
ulonglong prev_insert_id, time_to_report_progress;
Field **dfield_ptr= to->default_field;
DBUG_ENTER("copy_data_between_tables");
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index d3954d0ee73..7dbc8513418 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1388,7 +1388,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
information about mode in old format.
*/
sql_mode= ((trg_sql_mode= itm++) ? *trg_sql_mode :
- global_system_variables.sql_mode);
+ (ulonglong) global_system_variables.sql_mode);
trg_create_time= it_create_times++; // May be NULL if old file
trg_definer= it_definer++; // May be NULL if old file
@@ -1871,7 +1871,7 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd,
LEX_STRING *new_table_name)
{
struct change_table_name_param param;
- ulonglong save_sql_mode= thd->variables.sql_mode;
+ sql_mode_t save_sql_mode= thd->variables.sql_mode;
char path_buff[FN_REFLEN];
param.thd= thd;
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index f1161cdd967..afe47fb36f4 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -109,7 +109,7 @@ public:
LEX_STRING db_cl_name;
GRANT_INFO subject_table_grants;
- ulonglong sql_mode;
+ sql_mode_t sql_mode;
/* Store create time. Can't be mysql_time_t as this holds also sub seconds */
ulonglong create_time;
trg_event_type event;
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index c0d9ba48121..55550ddfb8a 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -914,7 +914,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view_query.length(0);
is_query.length(0);
{
- ulong sql_mode= thd->variables.sql_mode & MODE_ANSI_QUOTES;
+ sql_mode_t sql_mode= thd->variables.sql_mode & MODE_ANSI_QUOTES;
thd->variables.sql_mode&= ~MODE_ANSI_QUOTES;
lex->unit.print(&view_query, enum_query_type(QT_VIEW_INTERNAL |
@@ -1346,7 +1346,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
view_select= &lex->select_lex;
view_select->select_number= ++thd->select_number;
- ulonglong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
/* switch off modes which can prevent normal parsing of VIEW
- MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
+ MODE_PIPES_AS_CONCAT affect expression parsing
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 7f4d988b072..e88ec1e374f 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -3001,7 +3001,7 @@ static Sys_var_ulonglong Sys_sort_buffer(
VALID_RANGE(MIN_SORT_MEMORY, SIZE_T_MAX), DEFAULT(MAX_SORT_MEMORY),
BLOCK_SIZE(1));
-export ulonglong expand_sql_mode(ulonglong sql_mode)
+export sql_mode_t expand_sql_mode(sql_mode_t sql_mode)
{
if (sql_mode & MODE_ANSI)
{
@@ -3055,7 +3055,7 @@ export ulonglong expand_sql_mode(ulonglong sql_mode)
static bool check_sql_mode(sys_var *self, THD *thd, set_var *var)
{
var->save_result.ulonglong_value=
- expand_sql_mode(var->save_result.ulonglong_value);
+ (ulonglong) expand_sql_mode(var->save_result.ulonglong_value);
return false;
}
static bool fix_sql_mode(sys_var *self, THD *thd, enum_var_type type)
diff --git a/sql/table.cc b/sql/table.cc
index 8d0a40858da..4c68bcb468a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2403,7 +2403,7 @@ static bool sql_unusable_for_discovery(THD *thd, handlerton *engine,
int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write,
const char *sql, size_t sql_length)
{
- ulonglong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
CHARSET_INFO *old_cs= thd->variables.character_set_client;
Parser_state parser_state;
bool error;
@@ -3795,7 +3795,7 @@ bool get_field(MEM_ROOT *mem, Field *field, String *res)
String str(buff,sizeof(buff),&my_charset_bin);
bool rc;
THD *thd= field->get_thd();
- ulonglong sql_mode_backup= thd->variables.sql_mode;
+ sql_mode_t sql_mode_backup= thd->variables.sql_mode;
thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
field->val_str(&str);
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index d18ee0efff2..b8fae8dbd86 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2216,7 +2216,7 @@ static int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len)
{
String log_query;
sp_head *sp = thd->lex->sphead;
- ulong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
String retstr(64);
retstr.set_charset(system_charset_info);