Skip to content

Commit 294b8c4

Browse files
committed
Merge branch '10.4' into bb-10.4-mdev16188
2 parents 98d55b1 + e17fc72 commit 294b8c4

File tree

3 files changed

+26
-97
lines changed

3 files changed

+26
-97
lines changed

storage/innobase/data/data0type.cc

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -79,67 +79,6 @@ dtype_get_at_most_n_mbchars(
7979
return(data_len);
8080
}
8181

82-
/*********************************************************************//**
83-
Checks if a data main type is a string type. Also a BLOB is considered a
84-
string type.
85-
@return TRUE if string type */
86-
ibool
87-
dtype_is_string_type(
88-
/*=================*/
89-
ulint mtype) /*!< in: InnoDB main data type code: DATA_CHAR, ... */
90-
{
91-
if (mtype <= DATA_BLOB
92-
|| mtype == DATA_MYSQL
93-
|| mtype == DATA_VARMYSQL) {
94-
95-
return(TRUE);
96-
}
97-
98-
return(FALSE);
99-
}
100-
101-
/*********************************************************************//**
102-
Checks if a type is a binary string type. Note that for tables created with
103-
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
104-
those DATA_BLOB columns this function currently returns FALSE.
105-
@return TRUE if binary string type */
106-
ibool
107-
dtype_is_binary_string_type(
108-
/*========================*/
109-
ulint mtype, /*!< in: main data type */
110-
ulint prtype) /*!< in: precise type */
111-
{
112-
if ((mtype == DATA_FIXBINARY)
113-
|| (mtype == DATA_BINARY)
114-
|| (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE))) {
115-
116-
return(TRUE);
117-
}
118-
119-
return(FALSE);
120-
}
121-
122-
/*********************************************************************//**
123-
Checks if a type is a non-binary string type. That is, dtype_is_string_type is
124-
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
125-
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
126-
For those DATA_BLOB columns this function currently returns TRUE.
127-
@return TRUE if non-binary string type */
128-
ibool
129-
dtype_is_non_binary_string_type(
130-
/*============================*/
131-
ulint mtype, /*!< in: main data type */
132-
ulint prtype) /*!< in: precise type */
133-
{
134-
if (dtype_is_string_type(mtype) == TRUE
135-
&& dtype_is_binary_string_type(mtype, prtype) == FALSE) {
136-
137-
return(TRUE);
138-
}
139-
140-
return(FALSE);
141-
}
142-
14382
/*********************************************************************//**
14483
Validates a data type structure.
14584
@return TRUE if ok */

storage/innobase/handler/handler0alter.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9034,9 +9034,7 @@ innobase_rename_or_enlarge_column_try(
90349034
const Create_field& cf,
90359035
bool is_v)
90369036
{
9037-
#ifdef UNIV_DEBUG
90389037
dict_col_t* col;
9039-
#endif /* UNIV_DEBUG */
90409038
dict_v_col_t* v_col;
90419039

90429040
DBUG_ENTER("innobase_rename_or_enlarge_column_try");
@@ -9049,13 +9047,9 @@ innobase_rename_or_enlarge_column_try(
90499047
if (is_v) {
90509048
v_col = dict_table_get_nth_v_col(user_table, pos);
90519049
pos = dict_create_v_col_pos(v_col->v_pos, v_col->m_col.ind);
9052-
#ifdef UNIV_DEBUG
90539050
col = &v_col->m_col;
9054-
#endif /* UNIV_DEBUG */
90559051
} else {
9056-
#ifdef UNIV_DEBUG
90579052
col = dict_table_get_nth_col(user_table, pos);
9058-
#endif /* UNIV_DEBUG */
90599053
}
90609054

90619055
ulint prtype, mtype, len;

storage/innobase/include/data0type.h

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, 2018, MariaDB Corporation.
4+
Copyright (c) 2017, 2019, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -262,35 +262,31 @@ dtype_get_at_most_n_mbchars(
262262
ulint data_len, /*!< in: length of str (in bytes) */
263263
const char* str); /*!< in: the string whose prefix
264264
length is being determined */
265-
/*********************************************************************//**
266-
Checks if a data main type is a string type. Also a BLOB is considered a
267-
string type.
268-
@return TRUE if string type */
269-
ibool
270-
dtype_is_string_type(
271-
/*=================*/
272-
ulint mtype); /*!< in: InnoDB main data type code: DATA_CHAR, ... */
273-
/*********************************************************************//**
274-
Checks if a type is a binary string type. Note that for tables created with
275-
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
276-
those DATA_BLOB columns this function currently returns FALSE.
277-
@return TRUE if binary string type */
278-
ibool
279-
dtype_is_binary_string_type(
280-
/*========================*/
281-
ulint mtype, /*!< in: main data type */
282-
ulint prtype);/*!< in: precise type */
283-
/*********************************************************************//**
284-
Checks if a type is a non-binary string type. That is, dtype_is_string_type is
285-
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
286-
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
287-
For those DATA_BLOB columns this function currently returns TRUE.
288-
@return TRUE if non-binary string type */
289-
ibool
290-
dtype_is_non_binary_string_type(
291-
/*============================*/
292-
ulint mtype, /*!< in: main data type */
293-
ulint prtype);/*!< in: precise type */
265+
/** @return whether main type is a string type */
266+
inline bool dtype_is_string_type(ulint mtype)
267+
{
268+
return mtype <= DATA_BLOB
269+
|| mtype == DATA_MYSQL || mtype == DATA_VARMYSQL;
270+
}
271+
272+
/** @return whether a type is a binary string type */
273+
inline bool dtype_is_binary_string_type(ulint mtype, ulint prtype)
274+
{
275+
/* Note that for tables created before MySQL 4.0.14,
276+
we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
277+
For those DATA_BLOB columns we return false. */
278+
279+
return mtype == DATA_FIXBINARY || mtype == DATA_BINARY
280+
|| (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE));
281+
}
282+
283+
/** @return whether a type is a non-binary string type */
284+
inline bool dtype_is_non_binary_string_type(ulint mtype, ulint prtype)
285+
{
286+
return dtype_is_string_type(mtype)
287+
&& !dtype_is_binary_string_type(mtype, prtype);
288+
}
289+
294290
/*********************************************************************//**
295291
Sets a data type structure. */
296292
UNIV_INLINE

0 commit comments

Comments
 (0)