List:Commits« Previous MessageNext Message »
From:jonas oreland Date:September 2 2011 6:59am
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4265 to 4266)
View as plain text  
 4266 jonas oreland	2011-09-02 [merge]
      ndb - merge 70 to 71

    added:
      mysql-test/suite/ndb/r/ndb_alter_table_error.result
      mysql-test/suite/ndb/t/ndb_alter_table_error.test
    modified:
      mysql-test/suite/ndb/r/ndb_basic.result
      mysql-test/suite/ndb/t/ndb_basic.test
      storage/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
      storage/ndb/src/ndbapi/ndberror.c
 4265 jonas oreland	2011-09-01 [merge]
      ndb - merge 70 to 71

    modified:
      mysql-test/suite/ndb_rpl/r/ndb_rpl_conflict.result
      mysql-test/suite/ndb_rpl/t/ndb_rpl_conflict.test
      storage/ndb/src/ndbapi/NdbTransaction.cpp
      storage/ndb/test/ndbapi/testBlobs.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
      storage/ndb/tools/ndb_config.cpp
=== added file 'mysql-test/suite/ndb/r/ndb_alter_table_error.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_error.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_error.result	2011-09-02 06:37:29 +0000
@@ -0,0 +1,19 @@
+*******************************
+* basic concurent online alter test
+*******************************
+* With Commit
+*******************************
+CREATE TABLE t1 (a INT UNSIGNED, 
+b INT UNSIGNED not null, 
+primary key(a)) ENGINE NDB;
+begin;
+update t1 set b = b + 1 where a = 1;
+ALTER OFFLINE TABLE t1 ADD c CHAR(19);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+ALTER OFFLINE TABLE t1 ADD c CHAR(19);
+create unique index b_unq on t1(b) using hash;
+ERROR 23000: Can't write, because of unique constraint, to table 't1'
+update t1 set b = b - 1 where a = 1;
+create unique index b_unq on t1(b) using hash;
+DROP TABLE t1;

=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result	2011-07-07 14:48:06 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result	2011-09-02 05:20:56 +0000
@@ -563,6 +563,12 @@ length(b)
 13000
 13000
 drop table t1;
