summaryrefslogtreecommitdiff
path: root/innobase/include/row0mysql.ic
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-02-08 16:41:34 +0200
committerunknown <marko@hundin.mysql.fi>2005-02-08 16:41:34 +0200
commitf9a394dbddb83d899dd661542490d1965400bdbe (patch)
tree1d41c43c651ff0ac97e4022bf7e9181709da34e2 /innobase/include/row0mysql.ic
parent63bcbfc4339ae843dc367d08fff0760da4d484c3 (diff)
downloadmariadb-git-f9a394dbddb83d899dd661542490d1965400bdbe.tar.gz
InnoDB: Fix Bug #7350 without hard-coding charset-collation numbers.
innobase/data/data0type.c: Add mbminlen and mbmaxlen to dtype_t innobase/include/data0type.h: Add mbminlen and mbmaxlen to dtype_t Add dtype_get_mbminlen() and dtype_get_mbmaxlen() innobase/include/data0type.ic: Add dtype_set_mblen() Add dtype_get_mbminlen() and dtype_get_mbmaxlen() Replace innobase_is_mb_cset() with innobase_get_mb_cset() innobase/include/row0mysql.h: Add mbminlen and mbmaxlen innobase/include/row0mysql.ic: Detect UCS2 collations based on mbminlen innobase/row/row0sel.c: Detect UCS2 collations based on mbminlen sql/ha_innodb.cc: Replace innobase_is_mb_cset() with innobase_get_mb_cset() build_template(): Initialize templ->mbminlen and templ->mbmaxlen
Diffstat (limited to 'innobase/include/row0mysql.ic')
-rw-r--r--innobase/include/row0mysql.ic15
1 files changed, 5 insertions, 10 deletions
diff --git a/innobase/include/row0mysql.ic b/innobase/include/row0mysql.ic
index fc922b52d0a..1f5d0b0c990 100644
--- a/innobase/include/row0mysql.ic
+++ b/innobase/include/row0mysql.ic
@@ -93,17 +93,11 @@ row_mysql_store_col_in_innobase_format(
|| type == DATA_BINARY) {
/* Remove trailing spaces. */
- /* Handle UCS2 strings differently. As no new
- collations will be introduced in 4.1, we hardcode the
- charset-collation codes here. In 5.0, the logic will
- be based on mbminlen. */
- ulint cset = dtype_get_charset_coll(
- dtype_get_prtype(dfield_get_type(dfield)));
+ /* Handle UCS2 strings differently. */
+ ulint mbminlen = dtype_get_mbminlen(
+ dfield_get_type(dfield));
ptr = row_mysql_read_var_ref(&col_len, mysql_data);
- if (cset == 35/*ucs2_general_ci*/
- || cset == 90/*ucs2_bin*/
- || (cset >= 128/*ucs2_unicode_ci*/
- && cset <= 144/*ucs2_persian_ci*/)) {
+ if (mbminlen == 2) {
/* space=0x0020 */
/* Trim "half-chars", just in case. */
col_len &= ~1;
@@ -113,6 +107,7 @@ row_mysql_store_col_in_innobase_format(
col_len -= 2;
}
} else {
+ ut_a(mbminlen == 1);
/* space=0x20 */
while (col_len > 0 && ptr[col_len - 1] == 0x20) {
col_len--;