MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:October 15 2009 8:37pm
Subject:bzr push into mysql-5.1-telco-6.2 branch (Martin.Skold:3018) Bug#38502
Bug#44607 Bug#45964 Bug#46113 Bug#46662 Bug#47674 Bug#47816 Bug#47935
View as plain text  
 3018 Martin Skold	2009-10-15 [merge]
      Merge
      modified:
        config/ac-macros/ha_ndbcluster.m4
        mysql-test/suite/ndb/my.cnf
        mysql-test/suite/ndb/r/ndb_config.result
        mysql-test/suite/ndb_binlog/r/ndb_binlog_variants.result
        mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test
        mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
        sql/ha_ndbcluster.cc
        sql/ha_ndbcluster.h
        storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp
        storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
        storage/ndb/include/kernel/signaldata/NodeFailRep.hpp
        storage/ndb/include/ndb_global.h.in
        storage/ndb/include/ndbapi/NdbDictionary.hpp
        storage/ndb/include/ndbapi/NdbOperation.hpp
        storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan.cpp
        storage/ndb/src/kernel/blocks/backup/Backup.cpp
        storage/ndb/src/kernel/blocks/backup/Backup.hpp
        storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
        storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
        storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
        storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
        storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
        storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp
        storage/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp
        storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
        storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
        storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
        storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
        storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
        storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
        storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp
        storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
        storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
        storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp
        storage/ndb/src/kernel/blocks/lgman.cpp
        storage/ndb/src/kernel/blocks/lgman.hpp
        storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
        storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
        storage/ndb/src/kernel/blocks/suma/Suma.cpp
        storage/ndb/src/kernel/blocks/suma/Suma.hpp
        storage/ndb/src/kernel/blocks/trix/Trix.hpp
        storage/ndb/src/kernel/blocks/tsman.cpp
        storage/ndb/src/kernel/blocks/tsman.hpp
        storage/ndb/src/kernel/vm/DLFifoList.hpp
        storage/ndb/src/kernel/vm/DLHashTable.hpp
        storage/ndb/src/kernel/vm/DLList.hpp
        storage/ndb/src/kernel/vm/DataBuffer.hpp
        storage/ndb/src/kernel/vm/SimulatedBlock.cpp
        storage/ndb/src/kernel/vm/SimulatedBlock.hpp
        storage/ndb/src/mgmapi/LocalConfig.cpp
        storage/ndb/src/mgmapi/Makefile.am
        storage/ndb/src/mgmsrv/ConfigInfo.cpp
        storage/ndb/src/ndbapi/NdbDictionary.cpp
        storage/ndb/src/ndbapi/NdbOperation.cpp
        storage/ndb/test/ndbapi/testNdbApi.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt

=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_backup.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_backup.result	2007-11-07 03:48:11 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_backup.result	2009-10-08 09:48:07 +0000
@@ -17,7 +17,7 @@ t1	CREATE TABLE `t1` (
   `f` datetime DEFAULT NULL,
   `g` binary(4) DEFAULT NULL,
   PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) ENGINE=ndbcluster AUTO_INCREMENT=31 DEFAULT CHARSET=latin1
 SELECT * FROM t1 WHERE a = 1 or a = 10 or a = 20 or a = 30 ORDER BY a;
 a	b	c	d	e	f	g
 1	5	3.40282e+38	1.2686868689898e+308	666.66	2007-10-23 23:23:23	1111
@@ -42,7 +42,7 @@ t1	CREATE TABLE `t1` (
   `f` datetime DEFAULT NULL,
   `g` binary(4) DEFAULT NULL,
   PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) ENGINE=ndbcluster AUTO_INCREMENT=31 DEFAULT CHARSET=latin1
 SELECT * FROM t1 WHERE a = 1 or a = 10 or a = 20 or a = 30 ORDER BY a;
 a	b	c	d	e	f	g
 1	5	3.40282e+38	1.2686868689898e+308	666.66	2007-10-23 23:23:23	1111

=== modified file 'mysql-test/suite/ndb/r/ndb_auto_increment.result'
--- a/mysql-test/suite/ndb/r/ndb_auto_increment.result	2009-09-03 07:49:50 +0000
+++ b/mysql-test/suite/ndb/r/ndb_auto_increment.result	2009-10-08 09:58:57 +0000
@@ -499,3 +499,13 @@ evend_id	server_id
 drop trigger tr1;
 drop table t1, t2;
 drop trigger if exists tr1;
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 values (null,1),(null,2),(null,3);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL AUTO_INCREMENT,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`a`)
+) ENGINE=ndbcluster AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+drop table t1;

