MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:September 22 2009 6:19am
Subject:bzr commit into mysql-5.1-telco-7.1 branch (Martin.Skold:3020) Bug#39268
Bug#42614
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-7.1/

 3020 Martin Skold	2009-09-22 [merge]
      Merge
      modified:
        mysql-test/suite/ndb/r/ndb_multi.result
        mysql-test/suite/ndb/t/ndb_multi.test
        sql/ha_ndbcluster.cc
        sql/ha_ndbcluster_binlog.cc
        sql/ha_ndbcluster_binlog.h
        storage/ndb/src/ndbapi/Ndb.cpp

=== modified file 'mysql-test/suite/ndb/r/ndb_multi.result'
--- a/mysql-test/suite/ndb/r/ndb_multi.result	2007-11-12 10:42:37 +0000
+++ b/mysql-test/suite/ndb/r/ndb_multi.result	2009-09-17 13:53:38 +0000
@@ -143,3 +143,39 @@ show tables like '%$%';
 Tables_in_test (%$%)
 show tables like '%$%';
 Tables_in_test (%$%)
+create table t1(s char(1)) engine = myisam;
+insert into t1 values ("a"),("b"),("c");
+create table t1(s char(1)) engine = ndb;
+insert into t1 values ("d"),("e"),("f");
+Restarting mysqld
+use test;
+select * from t1 order by s;
+s
+a
+b
+c
+select * from t1 order by s;
+s
+d
+e
+f
+drop table t1;
+select * from t1 order by s;
+s
+a
+b
+c
+create table t1(s char(1)) engine = ndb;
+insert into t1 values ("g"),("h"),("i");
+show tables;
+Tables_in_test
+t1
+Warnings:
+Warning	1050	Local table test.t1 shadows ndb table
+select * from t1 order by s;
+s
+a
+b
+c
+drop table t1;
+drop table t1;

=== modified file 'mysql-test/suite/ndb/t/ndb_multi.test'
--- a/mysql-test/suite/ndb/t/ndb_multi.test	2008-09-08 14:34:10 +0000
+++ b/mysql-test/suite/ndb/t/ndb_multi.test	2009-09-21 13:53:09 +0000
@@ -155,3 +155,39 @@ show tables like '%$%';
 
 connection server1;
 show tables like '%$%';
+
+#
+# Bug #42614 Mysql auto locate databases can overwrite frm data.
+#
+connection server1;
+create table t1(s char(1)) engine = myisam;
+insert into t1 values ("a"),("b"),("c");
+connection server2;
+create table t1(s char(1)) engine = ndb;
+insert into t1 values ("d"),("e"),("f");
+connection server1;
+## Restart mysqld nodes
+--echo Restarting mysqld
+let $mysqld_name=mysqld.1.1;
+--source include/restart_mysqld.inc
+use test;
+select * from t1 order by s;
+connection server2;
+select * from t1 order by s;
+drop table t1;
+connection server1;
+select * from t1 order by s;
+connection server2;
+create table t1(s char(1)) engine = ndb;
+insert into t1 values ("g"),("h"),("i");
+connection server1;
+show tables;
+select * from t1 order by s;
+
+#
+# Clean-up
+#
+connection server1;
+drop table t1;
+connection server2;
+drop table t1;
\ No newline at end of file

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2009-09-15 14:13:07 +0000
+++ b/sql/ha_ndbcluster.cc	2009-09-22 06:19:29 +0000
@@ -9076,7 +9076,17 @@ int ndbcluster_discover(handlerton *hton
       goto err;
     }
   }
-
+#ifdef HAVE_NDB_BINLOG
+  if (ndbcluster_check_if_local_table(db, name))
+  {
+    DBUG_PRINT("info", ("ndbcluster_discover: Skipping locally defined table '%s.%s'",
+                        db, name));
+    sql_print_error("ndbcluster_discover: Skipping locally defined table '%s.%s'",
+                    db, name);
+    error= 1;
+    goto err;
+  }
+#endif
   *frmlen= len;
   *frmblob= data;
   

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2009-09-11 11:41:01 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2009-09-22 06:19:29 +0000
@@ -146,12 +146,6 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema
 static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object,
                                    bool have_lock);
 
-/*
-  Helper functions
-*/
-static bool ndbcluster_check_if_local_table(const char *dbname, const char *tabname);
-static bool ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname);
-
 #ifndef DBUG_OFF
 /* purecov: begin deadcode */
 static void print_records(TABLE *table, const uchar *record)
@@ -3928,7 +3922,7 @@ err:
 }
 #endif /* HAVE_NDB_BINLOG */
 
-static bool
+bool
 ndbcluster_check_if_local_table(const char *dbname, const char *tabname)
 {
   char key[FN_REFLEN + 1];
@@ -3950,7 +3944,7 @@ ndbcluster_check_if_local_table(const ch
   DBUG_RETURN(false);
 }
 
-static bool
+bool
 ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname)
 {
   DBUG_ENTER("ndbcluster_check_if_local_tables_in_db");

=== modified file 'sql/ha_ndbcluster_binlog.h'
--- a/sql/ha_ndbcluster_binlog.h	2009-06-04 13:14:14 +0000
+++ b/sql/ha_ndbcluster_binlog.h	2009-09-22 06:19:29 +0000
@@ -320,6 +320,14 @@ inline void free_share(NDB_SHARE **share
 
 void set_binlog_flags(NDB_SHARE *share);
 
+/*
+  Helper functions
+*/
+bool
+ndbcluster_check_if_local_table(const char *dbname, const char *tabname);
+bool
+ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname);
+
 inline
 Thd_ndb *
 get_thd_ndb(THD *thd)

=== modified file 'storage/ndb/src/ndbapi/Ndb.cpp'
--- a/storage/ndb/src/ndbapi/Ndb.cpp	2009-09-15 17:01:48 +0000
+++ b/storage/ndb/src/ndbapi/Ndb.cpp	2009-09-22 06:19:29 +0000
@@ -1441,19 +1441,10 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* 
   if (initAutoIncrement() == -1)
     goto error_handler;
 
-/*
-  Fix for
-  Bug #39268 No transaction hints used to update SYSTAB_0 for autoincrement and PK-less table
-  causes crash in 6.4
- */
-#if 0
   // Start transaction with table id as hint
-  tConnection = this->startTransaction(table,
+  tConnection = this->startTransaction(m_sys_tab_0,
                                        (const char *) &aTableId,
                                        sizeof(Uint32));
-#else
-  tConnection = this->startTransaction();
-#endif
 
   if (tConnection == NULL)
     goto error_handler;

Thread
bzr commit into mysql-5.1-telco-7.1 branch (Martin.Skold:3020) Bug#39268Bug#42614Martin Skold22 Sep