summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <alexander.barkov@oracle.com>2011-03-03 18:39:26 +0300
committerAlexander Barkov <alexander.barkov@oracle.com>2011-03-03 18:39:26 +0300
commita1e9be8e8b17e5f14be9edc558e69c4f68d01fab (patch)
tree38604e17050632461c1318bbac41cb32c3d0029b /sql/item_strfunc.h
parent1bc5e76efb18a5c69f711b4c57a4ff275b187141 (diff)
downloadmariadb-git-a1e9be8e8b17e5f14be9edc558e69c4f68d01fab.tar.gz
Bug 11766519 - 59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
Part 2. Function QUOTE() was not multi-byte safe. @ mysql-test/r/ctype_ucs.result @ mysql-test/t/ctype_ucs.test Adding tests @ sql/item_strfunc.cc Fixing Item_func_quote::val_str to be multi-byte safe. @ sql/item_strfunc.h Multiple size needed for quote characters to mbmaxlen
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 408062ddc08..3cf9f283d39 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -704,9 +704,10 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
- ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 + 2;
- max_length= (uint32) min(max_result_length, MAX_BLOB_WIDTH);
collation.set(args[0]->collation);
+ ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 +
+ 2 * collation.collation->mbmaxlen;
+ max_length= (uint32) min(max_result_length, MAX_BLOB_WIDTH);
}
};