mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
data0type.ic, rem0cmp.c:
Allow foreign keys refer between fixed and var length strings innobase/rem/rem0cmp.c: Allow foreign keys refer between fixed and var length strings innobase/include/data0type.ic: Allow foreign keys refer between fixed and var length strings
This commit is contained in:
@ -107,14 +107,17 @@ dtype_get_pad_char(
|
|||||||
ULINT_UNDEFINED if no padding specified */
|
ULINT_UNDEFINED if no padding specified */
|
||||||
dtype_t* type) /* in: type */
|
dtype_t* type) /* in: type */
|
||||||
{
|
{
|
||||||
if (type->mtype == DATA_CHAR) {
|
if (type->mtype == DATA_CHAR
|
||||||
/* space is the padding character for all char strings */
|
|| type->mtype == DATA_VARCHAR
|
||||||
|
|| type->mtype == DATA_BINARY
|
||||||
|
|| type->mtype == DATA_FIXBINARY) {
|
||||||
|
|
||||||
|
/* Space is the padding character for all char and binary
|
||||||
|
strings */
|
||||||
|
|
||||||
return((ulint)' ');
|
return((ulint)' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
ut_ad((type->mtype == DATA_BINARY) || (type->mtype == DATA_VARCHAR));
|
|
||||||
|
|
||||||
/* No padding specified */
|
/* No padding specified */
|
||||||
|
|
||||||
return(ULINT_UNDEFINED);
|
return(ULINT_UNDEFINED);
|
||||||
|
@ -100,7 +100,15 @@ cmp_types_are_equal(
|
|||||||
dtype_t* type1, /* in: type 1 */
|
dtype_t* type1, /* in: type 1 */
|
||||||
dtype_t* type2) /* in: type 2 */
|
dtype_t* type2) /* in: type 2 */
|
||||||
{
|
{
|
||||||
if (type1->mtype != type2->mtype) {
|
if ((type1->mtype == DATA_VARCHAR && type2->mtype == DATA_CHAR)
|
||||||
|
|| (type1->mtype == DATA_CHAR && type2->mtype == DATA_VARCHAR)
|
||||||
|
|| (type1->mtype == DATA_FIXBINARY && type2->mtype == DATA_BINARY)
|
||||||
|
|| (type1->mtype == DATA_BINARY && type2->mtype == DATA_FIXBINARY)) {
|
||||||
|
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type1->mtype != type2->mtype) {
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user