List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:August 7 2008 9:12pm
Subject:bzr push into mysql-6.0-falcon branch (vvaintroub:2770 to 2771)
View as plain text  
 2771 Vladislav Vaintroub	2008-08-07
      0 is a perfectly valid value for section ids, yet it is treated as invalid in some
      cases - there are a couple of checks in Table.cpp for it. I defined Section::INVALID_SECTION_ID  
      constant to -1 which is *really* invalid and replaced checks for 0 with checks for 
      Section::INVALID_SECTION_ID.
      
      Misc:
      - disabled 22165 test, as it crashes still
      - correct error code returned by drop tablespace if  file already exists.
      
      
      
       
modified:
  mysql-test/suite/falcon/t/disabled.def
  storage/falcon/Dbb.cpp
  storage/falcon/Section.h
  storage/falcon/StorageHandler.cpp
  storage/falcon/Table.cpp

 2770 Vladislav Vaintroub	2008-08-07 [merge]
      merge
modified:
  storage/falcon/MemMgr.cpp
  storage/falcon/MemMgr.h

=== modified file 'mysql-test/suite/falcon/t/disabled.def'
--- a/mysql-test/suite/falcon/t/disabled.def	2008-05-22 12:58:47 +0000
+++ b/mysql-test/suite/falcon/t/disabled.def	2008-08-07 21:11:55 +0000
@@ -12,3 +12,4 @@
 
 falcon_bug_28095_I  : Bug#xxxxx 2008-04-22 hakank Disabled until soft restart is in main tree
 falcon_bug_28095_II : Bug#xxxxx 2008-03-22 hakank Disabled until soft restart is in main tree
+falcon_bug_22165 : Bug#22165 2008-08-07 wlad Disabled temporarily, because it crashes. Work in progress

=== modified file 'storage/falcon/Dbb.cpp'
--- a/storage/falcon/Dbb.cpp	2008-07-24 08:45:03 +0000
+++ b/storage/falcon/Dbb.cpp	2008-08-07 21:11:55 +0000
@@ -369,6 +369,8 @@ void Dbb::expungeRecord(Section *section
 
 Section* Dbb::findSection(int32 sectionId)
 {
+	ASSERT(sectionId != Section::INVALID_SECTION_ID);
+
 	int slot = sectionId % SECTION_HASH_SIZE;
 	Section *section;
 

=== modified file 'storage/falcon/Section.h'
--- a/storage/falcon/Section.h	2008-03-11 16:15:47 +0000
+++ b/storage/falcon/Section.h	2008-08-07 21:11:55 +0000
@@ -43,6 +43,7 @@ struct SectionAnalysis;
 class Section  
 {
 public:
+	static const int INVALID_SECTION_ID = -1;
 	void redoDataPage (int32 pageNumber, int32 locatorPageNumber);
 	Section(Dbb *dbb, int32 id, TransId transId);
 	virtual ~Section();

=== modified file 'storage/falcon/StorageHandler.cpp'
--- a/storage/falcon/StorageHandler.cpp	2008-08-07 18:18:29 +0000
+++ b/storage/falcon/StorageHandler.cpp	2008-08-07 21:11:55 +0000
@@ -490,7 +490,7 @@ int StorageHandler::createTablespace(con
 
 	if (!tableSpaceManager->waitForPendingDrop(filename, 10))
 		// file still exists after waiting for 10 seconds
-		return  StorageErrorTableSpaceExist;
+		return  StorageErrorTableSpaceDataFileExist;
 
 	try
 		{

=== modified file 'storage/falcon/Table.cpp'
--- a/storage/falcon/Table.cpp	2008-08-01 17:56:28 +0000
+++ b/storage/falcon/Table.cpp	2008-08-07 21:11:55 +0000
@@ -794,8 +794,8 @@ void Table::init(int id, const char *sch
 	fields = NULL;
 	indexes = NULL;
 	fieldCount = 0;
-	blobSectionId = 0;
-	dataSectionId = 0;
+	blobSectionId = Section::INVALID_SECTION_ID;
+	dataSectionId = Section::INVALID_SECTION_ID;
 	blobSection = NULL;
 	dataSection = NULL;
 	backloggedRecords = NULL;
@@ -1371,7 +1371,7 @@ void Table::reIndexInversion(Transaction
 
 bool Table::isCreated()
 {
-	return dataSectionId != 0;
+	return dataSectionId != Section::INVALID_SECTION_ID;
 }
 
 Index* Table::getPrimaryKey()
@@ -3232,13 +3232,17 @@ void Table::expunge(Transaction *transac
 	if (transaction)
 		transaction->hasUpdates = true;
 
-	if (dataSectionId || blobSectionId)
+	if (dataSectionId != Section::INVALID_SECTION_ID)
 		{
 		dbb->deleteSection(dataSectionId, TRANSACTION_ID(transaction));
-		dataSectionId = 0;
+		dataSectionId = Section::INVALID_SECTION_ID;
 		dataSection = NULL;
+		}
+
+	if (blobSectionId != Section::INVALID_SECTION_ID)
+		{
 		dbb->deleteSection(blobSectionId, TRANSACTION_ID(transaction));
-		blobSectionId = 0;
+		blobSectionId = Section::INVALID_SECTION_ID;
 		blobSection = NULL;
 		}
 }
@@ -3641,14 +3645,21 @@ Format* Table::getCurrentFormat(void)
 
 void Table::findSections(void)
 {
+	ASSERT(dataSectionId != Section::INVALID_SECTION_ID && 
+		blobSectionId != Section::INVALID_SECTION_ID);
+
 	if (!dataSection)
 		{
 		dataSection = dbb->findSection(dataSectionId);
 		dataSection->table = this;
 		}
+	ASSERT(dataSection->sectionId == dataSectionId);
 
 	if (!blobSection)
+		{
 		blobSection = dbb->findSection(blobSectionId);
+		}
+	ASSERT(blobSection->sectionId == blobSectionId);
 }
 
 bool Table::validateUpdate(int32 recordNumber, TransId transactionId)

Thread
bzr push into mysql-6.0-falcon branch (vvaintroub:2770 to 2771) Vladislav Vaintroub7 Aug