Commit f7f0bc74 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: un-inline dtype_get_mblen()

per Marko request
parent fc839644
...@@ -2406,7 +2406,7 @@ innobase_mysql_print_thd( ...@@ -2406,7 +2406,7 @@ innobase_mysql_print_thd(
/******************************************************************//** /******************************************************************//**
Get the variable length bounds of the given character set. */ Get the variable length bounds of the given character set. */
void static void
innobase_get_cset_width( innobase_get_cset_width(
/*====================*/ /*====================*/
ulint cset, /*!< in: MySQL charset-collation code */ ulint cset, /*!< in: MySQL charset-collation code */
...@@ -2446,6 +2446,29 @@ innobase_get_cset_width( ...@@ -2446,6 +2446,29 @@ innobase_get_cset_width(
} }
} }
/*********************************************************************//**
Compute the mbminlen and mbmaxlen members of a data type structure. */
void
dtype_get_mblen(
/*============*/
ulint mtype, /*!< in: main type */
ulint prtype, /*!< in: precise type (and collation) */
unsigned*mbminlen, /*!< out: minimum length of a
multi-byte character */
unsigned*mbmaxlen) /*!< out: maximum length of a
multi-byte character */
{
if (dtype_is_string_type(mtype)) {
innobase_get_cset_width(dtype_get_charset_coll(prtype),
mbminlen, mbmaxlen);
ut_ad(*mbminlen <= *mbmaxlen);
ut_ad(*mbminlen < DATA_MBMAX);
ut_ad(*mbmaxlen < DATA_MBMAX);
} else {
*mbminlen = *mbmaxlen = 0;
}
}
/******************************************************************//** /******************************************************************//**
Converts an identifier to a table name. */ Converts an identifier to a table name. */
void void
......
...@@ -325,7 +325,6 @@ dtype_get_prtype( ...@@ -325,7 +325,6 @@ dtype_get_prtype(
/*********************************************************************//** /*********************************************************************//**
Compute the mbminlen and mbmaxlen members of a data type structure. */ Compute the mbminlen and mbmaxlen members of a data type structure. */
UNIV_INLINE
void void
dtype_get_mblen( dtype_get_mblen(
/*============*/ /*============*/
......
...@@ -64,30 +64,6 @@ dtype_get_mysql_type( ...@@ -64,30 +64,6 @@ dtype_get_mysql_type(
return(type->prtype & 0xFFUL); return(type->prtype & 0xFFUL);
} }
/*********************************************************************//**
Compute the mbminlen and mbmaxlen members of a data type structure. */
UNIV_INLINE
void
dtype_get_mblen(
/*============*/
ulint mtype, /*!< in: main type */
ulint prtype, /*!< in: precise type (and collation) */
unsigned*mbminlen, /*!< out: minimum length of a
multi-byte character */
unsigned*mbmaxlen) /*!< out: maximum length of a
multi-byte character */
{
if (dtype_is_string_type(mtype)) {
innobase_get_cset_width(dtype_get_charset_coll(prtype),
mbminlen, mbmaxlen);
ut_ad(*mbminlen <= *mbmaxlen);
ut_ad(*mbminlen < DATA_MBMAX);
ut_ad(*mbmaxlen < DATA_MBMAX);
} else {
*mbminlen = *mbmaxlen = 0;
}
}
/*********************************************************************//** /*********************************************************************//**
Compute the mbminlen and mbmaxlen members of a data type structure. */ Compute the mbminlen and mbmaxlen members of a data type structure. */
UNIV_INLINE UNIV_INLINE
...@@ -374,16 +350,6 @@ dtype_get_fixed_size_low( ...@@ -374,16 +350,6 @@ dtype_get_fixed_size_low(
} else if (!comp) { } else if (!comp) {
return static_cast<unsigned>(len); return static_cast<unsigned>(len);
} else { } else {
#ifdef UNIV_DEBUG
unsigned i_mbminlen, i_mbmaxlen;
innobase_get_cset_width(
dtype_get_charset_coll(prtype),
&i_mbminlen, &i_mbmaxlen);
ut_ad(i_mbminlen == mbminlen);
ut_ad(i_mbmaxlen == mbmaxlen);
#endif /* UNIV_DEBUG */
if (mbminlen == mbmaxlen) { if (mbminlen == mbmaxlen) {
return static_cast<unsigned>(len); return static_cast<unsigned>(len);
} }
......
...@@ -139,15 +139,6 @@ at least ENUM and SET, and unsigned integer types are 'unsigned types' ...@@ -139,15 +139,6 @@ at least ENUM and SET, and unsigned integer types are 'unsigned types'
uint8_t uint8_t
get_innobase_type_from_mysql_type(unsigned *unsigned_flag, const Field *field); get_innobase_type_from_mysql_type(unsigned *unsigned_flag, const Field *field);
/******************************************************************//**
Get the variable length bounds of the given character set. */
void
innobase_get_cset_width(
/*====================*/
ulint cset, /*!< in: MySQL charset-collation code */
unsigned*mbminlen, /*!< out: minimum length of a char (in bytes) */
unsigned*mbmaxlen); /*!< out: maximum length of a char (in bytes) */
/******************************************************************//** /******************************************************************//**
Compares NUL-terminated UTF-8 strings case insensitively. Compares NUL-terminated UTF-8 strings case insensitively.
@return 0 if a=b, <0 if a<b, >1 if a>b */ @return 0 if a=b, <0 if a<b, >1 if a>b */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment