diff options
author | marko@hundin.mysql.fi <> | 2005-02-08 16:41:34 +0200 |
---|---|---|
committer | marko@hundin.mysql.fi <> | 2005-02-08 16:41:34 +0200 |
commit | e7c10dd2d806f84c7c3b8a9447153d1ac17fc6ae (patch) | |
tree | 1d41c43c651ff0ac97e4022bf7e9181709da34e2 /sql/ha_innodb.cc | |
parent | 6e6daf818943e34d72017f64e496d6d94c90134f (diff) | |
download | mariadb-git-e7c10dd2d806f84c7c3b8a9447153d1ac17fc6ae.tar.gz |
InnoDB: Fix Bug #7350 without hard-coding charset-collation numbers.
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index be493138fd0..16e9760d624 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -535,22 +535,31 @@ innobase_mysql_print_thd( } /********************************************************************** -Determines whether the given character set is of variable length. +Get the variable length bounds of the given character set. NOTE that the exact prototype of this function has to be in /innobase/data/data0type.ic! */ extern "C" -ibool -innobase_is_mb_cset( -/*================*/ - ulint cset) /* in: MySQL charset-collation code */ +void +innobase_get_mb_cset( +/*=================*/ + ulint cset, /* in: MySQL charset-collation code */ + ulint* mbminlen, /* out: minimum length of a char (in bytes) */ + ulint* mbmaxlen) /* out: maximum length of a char (in bytes) */ { CHARSET_INFO* cs; ut_ad(cset < 256); + ut_ad(mbminlen); + ut_ad(mbmaxlen); cs = all_charsets[cset]; - - return(cs && cs->mbminlen != cs->mbmaxlen); + if (cs) { + *mbminlen = cs->mbminlen; + *mbmaxlen = cs->mbmaxlen; + } else { + ut_a(cset == 0); + *mbminlen = *mbmaxlen = 0; + } } /********************************************************************** @@ -2453,6 +2462,8 @@ build_template( templ->type = get_innobase_type_from_mysql_type(field); templ->charset = dtype_get_charset_coll_noninline( index->table->cols[i].type.prtype); + templ->mbminlen = index->table->cols[i].type.mbminlen; + templ->mbmaxlen = index->table->cols[i].type.mbmaxlen; templ->is_unsigned = (ulint) (field->flags & UNSIGNED_FLAG); if (templ->type == DATA_BLOB) { |