List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:May 14 2009 2:37pm
Subject:bzr commit into mysql-5.1-telco-6.2 branch (jonas:2922) Bug#40709
View as plain text  
#At file:///home/jonas/src/telco-6.2/ based on
revid:jonas@stripped

 2922 Jonas Oreland	2009-05-14
      ndb - bug#40709 - refuse to create tables with distribution key on none primary key

    M  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
    M  storage/ndb/src/ndbapi/ndberror.c
=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2009-03-30 12:03:52 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2009-05-14 12:37:37 +0000
@@ -2719,6 +2719,12 @@ NdbDictInterface::serializeTableDesc(Ndb
     if (col->m_distributionKey)
     {
       distKeys++;
+      if (!col->m_pk)
+      {
+        m_error.code = 4327;
+        NdbMem_Free((void*)tmpTab);
+        DBUG_RETURN(-1);
+      }
     }
   }
   if (distKeys == impl.m_noOfKeys)

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2009-05-06 10:16:35 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2009-05-14 12:37:37 +0000
@@ -550,7 +550,7 @@ ErrorBundle ErrorCodes[] = {
   { 4324, DMEC, AE, "Attempt to define distribution group when not prepared to" },
   { 4325, DMEC, AE, "Distribution Group set on table but not defined on first attribute"
},
   { 4326, DMEC, AE, "Distribution Group with erroneus number of bits" },
-  { 4327, DMEC, AE, "Distribution Group with 1 byte attribute is not allowed" },
+  { 4327, DMEC, AE, "Distribution key is only supported on part of primary key" },
   { 4328, DMEC, AE, "Disk memory attributes not yet supported" },
   { 4329, DMEC, AE, "Variable stored attributes not yet supported" },
   { 4340, DMEC, AE, "Result or attribute record must be a base table ndbrecord, not an
index ndbrecord" },


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20090514123737-22w1qjmz0uew9hht.bundle
Thread
bzr commit into mysql-5.1-telco-6.2 branch (jonas:2922) Bug#40709Jonas Oreland14 May 2009