From 59df1009222a73fbd184987d1c8700f86b30792b Mon Sep 17 00:00:00 2001
From: Alexander Barkov <bar@mariadb.org>
Date: Mon, 30 Mar 2015 10:57:44 +0400
Subject: [PATCH] Removing Item_string::m_cs_specified and making
 Item_string::is_cs_specified() virtual instead.

---
 sql/item.h | 34 ++++++----------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/sql/item.h b/sql/item.h
index 42468593dd8..825496e3e9a 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2688,22 +2688,7 @@ class Item_static_float_func :public Item_float
 
 class Item_string :public Item_basic_constant
 {
-  bool m_cs_specified;
 protected:
-  /**
-    Set the value of m_cs_specified attribute.
-
-    m_cs_specified attribute shows whether character-set-introducer was
-    explicitly specified in the original query for this text literal or
-    not. The attribute makes sense (is used) only for views.
-
-    This operation is to be called from the parser during parsing an input
-    query.
-  */
-  inline void set_cs_specified(bool cs_specified)
-  {
-    m_cs_specified= cs_specified;
-  }
   void fix_from_value(Derivation dv, const Metadata metadata)
   {
     fix_charset_and_length_from_str_value(dv, metadata);
@@ -2718,7 +2703,6 @@ class Item_string :public Item_basic_constant
 protected:
   /* Just create an item and do not fill string representation */
   Item_string(CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
-    : m_cs_specified(FALSE)
   {
     collation.set(cs, dv);
     max_length= 0;
@@ -2728,7 +2712,6 @@ class Item_string :public Item_basic_constant
   }
 public:
   Item_string(CHARSET_INFO *csi, const char *str_arg, uint length_arg)
-    : m_cs_specified(FALSE)
   {
     collation.set(csi, DERIVATION_COERCIBLE);
     set_name(NULL, 0, system_charset_info);
@@ -2740,21 +2723,18 @@ class Item_string :public Item_basic_constant
   // Constructors with the item name set from its value
   Item_string(const char *str, uint length, CHARSET_INFO *cs,
               Derivation dv, uint repertoire)
-    : m_cs_specified(FALSE)
   {
     str_value.set_or_copy_aligned(str, length, cs);
     fix_and_set_name_from_value(dv, Metadata(&str_value, repertoire));
   }
   Item_string(const char *str, uint length,
               CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
-    : m_cs_specified(FALSE)
   {
     str_value.set_or_copy_aligned(str, length, cs);
     fix_and_set_name_from_value(dv, Metadata(&str_value));
   }
   Item_string(const String *str, CHARSET_INFO *tocs, uint *conv_errors,
               Derivation dv, uint repertoire)
-    :m_cs_specified(false)
   {
     if (str_value.copy(str, tocs, conv_errors))
       str_value.set("", 0, tocs); // EOM ?
@@ -2764,7 +2744,6 @@ class Item_string :public Item_basic_constant
   // Constructors with an externally provided item name
   Item_string(const char *name_par, const char *str, uint length,
               CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
-    :m_cs_specified(false)
   {
     str_value.set_or_copy_aligned(str, length, cs);
     fix_from_value(dv, Metadata(&str_value));
@@ -2772,7 +2751,6 @@ class Item_string :public Item_basic_constant
   }
   Item_string(const char *name_par, const char *str, uint length,
               CHARSET_INFO *cs, Derivation dv, uint repertoire)
-    :m_cs_specified(false)
   {
     str_value.set_or_copy_aligned(str, length, cs);
     fix_from_value(dv, Metadata(&str_value, repertoire));
@@ -2836,9 +2814,9 @@ class Item_string :public Item_basic_constant
       the original query.
       @retval FALSE otherwise.
   */
-  inline bool is_cs_specified() const
+  virtual bool is_cs_specified() const
   {
-    return m_cs_specified;
+    return false;
   }
 
   String *check_well_formed_result(bool send_error)
@@ -2881,14 +2859,14 @@ class Item_string_with_introducer :public Item_string
 public:
   Item_string_with_introducer(const char *str, uint length, CHARSET_INFO *cs)
     :Item_string(str, length, cs)
-  {
-    set_cs_specified(true);
-  }
+  { }
   Item_string_with_introducer(const char *name,
                               const char *str, uint length, CHARSET_INFO *tocs)
     :Item_string(name, str, length, tocs)
+  { }
+  virtual bool is_cs_specified() const
   {
-    set_cs_specified(true);
+    return true;
   }
 };
 
-- 
2.30.9