diff options
author | unknown <heikki@donna.mysql.fi> | 2001-12-22 21:08:25 +0200 |
---|---|---|
committer | unknown <heikki@donna.mysql.fi> | 2001-12-22 21:08:25 +0200 |
commit | 5a75207c129cbe38b562aa01c48cda0018ed1b92 (patch) | |
tree | 9dbd307f47a081fd34bb6cb1f3fc9857f7fcce43 /innobase | |
parent | 1b9930b1a8664554175178994e2fd1bf922223e2 (diff) | |
download | mariadb-git-5a75207c129cbe38b562aa01c48cda0018ed1b92.tar.gz |
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
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/data0type.ic | 11 | ||||
-rw-r--r-- | innobase/rem/rem0cmp.c | 10 |
2 files changed, 16 insertions, 5 deletions
diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index 4a62902eb1b..d82d976d076 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -107,14 +107,17 @@ dtype_get_pad_char( ULINT_UNDEFINED if no padding specified */ dtype_t* type) /* in: type */ { - if (type->mtype == DATA_CHAR) { - /* space is the padding character for all char strings */ + if (type->mtype == DATA_CHAR + || 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)' '); } - ut_ad((type->mtype == DATA_BINARY) || (type->mtype == DATA_VARCHAR)); - /* No padding specified */ return(ULINT_UNDEFINED); diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c index f3d9d579aa0..363bb013ac9 100644 --- a/innobase/rem/rem0cmp.c +++ b/innobase/rem/rem0cmp.c @@ -100,7 +100,15 @@ cmp_types_are_equal( dtype_t* type1, /* in: type 1 */ 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); } |