+create table t1 ( c50 char(255), c49 char(255), c48 char(255), c47 char(255), c46 char(255), c45 char(255), c44 char(255), c43 char(255), c42 char(255), c41 char(255), c40 char(255), c39 char(255), c38 char(255), c37 char(255), c36 char(255), c35 char(255), c34 char(255), c33 char(255), c32 char(255), c31 char(255), c30 char(255), c29 char(255), c28 char(255), c27 char(255), c26 char(255), c25 char(255), c24 char(255), c23 char(255), c22 char(255), c21 char(255), c20 char(255), c19 char(255), c18 char(255), c17 char(255), c16 char(255), c15 char(255), c14 char(255), c13 char(255), c12 char(255), c11 char(255), c10 char(255), c9 char(255), c8 char(255), c7 char(255), c6 char(255), c5 char(255), c4 char(255), c3 char(255), c2 char(255), c1 char(255), primary key using hash(c1)) engine=ndb;
+ERROR HY000: Can't create table 'test.t1' (errno: 851)
+show warnings;
+Level	Code	Message
+Error	1296	Got error 851 'Maximum 8052 bytes of FIXED columns supported, use varchar or COLUMN_FORMAT DYNMIC instead' from NDB
+Error	1005	Can't create table 'test.t1' (errno: 851)
 create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`);
 ERROR HY000: Field in list of fields for partition function not found in table
 create table t1 (

=== added file 'mysql-test/suite/ndb/t/ndb_alter_table_error.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_error.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_error.test	2011-09-02 06:37:29 +0000
@@ -0,0 +1,49 @@
+-- source include/not_embedded.inc
+-- source include/have_multi_ndb.inc
+
+--echo *******************************
+--echo * basic concurent online alter test
+--echo *******************************
+--echo * With Commit
+--echo *******************************
+
+connection server1;
+
+CREATE TABLE t1 (a INT UNSIGNED, 
+                 b INT UNSIGNED not null, 
+                 primary key(a)) ENGINE NDB;
+let $v=100;
+disable_query_log;
+while ($v)
+{
+  --eval INSERT INTO t1 VALUES($v,$v); 
+  dec $v;
+}
+enable_query_log;
+
+
+connection server2;
+begin;
+update t1 set b = b + 1 where a = 1;
+
+connection server1;
+--error 1205
+ALTER OFFLINE TABLE t1 ADD c CHAR(19);
+
+connection server2;
+commit;
+
+connection server1;
+--error 0
+ALTER OFFLINE TABLE t1 ADD c CHAR(19);
+
+connection server1;
+--error 1169
+create unique index b_unq on t1(b) using hash;
+
+update t1 set b = b - 1 where a = 1;
+
+connection server1;
+create unique index b_unq on t1(b) using hash;
+
+DROP TABLE t1;

=== modified file 'mysql-test/suite/ndb/t/ndb_basic.test'
--- a/mysql-test/suite/ndb/t/ndb_basic.test	2011-07-06 06:33:09 +0000
+++ b/mysql-test/suite/ndb/t/ndb_basic.test	2011-09-01 18:42:31 +0000
@@ -438,6 +438,21 @@ insert into t1 values (1,@v13000), (2,@v
 select length(b) from t1 order by 1;
 drop table t1;
 
+let $i=50;
+let $separator=;
+let $sql=create table t1 (;
+while ($i)
+{
+  let $sql=$sql$separator c$i char(255);
+  let $separator=,;
+  dec $i;
+}
+let $sql=$sql, primary key using hash(c1)) engine=ndb;
+
+--error 1005
+eval $sql; # eval the sql and create the table
+show warnings;
+
 #
 # test bug#53354 - crash when creating partitioned table with multiple columns in the partition key
 #

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp	2011-09-01 18:42:31 +0000
@@ -34,7 +34,9 @@ public:
   static Uint32 getNullFlagOffset(const Uint32 &);
   static Uint32 getNullFlagByteOffset(const Uint32 & desc);
   static Uint32 getNullFlagBitOffset(const Uint32 &);
-  
+
+  static Uint32 getMaxOffset();
+
   Uint32 m_data;
 
   friend class NdbOut& operator<<(class NdbOut&, const AttributeOffset&);
@@ -143,6 +145,13 @@ AttributeOffset::getNullFlagBitOffset(co
   return (getNullFlagPos(desc) & AO_NULL_FLAG_WORD_MASK);
 }
 
+inline
+Uint32
+AttributeOffset::getMaxOffset()
+{
+  return AO_ATTRIBUTE_OFFSET_MASK;
+}
+
 class NdbOut&
 operator<<(class NdbOut&, const AttributeOffset&);
 

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2011-06-29 07:56:14 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2011-09-01 18:42:31 +0000
@@ -2537,7 +2537,7 @@ private:
   void handleCharsetPos(Uint32 csNumber, CHARSET_INFO** charsetArray,
                         Uint32 noOfCharsets,
                         Uint32 & charsetIndex, Uint32 & attrDes2);
-  void computeTableMetaData(Tablerec *regTabPtr);
+  Uint32 computeTableMetaData(Tablerec *regTabPtr);
 
 //------------------------------------------------------------------
 //------------------------------------------------------------------

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2011-09-01 18:42:31 +0000
@@ -434,7 +434,12 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal*
   }
 
   /* Compute table aggregate metadata. */
-  computeTableMetaData(regTabPtr.p);
+  terrorCode = computeTableMetaData(regTabPtr.p);
+  if (terrorCode)
+  {
+    jam();
+    goto error;
+  }
 
 #if 0
   ndbout << *regTabPtr.p << endl;
@@ -1453,7 +1458,7 @@ Dbtup::handleCharsetPos(Uint32 csNumber,
   This function (re-)computes aggregated metadata. It is called for
   both ALTER TABLE and CREATE TABLE.
  */
-void
+Uint32
 Dbtup::computeTableMetaData(Tablerec *regTabPtr)
 {
   Uint32 dyn_null_words[2];
@@ -1610,6 +1615,10 @@ Dbtup::computeTableMetaData(Tablerec *re
         BitmaskImpl::set(dyn_null_words[ind], regTabPtr->dynVarSizeMask[ind], null_pos);
       }
     }
+    if (off > AttributeOffset::getMaxOffset())
+    {
+      return ZTOO_LARGE_TUPLE_ERROR;
+    }
     AttributeOffset::setOffset(attrDes2, off);
     *tabDesc++= attrDes2;
   }
@@ -1681,6 +1690,7 @@ Dbtup::computeTableMetaData(Tablerec *re
 
   setUpQueryRoutines(regTabPtr);
   setUpKeyArray(regTabPtr);
+  return 0;
 }
 
 void

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2011-07-04 16:30:34 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2011-09-02 06:57:43 +0000
@@ -324,6 +324,8 @@ ErrorBundle ErrorCodes[] = {
   { 829,  DMEC, AE, "Corrupt data received for insert/update" },
   { 831,  DMEC, AE, "Too many nullable/bitfields in table definition" },
   { 850,  DMEC, AE, "Too long or too short default value"},
+  { 851,  DMEC, AE, "Maximum 8052 bytes of FIXED columns supported"
+    ", use varchar or COLUMN_FORMAT DYNMIC instead" },
   { 876,  DMEC, AE, "876" },
   { 877,  DMEC, AE, "877" },
   { 878,  DMEC, AE, "878" },

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4265 to 4266) jonas oreland2 Sep