summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-10-25 20:37:45 +0400
committerunknown <evgen@moonbone.local>2005-10-25 20:37:45 +0400
commit947de78a36ddfb2a9619d703bf2423eb647b1960 (patch)
treef5f118464258bde6a2fea4da7b888e8ebab85876 /sql
parentd58f2bdfd7e6fad46156152967ebce1056ba1edc (diff)
parentb96dbef6fd553360f13a52d2b496fe7d86665e7c (diff)
downloadmariadb-git-947de78a36ddfb2a9619d703bf2423eb647b1960.tar.gz
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/14016-bug-4.1-mysql
Diffstat (limited to 'sql')
-rw-r--r--sql/item_timefunc.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 2c53ba82007..7398b1746da 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1528,6 +1528,16 @@ void Item_func_date_format::fix_length_and_dec()
if (args[1]->type() == STRING_ITEM)
{ // Optimize the normal case
fixed_length=1;
+
+ /*
+ Force case sensitive collation on format string.
+ This needed because format modifiers with different case,
+ for example %m and %M, have different meaning. Thus eq()
+ will distinguish them.
+ */
+ args[1]->collation.set(
+ get_charset_by_csname(args[1]->collation.collation->csname,
+ MY_CS_BINSORT,MYF(0)), DERIVATION_COERCIBLE);
/*
The result is a binary string (no reason to use collation->mbmaxlen
This is becasue make_date_time() only returns binary strings