Skip to content

Commit 7b96416

Browse files
committed
Use sql_mode_t for sql_mode.
This fixed several cases where we where using just ulong for sql_mode
1 parent 8be53a3 commit 7b96416

33 files changed

+88
-59
lines changed

client/mysqlbinlog.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737
#include <sslopt-vars.h>
3838
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
3939
#include "sql_priv.h"
40+
#include "sql_basic_types.h"
4041
#include "log_event.h"
4142
#include "compat56.h"
4243
#include "sql_common.h"
4344
#include "my_dir.h"
4445
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
45-
46-
4746
#include "sql_string.h" // needed for Rpl_filter
4847
#include "sql_list.h" // needed for Rpl_filter
4948
#include "rpl_filter.h"

libmysqld/emb_qcache.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#ifdef HAVE_QUERY_CACHE
2020
#include <mysql.h>
21+
#include "sql_basic_types.h"
2122
#include "emb_qcache.h"
2223
#include "embedded_priv.h"
2324
#include "sql_class.h" // THD

plugin/qc_info/qc_info.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
#define MYSQL_SERVER
3333
#endif
3434

35-
#include <sql_cache.h>
35+
#include <my_global.h>
3636
#include <sql_parse.h> // check_global_access
3737
#include <sql_acl.h> // PROCESS_ACL
3838
#include <sql_class.h> // THD
39+
#include <sql_cache.h>
3940
#include <table.h> // ST_SCHEMA_TABLE
4041
#include <set_var.h> // sql_mode_string_representation
4142
#include <tztime.h>

sql/event_data_objects.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class Event_timed : public Event_queue_element
132132
ulonglong created;
133133
ulonglong modified;
134134

135-
ulong sql_mode;
135+
sql_mode_t sql_mode;
136136

137137
class Stored_program_creation_ctx *creation_ctx;
138138
LEX_STRING body_utf8;
@@ -158,7 +158,7 @@ class Event_job_data : public Event_basic
158158
LEX_STRING definer_user;
159159
LEX_STRING definer_host;
160160

161-
ulong sql_mode;
161+
sql_mode_t sql_mode;
162162

163163
class Stored_program_creation_ctx *creation_ctx;
164164

sql/event_db_repository.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ mysql_event_fill_row(THD *thd,
202202
TABLE *table,
203203
Event_parse_data *et,
204204
sp_head *sp,
205-
ulonglong sql_mode,
205+
sql_mode_t sql_mode,
206206
my_bool is_update)
207207
{
208208
CHARSET_INFO *scs= system_charset_info;
@@ -658,7 +658,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
658658
int ret= 1;
659659
TABLE *table= NULL;
660660
sp_head *sp= thd->lex->sphead;
661-
ulonglong saved_mode= thd->variables.sql_mode;
661+
sql_mode_t saved_mode= thd->variables.sql_mode;
662662
/*
663663
Take a savepoint to release only the lock on mysql.event
664664
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,
787787
CHARSET_INFO *scs= system_charset_info;
788788
TABLE *table= NULL;
789789
sp_head *sp= thd->lex->sphead;
790-
ulonglong saved_mode= thd->variables.sql_mode;
790+
sql_mode_t saved_mode= thd->variables.sql_mode;
791791
/*
792792
Take a savepoint to release only the lock on mysql.event
793793
table at the end but keep the global read lock and

sql/handler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#pragma interface /* gcc class implementation */
2626
#endif
2727

28+
#include <my_global.h> /* For handlers */
2829
#include "sql_const.h"
30+
#include "sql_basic_types.h"
2931
#include "mysqld.h" /* server_id */
3032
#include "sql_plugin.h" /* plugin_ref, st_plugin_int, plugin */
3133
#include "thr_lock.h" /* thr_lock_type, THR_LOCK_DATA */

sql/item.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
13881388
THD *thd= table->in_use;
13891389
enum_check_fields tmp= thd->count_cuted_fields;
13901390
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
1391-
ulonglong sql_mode= thd->variables.sql_mode;
1391+
sql_mode_t sql_mode= thd->variables.sql_mode;
13921392
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
13931393
thd->variables.sql_mode|= MODE_INVALID_DATES;
13941394
thd->count_cuted_fields= CHECK_FIELD_IGNORE;

sql/item_cmpfunc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item,
413413
if ((*item)->const_item() && !(*item)->is_expensive())
414414
{
415415
TABLE *table= field->table;
416-
ulonglong orig_sql_mode= thd->variables.sql_mode;
416+
sql_mode_t orig_sql_mode= thd->variables.sql_mode;
417417
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
418418
my_bitmap_map *old_maps[2];
419419
ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */

sql/item_create.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6279,7 +6279,7 @@ Item *create_temporal_literal(THD *thd,
62796279
MYSQL_TIME_STATUS status;
62806280
MYSQL_TIME ltime;
62816281
Item *item= NULL;
6282-
ulonglong flags= sql_mode_for_dates(thd);
6282+
sql_mode_t flags= sql_mode_for_dates(thd);
62836283

62846284
switch(type)
62856285
{

sql/item_timefunc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ class Item_func_time_to_sec :public Item_func_seconds_hybrid
529529

530530
class Item_temporal_func: public Item_func
531531
{
532-
ulonglong sql_mode;
532+
sql_mode_t sql_mode;
533533
public:
534534
Item_temporal_func(THD *thd): Item_func(thd) {}
535535
Item_temporal_func(THD *thd, Item *a): Item_func(thd, a) {}

0 commit comments

Comments
 (0)