List:Commits« Previous MessageNext Message »
From:tomas Date:June 1 2006 12:52pm
Subject:bk commit into 5.1 tree (tomas:1.2183) BUG#18483
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2183 06/06/01 14:51:58 tomas@stripped +3 -0
  Bug #18483 Cannot create table with FK constraint
  - remove error set for auto partitioned tables

  sql/sql_table.cc
    1.338 06/06/01 14:51:48 tomas@stripped +2 -1
    Bug #18483 Cannot create table with FK constraint
    - remove error set for auto partitioned tables

  mysql-test/t/ndb_basic.test
    1.43 06/06/01 14:51:48 tomas@stripped +14 -0
    Bug #18483 Cannot create table with FK constraint
    - remove error set for auto partitioned tables

  mysql-test/r/ndb_basic.result
    1.43 06/06/01 14:51:48 tomas@stripped +8 -0
    Bug #18483 Cannot create table with FK constraint
    - remove error set for auto partitioned tables

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new-ndb

--- 1.337/sql/sql_table.cc	2006-05-31 18:07:27 +02:00
+++ 1.338/sql/sql_table.cc	2006-06-01 14:51:48 +02:00
@@ -3106,7 +3106,8 @@
     }
     while ((key= key_iterator++))
     {
-      if (key->type == Key::FOREIGN_KEY)
+      if (key->type == Key::FOREIGN_KEY &&
+          !part_info->is_auto_partitioned)
       {
         my_error(ER_CANNOT_ADD_FOREIGN, MYF(0));
         goto err;

--- 1.42/mysql-test/r/ndb_basic.result	2006-05-25 13:48:51 +02:00
+++ 1.43/mysql-test/r/ndb_basic.result	2006-06-01 14:51:48 +02:00
@@ -748,3 +748,11 @@
 111111	aaaaaa	1
 222222	bbbbbb	2
 drop table t1;
+CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
+CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
+CREATE TABLE t2(a VARCHAR(255) NOT NULL,
+b VARCHAR(255) NOT NULL,
+c VARCHAR(255) NOT NULL,
+CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
+CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
+drop table t1, t2;

--- 1.42/mysql-test/t/ndb_basic.test	2006-05-15 10:50:25 +02:00
+++ 1.43/mysql-test/t/ndb_basic.test	2006-06-01 14:51:48 +02:00
@@ -713,3 +713,17 @@
 select * from t1 order by f2;
 select * from t1 order by f3;
 drop table t1;
+
+#
+# Bug #18483 Cannot create table with FK constraint
+# ndb does not support foreign key constraint, it is silently ignored
+# in line with other storage engines
+#
+CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
+                 CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
+CREATE TABLE t2(a VARCHAR(255) NOT NULL,
+                b VARCHAR(255) NOT NULL,
+                c VARCHAR(255) NOT NULL,
+                CONSTRAINT pk_b_c_id PRIMARY KEY (b,c),
+                CONSTRAINT fk_a FOREIGN KEY(a) REFERENCES t1(a))engine=ndb;
+drop table t1, t2;
Thread
bk commit into 5.1 tree (tomas:1.2183) BUG#18483tomas1 Jun