diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-04-13 13:16:49 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-04-13 17:50:00 +0200 |
commit | f7f0bc748e88f911b957d3dbf3bc0828a33675fb (patch) | |
tree | 0e8a5be3ea7994ed48a29ea5fb5771997b99b92d | |
parent | fc8396448c44517b891adaaeda17370ba5eeae54 (diff) | |
download | mariadb-git-f7f0bc748e88f911b957d3dbf3bc0828a33675fb.tar.gz |
cleanup: un-inline dtype_get_mblen()
per Marko request
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 25 | ||||
-rw-r--r-- | storage/innobase/include/data0type.h | 1 | ||||
-rw-r--r-- | storage/innobase/include/data0type.inl | 34 | ||||
-rw-r--r-- | storage/innobase/include/ha_prototypes.h | 9 |
4 files changed, 24 insertions, 45 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 528f810bf8d..cec7fe3c615 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2406,7 +2406,7 @@ innobase_mysql_print_thd( /******************************************************************//** Get the variable length bounds of the given character set. */ -void +static void innobase_get_cset_width( /*====================*/ ulint cset, /*!< in: MySQL charset-collation code */ @@ -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. */ void diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 5c79458e5a9..40d9412d27f 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -325,7 +325,6 @@ dtype_get_prtype( /*********************************************************************//** Compute the mbminlen and mbmaxlen members of a data type structure. */ -UNIV_INLINE void dtype_get_mblen( /*============*/ diff --git a/storage/innobase/include/data0type.inl b/storage/innobase/include/data0type.inl index 06d90959855..329cee5d190 100644 --- a/storage/innobase/include/data0type.inl +++ b/storage/innobase/include/data0type.inl @@ -68,30 +68,6 @@ dtype_get_mysql_type( 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. */ -UNIV_INLINE -void dtype_set_mblen( /*============*/ dtype_t* type) /*!< in/out: type */ @@ -374,16 +350,6 @@ dtype_get_fixed_size_low( } else if (!comp) { return static_cast<unsigned>(len); } 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) { return static_cast<unsigned>(len); } diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 2dd7c571386..3d217dc3243 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -140,15 +140,6 @@ uint8_t 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. @return 0 if a=b, <0 if a<b, >1 if a>b */ int |