summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 54a213d8553..57eb31a3542 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -887,6 +887,8 @@ typedef struct system_variables
vers_asof_timestamp_t vers_asof_timestamp;
ulong vers_alter_history;
my_bool binlog_alter_two_phase;
+
+ Charset_collation_map_st character_set_collations;
} SV;
/**
@@ -2925,7 +2927,9 @@ public:
typedef uint used_t;
enum { RAND_USED=1, TIME_ZONE_USED=2, QUERY_START_SEC_PART_USED=4,
- THREAD_SPECIFIC_USED=8 };
+ THREAD_SPECIFIC_USED=8,
+ CHARACTER_SET_COLLATIONS_USED= 16
+ };
used_t used;
@@ -5620,6 +5624,29 @@ public:
};
+class Character_set_collations_used: public Charset_collation_map_st::Used
+{
+ THD *m_thd;
+public:
+ Character_set_collations_used(THD *thd)
+ :m_thd(thd)
+ { }
+ ~Character_set_collations_used()
+ {
+ /*
+ Mark THD that the collation map was used,
+ no matter if a compiled or a mapped collation was
+ found during charset->collation resolution.
+ Even if the map was empty, we still need to print
+ SET @@session.character_set_collations='';
+ in mariadb-binlog output.
+ */
+ if (m_used)
+ m_thd->used|= THD::CHARACTER_SET_COLLATIONS_USED;
+ }
+};
+
+
/*
Start a new independent transaction for the THD.
The old one is stored in this object and restored when calling