List:Commits« Previous MessageNext Message »
From:Pekka Nousiainen Date:August 25 2012 12:49pm
Subject:bzr push into mysql-5.5-cluster-7.3-fk branch (pekka.nousiainen:3901 to
3902)
View as plain text  
 3902 magnus.blaudd@stripped	2012-07-13
      ndb test
       - don't run ndb_fk_cascade_delete_multi on Windows until we
        have removed the use of create and drop_fk tools completely

    modified:
      mysql-test/suite/ndb/t/ndb_fk_cascade_delete_multi.test
 3901 magnus.blaudd@stripped	2012-07-13 [merge]
      Merge 7.3-fk -> 7.3

    added:
      mysql-test/suite/ndb/r/ndb_fk_alter.result
      mysql-test/suite/ndb/r/ndb_fk_bugs.result
      mysql-test/suite/ndb/r/ndb_fk_build.result
      mysql-test/suite/ndb/r/ndb_fk_cascade_delete.result
      mysql-test/suite/ndb/r/ndb_fk_cascade_delete_multi.result
      mysql-test/suite/ndb/r/ndb_fk_cascade_update.result
      mysql-test/suite/ndb/r/ndb_fk_create_drop.result
      mysql-test/suite/ndb/r/ndb_fk_locking.result
      mysql-test/suite/ndb/r/ndb_fk_multi_column.result
      mysql-test/suite/ndb/r/ndb_fk_noaction.result
      mysql-test/suite/ndb/r/ndb_fk_restrict.result
      mysql-test/suite/ndb/r/ndb_fk_setnull.result
      mysql-test/suite/ndb/t/find_ndb_fk_tools.inc
      mysql-test/suite/ndb/t/ndb_fk_alter.test
      mysql-test/suite/ndb/t/ndb_fk_bugs.test
      mysql-test/suite/ndb/t/ndb_fk_build.test
      mysql-test/suite/ndb/t/ndb_fk_cascade_delete.test
      mysql-test/suite/ndb/t/ndb_fk_cascade_delete_multi.test
      mysql-test/suite/ndb/t/ndb_fk_cascade_update.test
      mysql-test/suite/ndb/t/ndb_fk_create_drop.test
      mysql-test/suite/ndb/t/ndb_fk_locking.test
      mysql-test/suite/ndb/t/ndb_fk_multi_column.test
      mysql-test/suite/ndb/t/ndb_fk_noaction.test
      mysql-test/suite/ndb/t/ndb_fk_restrict.test
      mysql-test/suite/ndb/t/ndb_fk_setnull.test
      sql/ha_ndb_ddl_fk.cc
      storage/ndb/include/kernel/signaldata/BuildFK.hpp
      storage/ndb/include/kernel/signaldata/BuildFKImpl.hpp
      storage/ndb/include/kernel/signaldata/CreateFK.hpp
      storage/ndb/include/kernel/signaldata/CreateFKImpl.hpp
      storage/ndb/include/kernel/signaldata/DropFK.hpp
      storage/ndb/include/kernel/signaldata/DropFKImpl.hpp
      storage/ndb/test/tools/create_fk.cpp
      storage/ndb/test/tools/drop_fk.cpp
    modified:
      .bzr-mysql/default.conf
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/sql_class.h
      sql/sql_partition.cc
      sql/sql_table.cc
      sql/sql_yacc.yy
      storage/ndb/include/kernel/GlobalSignalNumbers.h
      storage/ndb/include/kernel/Interpreter.hpp
      storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
      storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp
      storage/ndb/include/kernel/signaldata/ListTables.hpp
      storage/ndb/include/kernel/signaldata/LqhKey.hpp
      storage/ndb/include/kernel/signaldata/UtilPrepare.hpp
      storage/ndb/include/kernel/trigger_definitions.h
      storage/ndb/include/ndb_constants.h
      storage/ndb/include/ndbapi/NdbDictionary.hpp
      storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcProxy.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcProxy.hpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp
      storage/ndb/src/kernel/blocks/trix/Trix.cpp
      storage/ndb/src/kernel/blocks/trix/Trix.hpp
      storage/ndb/src/ndbapi/NdbDictionary.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
      storage/ndb/src/ndbapi/Ndbif.cpp
      storage/ndb/src/ndbapi/ndberror.c
      storage/ndb/test/tools/CMakeLists.txt
      storage/ndb/tools/listTables.cpp
