Merge branch '10.4' into bb-10.4-mdev16188
This commit is contained in:
commit
294b8c426f
@ -79,67 +79,6 @@ dtype_get_at_most_n_mbchars(
|
|||||||
return(data_len);
|
return(data_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************//**
|
|
||||||
Checks if a data main type is a string type. Also a BLOB is considered a
|
|
||||||
string type.
|
|
||||||
@return TRUE if string type */
|
|
||||||
ibool
|
|
||||||
dtype_is_string_type(
|
|
||||||
/*=================*/
|
|
||||||
ulint mtype) /*!< in: InnoDB main data type code: DATA_CHAR, ... */
|
|
||||||
{
|
|
||||||
if (mtype <= DATA_BLOB
|
|
||||||
|| mtype == DATA_MYSQL
|
|
||||||
|| mtype == DATA_VARMYSQL) {
|
|
||||||
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************//**
|
|
||||||
Checks if a type is a binary string type. Note that for tables created with
|
|
||||||
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
|
|
||||||
those DATA_BLOB columns this function currently returns FALSE.
|
|
||||||
@return TRUE if binary string type */
|
|
||||||
ibool
|
|
||||||
dtype_is_binary_string_type(
|
|
||||||
/*========================*/
|
|
||||||
ulint mtype, /*!< in: main data type */
|
|
||||||
ulint prtype) /*!< in: precise type */
|
|
||||||
{
|
|
||||||
if ((mtype == DATA_FIXBINARY)
|
|
||||||
|| (mtype == DATA_BINARY)
|
|
||||||
|| (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE))) {
|
|
||||||
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************//**
|
|
||||||
Checks if a type is a non-binary string type. That is, dtype_is_string_type is
|
|
||||||
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
|
|
||||||
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
|
|
||||||
For those DATA_BLOB columns this function currently returns TRUE.
|
|
||||||
@return TRUE if non-binary string type */
|
|
||||||
ibool
|
|
||||||
dtype_is_non_binary_string_type(
|
|
||||||
/*============================*/
|
|
||||||
ulint mtype, /*!< in: main data type */
|
|
||||||
ulint prtype) /*!< in: precise type */
|
|
||||||
{
|
|
||||||
if (dtype_is_string_type(mtype) == TRUE
|
|
||||||
&& dtype_is_binary_string_type(mtype, prtype) == FALSE) {
|
|
||||||
|
|
||||||
return(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************//**
|
/*********************************************************************//**
|
||||||
Validates a data type structure.
|
Validates a data type structure.
|
||||||
@return TRUE if ok */
|
@return TRUE if ok */
|
||||||
|
@ -9034,9 +9034,7 @@ innobase_rename_or_enlarge_column_try(
|
|||||||
const Create_field& cf,
|
const Create_field& cf,
|
||||||
bool is_v)
|
bool is_v)
|
||||||
{
|
{
|
||||||
#ifdef UNIV_DEBUG
|
|
||||||
dict_col_t* col;
|
dict_col_t* col;
|
||||||
#endif /* UNIV_DEBUG */
|
|
||||||
dict_v_col_t* v_col;
|
dict_v_col_t* v_col;
|
||||||
|
|
||||||
DBUG_ENTER("innobase_rename_or_enlarge_column_try");
|
DBUG_ENTER("innobase_rename_or_enlarge_column_try");
|
||||||
@ -9049,13 +9047,9 @@ innobase_rename_or_enlarge_column_try(
|
|||||||
if (is_v) {
|
if (is_v) {
|
||||||
v_col = dict_table_get_nth_v_col(user_table, pos);
|
v_col = dict_table_get_nth_v_col(user_table, pos);
|
||||||
pos = dict_create_v_col_pos(v_col->v_pos, v_col->m_col.ind);
|
pos = dict_create_v_col_pos(v_col->v_pos, v_col->m_col.ind);
|
||||||
#ifdef UNIV_DEBUG
|
|
||||||
col = &v_col->m_col;
|
col = &v_col->m_col;
|
||||||
#endif /* UNIV_DEBUG */
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef UNIV_DEBUG
|
|
||||||
col = dict_table_get_nth_col(user_table, pos);
|
col = dict_table_get_nth_col(user_table, pos);
|
||||||
#endif /* UNIV_DEBUG */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ulint prtype, mtype, len;
|
ulint prtype, mtype, len;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||||
Copyright (c) 2017, 2018, MariaDB Corporation.
|
Copyright (c) 2017, 2019, MariaDB Corporation.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under
|
This program is free software; you can redistribute it and/or modify it under
|
||||||
the terms of the GNU General Public License as published by the Free Software
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
@ -262,35 +262,31 @@ dtype_get_at_most_n_mbchars(
|
|||||||
ulint data_len, /*!< in: length of str (in bytes) */
|
ulint data_len, /*!< in: length of str (in bytes) */
|
||||||
const char* str); /*!< in: the string whose prefix
|
const char* str); /*!< in: the string whose prefix
|
||||||
length is being determined */
|
length is being determined */
|
||||||
/*********************************************************************//**
|
/** @return whether main type is a string type */
|
||||||
Checks if a data main type is a string type. Also a BLOB is considered a
|
inline bool dtype_is_string_type(ulint mtype)
|
||||||
string type.
|
{
|
||||||
@return TRUE if string type */
|
return mtype <= DATA_BLOB
|
||||||
ibool
|
|| mtype == DATA_MYSQL || mtype == DATA_VARMYSQL;
|
||||||
dtype_is_string_type(
|
}
|
||||||
/*=================*/
|
|
||||||
ulint mtype); /*!< in: InnoDB main data type code: DATA_CHAR, ... */
|
/** @return whether a type is a binary string type */
|
||||||
/*********************************************************************//**
|
inline bool dtype_is_binary_string_type(ulint mtype, ulint prtype)
|
||||||
Checks if a type is a binary string type. Note that for tables created with
|
{
|
||||||
< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
|
/* Note that for tables created before MySQL 4.0.14,
|
||||||
those DATA_BLOB columns this function currently returns FALSE.
|
we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
|
||||||
@return TRUE if binary string type */
|
For those DATA_BLOB columns we return false. */
|
||||||
ibool
|
|
||||||
dtype_is_binary_string_type(
|
return mtype == DATA_FIXBINARY || mtype == DATA_BINARY
|
||||||
/*========================*/
|
|| (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE));
|
||||||
ulint mtype, /*!< in: main data type */
|
}
|
||||||
ulint prtype);/*!< in: precise type */
|
|
||||||
/*********************************************************************//**
|
/** @return whether a type is a non-binary string type */
|
||||||
Checks if a type is a non-binary string type. That is, dtype_is_string_type is
|
inline bool dtype_is_non_binary_string_type(ulint mtype, ulint prtype)
|
||||||
TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
|
{
|
||||||
with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
|
return dtype_is_string_type(mtype)
|
||||||
For those DATA_BLOB columns this function currently returns TRUE.
|
&& !dtype_is_binary_string_type(mtype, prtype);
|
||||||
@return TRUE if non-binary string type */
|
}
|
||||||
ibool
|
|
||||||
dtype_is_non_binary_string_type(
|
|
||||||
/*============================*/
|
|
||||||
ulint mtype, /*!< in: main data type */
|
|
||||||
ulint prtype);/*!< in: precise type */
|
|
||||||
/*********************************************************************//**
|
/*********************************************************************//**
|
||||||
Sets a data type structure. */
|
Sets a data type structure. */
|
||||||
UNIV_INLINE
|
UNIV_INLINE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user