summaryrefslogtreecommitdiffstats
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sql/item_timefunc.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index b624a381..db38e44d 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -3080,6 +3080,13 @@ void Item_char_typecast::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN(" charset "));
str->append(cast_cs->cs_name);
+ /*
+ Print the "binary" keyword in cases like:
+ CAST('str' AS CHAR CHARACTER SET latin1 BINARY)
+ */
+ if ((cast_cs->state & MY_CS_BINSORT) &&
+ Charset(cast_cs).can_have_collate_clause())
+ str->append(STRING_WITH_LEN(" binary"));
}
str->append(')');
}