=== renamed file 'mysql-test/suite/ndb/t/have_ndb_fk.inc' => 'mysql-test/suite/ndb/t/find_ndb_fk_tools.inc'
--- a/mysql-test/suite/ndb/t/have_ndb_fk.inc	2012-05-16 08:48:45 +0000
+++ b/mysql-test/suite/ndb/t/find_ndb_fk_tools.inc	2012-07-13 11:05:01 +0000
@@ -7,23 +7,24 @@ use lib "lib/";
 use My::Find;
 
 #
-# Look for ndbinfo.sql, if not found: skip test.
+# Look for the tools to create and drop fk, if not found: skip test.
 #
 
 #
-# Set up paths
+# Setup paths
 #
 my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR";
 my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR";
 my $basedir = dirname($mysql_test_dir);
+my $bindir = $ENV{MTR_BINDIR} || $basedir;
 
 #
-# Check if the needed tests are available
+# Check if the necessary tools are available
 #
-my $create_fk = my_find_bin($basedir,
+my $create_fk = my_find_bin($bindir,
                              ["storage/ndb/test/tools", "bin"],
                             "create_fk", NOT_REQUIRED);
-my $drop_fk = my_find_bin($basedir,
+my $drop_fk = my_find_bin($bindir,
                              ["storage/ndb/test/tools", "bin"],
                             "drop_fk", NOT_REQUIRED);
 

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_alter.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_alter.test	2012-05-16 10:02:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_alter.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 ###
 ### PK vs PK

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_bugs.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_bugs.test	2012-05-29 16:39:13 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_bugs.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 -- disable_warnings
 drop table if exists t2, t1;

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_build.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_build.test	2012-05-16 09:50:51 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_build.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 create table parent (
   a int primary key,

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_cascade_delete.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_cascade_delete.test	2012-05-16 09:58:21 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_cascade_delete.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 ###
 ### PK vs PK

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_cascade_delete_multi.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_cascade_delete_multi.test	2012-05-16 09:58:21 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_cascade_delete_multi.test	2012-07-13 13:46:09 +0000
@@ -1,5 +1,8 @@
+# Does not work on Windows until we got rid of create_fk and drop_fk
+-- source include/not_windows.inc
+
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
+-- source find_ndb_fk_tools.inc
 
 create table emp (
   id int primary key auto_increment,

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_cascade_update.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_cascade_update.test	2012-05-16 10:00:15 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_cascade_update.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 create table parent (
   a int primary key auto_increment,

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_create_drop.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_create_drop.test	2012-05-16 09:50:51 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_create_drop.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 ###
 ### PK vs PK

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_locking.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_locking.test	2012-05-16 10:02:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_locking.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 connect (con1,localhost,root,,test);
 connect (con2,localhost,root,,test);

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_multi_column.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_multi_column.test	2012-05-16 10:01:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_multi_column.test	2012-07-13 11:05:01 +0000
@@ -1,6 +1,5 @@
 -- source include/have_innodb.inc
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 connect (con1,localhost,root,,test);
 connect (con2,localhost,root,,test);

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_noaction.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_noaction.test	2012-05-16 10:02:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_noaction.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 connect (con1,localhost,root,,test);
 connect (con2,localhost,root,,test);

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_restrict.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_restrict.test	2012-05-16 10:02:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_restrict.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 connect (con1,localhost,root,,test);
 connect (con2,localhost,root,,test);

=== modified file 'mysql-test/suite/ndb/t/ndb_fk_setnull.test'
--- a/mysql-test/suite/ndb/t/ndb_fk_setnull.test	2012-05-16 09:59:14 +0000
+++ b/mysql-test/suite/ndb/t/ndb_fk_setnull.test	2012-07-13 11:05:01 +0000
@@ -1,5 +1,4 @@
 -- source include/have_ndb.inc
--- source have_ndb_fk.inc
 
 create table parent (
   a int primary key auto_increment,

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2012-07-09 12:22:46 +0000
+++ b/sql/sql_class.h	2012-07-13 10:37:45 +0000
@@ -218,11 +218,12 @@ public:
 
 class Alter_drop :public Sql_alloc {
 public:
-  enum drop_type {KEY, COLUMN
 #ifndef MCP_WL6244
-                  ,FOREIGN_KEY
+  // Add FOREIGN_KEY as drop_type
+  enum drop_type {KEY, COLUMN, FOREIGN_KEY };
+#else
+  enum drop_type {KEY, COLUMN };
 #endif
-  };
   const char *name;
   enum drop_type type;
   Alter_drop(enum drop_type par_type,const char *par_name)

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2012-05-16 09:47:25 +0000
+++ b/sql/sql_partition.cc	2012-07-13 10:04:58 +0000
@@ -4610,22 +4610,17 @@ uint prep_alter_part_table(THD *thd, TAB
 
 #ifndef MCP_WL6244
   /*
-    This is a (poor) attempt to say that ndb supports foreign keys
-  */
-  if (table->part_info && (alter_info->flags & ALTER_FOREIGN_KEY))
+    Circumvent hardcoded "Foreign keys not supported on partitioned tables"
+    for engines which uses auto partitioning and table is using HASH
+   */
+  if (table->part_info && (alter_info->flags & ALTER_FOREIGN_KEY) &&
+      table->part_info->part_type == HASH_PARTITION &&
+      table->part_info->use_default_num_partitions &&
+      table->s->db_type()->partition_flags &&
+      table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION)
   {
-    if (table->part_info->part_type == HASH_PARTITION &&
-#if MYSQL_VERSION_ID >= 50501
-        table->part_info->use_default_num_partitions &&
-#else
-        table->part_info->use_default_no_partitions &&
-#endif
-        (table->s->db_type()->partition_flags &&
-         (table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION)))
-    {
-      DBUG_RETURN(FALSE);
-    }
-  }
+    ; // Allow this ALTER to continue in the function
+  } else
 #endif
 
   /* Foreign keys on partitioned tables are not supported, waits for WL#148 */

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2012-07-09 12:22:46 +0000
+++ b/sql/sql_table.cc	2012-07-13 10:37:45 +0000
@@ -6327,7 +6327,9 @@ mysql_prepare_alter_table(THD *thd, TABL
   uint used_fields= create_info->used_fields;
   KEY *key_info=table->key_info;
   bool rc= TRUE;
+#ifndef MCP_WL6244
   uint drop_fk_count= 0;
+#endif
 
   DBUG_ENTER("mysql_prepare_alter_table");
 
@@ -6654,7 +6656,8 @@ mysql_prepare_alter_table(THD *thd, TABL
 #ifndef MCP_WL6244
   {
     /*
-      Count the no of DROP FOREIGN KEY
+      Count the number of DROP FOREIGN KEY still in the list,
+      it's not an error to have them there
     */
     drop_it.rewind();
     Alter_drop *drop;
@@ -6664,9 +6667,11 @@ mysql_prepare_alter_table(THD *thd, TABL
         drop_fk_count++;
     }
   }
-#endif
 
   if (alter_info->drop_list.elements > drop_fk_count)
+#else
+  if (alter_info->drop_list.elements)
+#endif
   {
     my_error(ER_CANT_DROP_FIELD_OR_KEY, MYF(0),
              alter_info->drop_list.head()->name);

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2012-07-09 12:22:46 +0000
+++ b/sql/sql_yacc.yy	2012-07-13 10:37:45 +0000
@@ -6807,11 +6807,8 @@ alter_list_item:
         | DROP FOREIGN KEY_SYM opt_ident
           {
 #ifndef MCP_WL6244
-#if MYSQL_VERSION_ID >= 50501
+            /* Maintain list of altered/dropped foregin keys */
             Alter_drop *ad= new Alter_drop(Alter_drop::FOREIGN_KEY, $4.str);
-#else
-            Alter_drop *ad= new Alter_drop(Alter_drop::FOREIGN_KEY, $4);
-#endif
             if (ad == NULL)
               MYSQL_YYABORT;
             Lex->alter_info.drop_list.push_back(ad);

=== modified file 'storage/ndb/include/ndbapi/NdbDictionary.hpp'
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp	2012-05-16 09:11:14 +0000
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp	2012-07-13 11:27:11 +0000
@@ -207,7 +207,6 @@ public:
   class Table; // forward declaration
   class Tablespace; // forward declaration
   class HashMap; // Forward
-//  class NdbEventOperation; // forward declaration
 
   /**
    * @class Column
@@ -2053,8 +2052,8 @@ public:
   };
 
   /**
-   * @class HashMap
-   * @brief Represents a HashMap in an NDB Cluster
+   * @class ForeignKey
+   * @brief Represents a foreign key in an NDB Cluster
    *
    */
   class ForeignKey : public Object {
@@ -2289,9 +2288,9 @@ public:
     int listIndexes(List & list, const Table &table) const;
 
     /**
-     * Fetch list object that table depend on
-     * @param list  Reference to list where to store the listed indexes
-     * @param table  Reference to table that object belongs to.
+     * Fetch list of objects that table depend on
+     * @param list  Reference to list where to store the listed objects
+     * @param table  Reference to table that objects belongs to.
      * @return  0 if successful, otherwise -1
      */
     int listDependentObjects(List & list, const Table &table) const;

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2012-07-09 12:22:46 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2012-07-13 11:12:25 +0000
@@ -122,8 +122,8 @@ ErrorBundle ErrorCodes[] = {
   { 839,  DMEC, CV, "Illegal null attribute" },
   { 840,  DMEC, CV, "Trying to set a NOT NULL attribute to NULL" },
   { 893,  HA_ERR_FOUND_DUPP_KEY, CV, "Constraint violation e.g. duplicate value in unique index" },
-  { 255,  HA_ERR_NO_REFERENCED_ROW, CV, "Foreign key constaint violated: No parent row found" },
-  { 256,  HA_ERR_ROW_IS_REFERENCED, CV, "Foreign key constaint violated: Referenced row exists" },
+  { 255,  HA_ERR_NO_REFERENCED_ROW, CV, "Foreign key constraint violated: No parent row found" },
+  { 256,  HA_ERR_ROW_IS_REFERENCED, CV, "Foreign key constraint violated: Referenced row exists" },
 
   /**
    * Node recovery errors

=== modified file 'storage/ndb/test/run-test/conf-ndb07.cnf'
--- a/storage/ndb/test/run-test/conf-ndb07.cnf	2012-03-21 14:43:07 +0000
+++ b/storage/ndb/test/run-test/conf-ndb07.cnf	2012-07-12 15:39:36 +0000
@@ -9,9 +9,9 @@ mt = 2
 
 [mysqld]
 skip-innodb
-loose-skip-bdb
 skip-grant-tables
 socket=mysql.sock
+default-storage-engine=myisam
 
 [client]
 protocol=tcp

=== modified file 'storage/ndb/test/tools/create_fk.cpp'
--- a/storage/ndb/test/tools/create_fk.cpp	2012-05-16 08:44:54 +0000
+++ b/storage/ndb/test/tools/create_fk.cpp	2012-07-13 11:27:11 +0000
@@ -1,6 +1,4 @@
-/*
-   Copyright (C) 2003-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-    All rights reserved. Use is subject to license terms.
+/* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
 
    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
@@ -13,7 +11,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 */
 
 #include <ndb_global.h>

=== modified file 'storage/ndb/test/tools/drop_fk.cpp'
--- a/storage/ndb/test/tools/drop_fk.cpp	2012-05-16 08:44:54 +0000
+++ b/storage/ndb/test/tools/drop_fk.cpp	2012-07-13 11:27:11 +0000
@@ -1,6 +1,4 @@
-/*
-   Copyright (C) 2003-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-    All rights reserved. Use is subject to license terms.
+/* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
 
    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
@@ -13,7 +11,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 */
 
 #include <ndb_global.h>

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.3-fk branch (pekka.nousiainen:3901 to3902) Pekka Nousiainen27 Aug