=== modified file 'mysql-test/suite/ndb/r/ndb_insert.result'
--- a/mysql-test/suite/ndb/r/ndb_insert.result	2008-11-24 17:57:50 +0000
+++ b/mysql-test/suite/ndb/r/ndb_insert.result	2009-10-07 15:53:06 +0000
@@ -661,3 +661,11 @@ a	b
 2	NULL
 3	NULL
 drop table t1;
+create table t1(code varchar(64) not null, PRIMARY KEY (code)) ENGINE=NDBCluster;
+insert into t1 values ('code');
+insert into t1 values ('code');
+ERROR 23000: Duplicate entry 'code' for key 'PRIMARY'
+set sql_mode='STRICT_TRANS_TABLES';
+insert into t1 values ('code');
+ERROR 23000: Duplicate entry 'code' for key 'PRIMARY'
+drop table t1;

=== modified file 'mysql-test/suite/ndb/t/ndb_auto_increment.test'
--- a/mysql-test/suite/ndb/t/ndb_auto_increment.test	2009-09-03 07:49:50 +0000
+++ b/mysql-test/suite/ndb/t/ndb_auto_increment.test	2009-10-08 09:58:57 +0000
@@ -378,3 +378,15 @@ connection server2;
 --disable_warnings
 drop trigger if exists tr1;
 --enable_warnings
+
+#
+# Bug #47865  	SHOW CREATE TABLE does not show the current auto_increment number for ndb tables
+#
+
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+
+insert into t1 values (null,1),(null,2),(null,3);
+
+show create table t1;
+
+drop table t1;
\ No newline at end of file

