List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:March 13 2009 7:51am
Subject:bzr commit into mysql-5.1-telco-6.2 branch (jonas:2867) Bug#29574
View as plain text  
#At file:///home/jonas/src/telco-6.2/

 2867 Jonas Oreland	2009-03-13
      ndb - bug#29574 - enfore min-limit on undofiles
modified:
  mysql-test/suite/ndb/r/ndb_dd_basic.result
  mysql-test/suite/ndb/t/ndb_dd_basic.test
  storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp
  storage/ndb/src/kernel/blocks/lgman.cpp
  storage/ndb/src/ndbapi/ndberror.c

=== modified file 'mysql-test/suite/ndb/r/ndb_dd_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_dd_basic.result	2008-02-03 20:28:32 +0000
+++ b/mysql-test/suite/ndb/r/ndb_dd_basic.result	2009-03-13 07:51:21 +0000
@@ -22,6 +22,12 @@ USE LOGFILE GROUP lg1
 INITIAL_SIZE 12M;
 Warnings:
 Error	1478	Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 5K
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+ERROR HY000: Failed to create UNDOFILE
 set storage_engine=ndb;
 CREATE LOGFILE GROUP lg1
 ADD UNDOFILE 'undofile.dat'

=== modified file 'mysql-test/suite/ndb/t/ndb_dd_basic.test'
--- a/mysql-test/suite/ndb/t/ndb_dd_basic.test	2008-02-03 20:28:32 +0000
+++ b/mysql-test/suite/ndb/t/ndb_dd_basic.test	2009-03-13 07:51:21 +0000
@@ -41,6 +41,14 @@ ADD DATAFILE 'datafile.dat'
 USE LOGFILE GROUP lg1
 INITIAL_SIZE 12M;
 
+# bug#29574
+--error ER_CREATE_FILEGROUP_FAILED
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 5K
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
 ##################################
 # Basic test of disk tables for NDB
 # Start by creating a logfile group

=== modified file 'storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp	2007-11-12 14:53:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp	2009-03-13 07:51:21 +0000
@@ -164,7 +164,8 @@ struct CreateFileImplRef {
     OutOfMemory = 1511,
     FileReadError = 1512,
     FilegroupNotOnline = 1513,
-    FileSizeTooLarge = 1515
+    FileSizeTooLarge = 1515,
+    FileSizeTooSmall = 1516
   };
   
   Uint32 senderData;

=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp	2009-02-19 14:24:10 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp	2009-03-13 07:51:21 +0000
@@ -550,20 +550,20 @@ Lgman::execCREATE_FILE_REQ(Signal* signa
       break;
     }
     
-    if(ERROR_INSERTED(15000) ||
-       (sizeof(void*) == 4 && req->file_size_hi & 0xFFFFFFFF))
+    if (ERROR_INSERTED(15000) ||
+        (sizeof(void*) == 4 && req->file_size_hi & 0xFFFFFFFF))
     {
       jam();
-      if(signal->getNoOfSections())
-        releaseSections(signal);
-
-      CreateFileImplRef* ref= (CreateFileImplRef*)signal->getDataPtr();
-      ref->senderData = senderData;
-      ref->senderRef = reference();
-      ref->errorCode = CreateFileImplRef::FileSizeTooLarge;
-      sendSignal(senderRef, GSN_CREATE_FILE_REF, signal,
-                 CreateFileImplRef::SignalLength, JBB);
-      return;
+      err = CreateFileImplRef::FileSizeTooLarge;
+      break;
+    }
+    
+    Uint64 sz = (Uint64(req->file_size_hi) << 32) + req->file_size_lo;
+    if (sz < 1024*1024)
+    {
+      jam();
+      err = CreateFileImplRef::FileSizeTooSmall;
+      break;
     }
 
     new (file_ptr.p) Undofile(req, ptr.i);
@@ -574,6 +574,9 @@ Lgman::execCREATE_FILE_REQ(Signal* signa
     open_file(signal, file_ptr, req->requestInfo);
     return;
   } while(0);
+
+  if(signal->getNoOfSections())
+    releaseSections(signal);
   
   CreateFileImplRef* ref= (CreateFileImplRef*)signal->getDataPtr();
   ref->senderData = senderData;

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2009-02-27 13:18:49 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2009-03-13 07:51:21 +0000
@@ -433,7 +433,8 @@ ErrorBundle ErrorCodes[] = {
   { 1513, DMEC, IE, "Filegroup not online" },
   { 1514, DMEC, SE, "Currently there is a limit of one logfile group" },
   { 1515, DMEC, SE, "Currently there is a 4G limit of one undo/data-file in 32-bit host" },
-  
+  { 1516, DMEC, SE, "File to small" },
+
   { 773,  DMEC, SE, "Out of string memory, please modify StringMemory config parameter" },
   { 775,  DMEC, SE, "Create file is not supported when Diskless=1" },
   { 776,  DMEC, AE, "Index created on temporary table must itself be temporary" },

Thread
bzr commit into mysql-5.1-telco-6.2 branch (jonas:2867) Bug#29574Jonas Oreland13 Mar