summaryrefslogtreecommitdiff
path: root/innobase/rem
diff options
context:
space:
mode:
authorheikki@donna.mysql.fi <>2002-02-07 12:05:02 +0200
committerheikki@donna.mysql.fi <>2002-02-07 12:05:02 +0200
commit89c2b7fc8e6dc8a8303a60d1a9323262f572ba09 (patch)
tree24871c34e29ee7afa2dbd75899cd83d2929f028a /innobase/rem
parent44a2ef6cdccbdf9e5e29ee143e8f62cd43cc6a9c (diff)
downloadmariadb-git-89c2b7fc8e6dc8a8303a60d1a9323262f572ba09.tar.gz
rem0cmp.c:
Prevent a foreign key constraint references between INT columns where the signedness is different
Diffstat (limited to 'innobase/rem')
-rw-r--r--innobase/rem/rem0cmp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c
index 363bb013ac9..60828b122ba 100644
--- a/innobase/rem/rem0cmp.c
+++ b/innobase/rem/rem0cmp.c
@@ -113,6 +113,16 @@ cmp_types_are_equal(
return(FALSE);
}
+ if (type1->mtype == DATA_INT
+ && (type1->prtype & DATA_UNSIGNED)
+ != (type2->prtype & DATA_UNSIGNED)) {
+ /* The storage format of an unsigned integer is different
+ from a signed integer: in a signed integer we OR
+ 0x8000... to the value of positive integers. */
+
+ return(FALSE);
+ }
+
if (type1->mtype == DATA_MYSQL
|| type1->mtype == DATA_VARMYSQL) {