=== modified file 'mysql-test/suite/ndb/t/ndb_insert.test'
--- a/mysql-test/suite/ndb/t/ndb_insert.test	2008-10-15 12:24:10 +0000
+++ b/mysql-test/suite/ndb/t/ndb_insert.test	2009-10-07 15:53:06 +0000
@@ -643,3 +643,18 @@ insert ignore into t1 values (1,0), (2,0
 select * from t1 order by a;
 drop table t1;
 # End of 4.1 tests
+
+#
+# Bug #35990  	Error code 1062 to 1296 (unknown) after setting sql_mode to STRICT_TRANS_TABLES
+#
+
+create table t1(code varchar(64) not null, PRIMARY KEY (code)) ENGINE=NDBCluster;
+
+insert into t1 values ('code');
+--error ER_DUP_ENTRY
+insert into t1 values ('code');
+
+set sql_mode='STRICT_TRANS_TABLES';
+--error ER_DUP_ENTRY
+insert into t1 values ('code');
+drop table t1;
\ No newline at end of file

=== modified file 'mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result'
--- a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result	2009-05-08 14:43:21 +0000
+++ b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result	2009-10-15 15:45:56 +0000
@@ -337,7 +337,7 @@ t1	CREATE TABLE `t1` (
   `c3` int(11) NOT NULL,
   `c4` bit(1) NOT NULL,
   PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster AUTO_INCREMENT=251 DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY HASH (c3)
 PARTITIONS 4 */
 SHOW CREATE TABLE test.t2;
@@ -348,7 +348,7 @@ t2	CREATE TABLE `t2` (
   `c3` int(11) NOT NULL,
   `c4` bit(1) NOT NULL,
   PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster AUTO_INCREMENT=251 DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (c3)
 (PARTITION p0 ENGINE = ndbcluster,
  PARTITION p1 ENGINE = ndbcluster) */
@@ -360,7 +360,7 @@ t3	CREATE TABLE `t3` (
   `c3` int(11) NOT NULL,
   `c4` bit(1) NOT NULL,
   PRIMARY KEY (`pk1`,`c3`)
-) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster AUTO_INCREMENT=251 DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY RANGE (c3)
 (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
  PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
@@ -373,7 +373,7 @@ t4	CREATE TABLE `t4` (
   `c3` int(11) NOT NULL,
   `c4` bit(1) NOT NULL,
   PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) ENGINE=ndbcluster AUTO_INCREMENT=251 DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY HASH (c3)
 PARTITIONS 2 */
 SHOW CREATE TABLE test.t5;
@@ -384,7 +384,7 @@ t5	CREATE TABLE `t5` (
   `c3` int(11) NOT NULL,
   `c4` bit(1) NOT NULL,
   PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) ENGINE=ndbcluster AUTO_INCREMENT=251 DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (pk1)
 (PARTITION p0 ENGINE = ndbcluster,
  PARTITION p1 ENGINE = ndbcluster) */
@@ -396,7 +396,7 @@ t6	CREATE TABLE `t6` (
   `c3` int(11) NOT NULL,
   `c4` bit(1) NOT NULL,
   PRIMARY KEY (`pk1`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) ENGINE=ndbcluster AUTO_INCREMENT=251 DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY RANGE (pk1)
 (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
  PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2009-10-07 16:27:03 +0000
+++ b/sql/ha_ndbcluster.cc	2009-10-15 15:45:56 +0000
@@ -253,18 +253,25 @@ static int ndb_to_mysql_error(const NdbE
   }
 
   /*
-    Push the NDB error message as warning
-    - Used to be able to use SHOW WARNINGS toget more info on what the error is
-    - Used by replication to see if the error was temporary
-  */
-  if (ndberr->status == NdbError::TemporaryError)
-    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-			ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
-			ndberr->code, ndberr->message, "NDB");
-  else
-    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-			ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
-			ndberr->code, ndberr->message, "NDB");
+    If we don't abort directly on warnings push a warning
+    with the internal error information
+   */
+  if (!current_thd->abort_on_warning)
+  {
+    /*
+      Push the NDB error message as warning
+      - Used to be able to use SHOW WARNINGS toget more info on what the error is
+      - Used by replication to see if the error was temporary
+    */
+    if (ndberr->status == NdbError::TemporaryError)
+      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                          ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
+                          ndberr->code, ndberr->message, "NDB");
+    else
+      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                          ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
+                          ndberr->code, ndberr->message, "NDB");
+  }
   return error;
 }
 
@@ -5428,7 +5435,48 @@ static int create_ndb_column(THD *thd,
 void ha_ndbcluster::update_create_info(HA_CREATE_INFO *create_info)
 {
   DBUG_ENTER("update_create_info");
+  THD *thd= current_thd;
   TABLE_SHARE *share= table->s;
+  const NDBTAB *ndbtab= m_table;
+  Ndb *ndb= check_ndb_in_thd(thd);
+
+  /*
+    Find any initial auto_increment value
+   */
+  for (uint i= 0; i < table->s->fields; i++) 
+  {
+    Field *field= table->field[i];
+    if (field->flags & AUTO_INCREMENT_FLAG)
+    {
+      ulonglong auto_value;
+      uint retries= NDB_AUTO_INCREMENT_RETRIES;
+      int retry_sleep= 30; /* 30 milliseconds, transaction */
+      for (;;)
+      {
+        Ndb_tuple_id_range_guard g(m_share);
+        if (ndb->readAutoIncrementValue(ndbtab, g.range, auto_value))
+        {
+          if (--retries && !thd->killed &&
+              ndb->getNdbError().status == NdbError::TemporaryError)
+          {
+            do_retry_sleep(retry_sleep);
+            continue;
+          }
+          const NdbError err= ndb->getNdbError();
+          sql_print_error("Error %lu in ::update_create_info(): %s",
+                          (ulong) err.code, err.message);
+          DBUG_VOID_RETURN;
+        }
+        break;
+      }
+      if (auto_value > 1)
+      {
+        create_info->auto_increment_value= auto_value;
+      }
+      break;
+    }
+  }
+
   if (share->mysql_version < MYSQL_VERSION_TABLESPACE_IN_FRM)
   {
      DBUG_PRINT("info", ("Restored an old table %s, pre-frm_version 7", 
@@ -5436,13 +5484,10 @@ void ha_ndbcluster::update_create_info(H
      if (!create_info->tablespace && !share->tablespace)
      {
        DBUG_PRINT("info", ("Checking for tablespace in ndb"));
-       THD *thd= current_thd;
-       Ndb *ndb= check_ndb_in_thd(thd);
        NDBDICT *ndbdict= ndb->getDictionary();
        NdbError ndberr;
        Uint32 id;
        ndb->setDatabaseName(m_dbname);
-       const NDBTAB *ndbtab= m_table;
        DBUG_ASSERT(ndbtab != NULL);
        if (!ndbtab->getTablespace(&id))
        {

Thread
bzr push into mysql-5.1-telco-6.2 branch (Martin.Skold:3018) Bug#38502Bug#44607 Bug#45964 Bug#46113 Bug#46662 Bug#47674 Bug#47816 Bug#47935Martin Skold15 Oct