MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:March 28 2009 6:17pm
Subject:bzr push into mysql-chris branch (christopher.powers:3084 to 3085)
Bug#38375 Bug#42131
View as plain text  
 3085 Christopher Powers	2009-03-28
      Bug #42131, "falcon_backlog test crashes in Record::getEncodedValue"
      Bug #38375, "Falcon crash in Record::isNull"
      For sequential operations such as index and table scans, StorageTable
      caches the current record in StorageTable::record. In rare cases, it is
      possible that StorageTable::record may have been chilled. This is a
      problem if an attempt is made to examine the contents of the record.
      Calls from the server directly into the storage interface, such as
      StorageInterface::rnd_next, bypass the internal checks in Falcon that
      ensure a record is thawed before examining it.To avoid crashes in this
      circumstance, StorageTable::compareKey() now thaws StorageTable::record
      if necessary before examining it.
      Note that it is not necessary to always thaw StorageTable::record, for
      example in StorageTable::setRecord(), because the contents of the
      record is not always examined as it is in compareKey().
      If a thaw is necessary, and if the thaw fails, then compareKey() throws
      an INTERNAL_ERROR exception.

 3084 Olav Sandstaa	2009-03-28
      Fix for Bug #41665 Falcon crash in Transaction::waitForTransaction 
      This crash occurred in the deadlock detector code. The current thread
      A is traversing the waitingFor list while another thread C has just
      aborted (or possibly committed) and is releasing its reference count
      on the transaction state object. A third thread, B, that is just in
      front of C in the waitingFor list is waken up, and also releases its
      reference count on C. If A is inspecting object C as this happens,
      this object is deleted - and can result in thread A crashing.
      The fix to Transaction::waitForTransaction(): Before releasing the
      reference count on the transaction state object we aquire an exclusive
      lock on the active transaction list.  This will avoid that the
      transaction state object is released and deleted while another thread
      is transversing the waitingFor list.
      Also added a missing call to transState->release() in the catch block.

=== modified file 'storage/falcon/StorageTable.cpp'
--- a/storage/falcon/StorageTable.cpp	2009-03-20 19:28:10 +0000
+++ b/storage/falcon/StorageTable.cpp	2009-03-28 18:10:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright � 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright � 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 #include "Bitmap.h"
 #include "Index.h"
 #include "IndexWalker.h"
+#include "SQLError.h"
 #include "SQLException.h"
 #include "Record.h"
 #include "Table.h"
@@ -468,6 +469,9 @@ int StorageTable::compareKey(const unsig
 			Value keyValue;
 			int len = storageDatabase->getSegmentValue(segment, p, &keyValue, index->fields[segmentNumber]);
 			Field *field = index->fields[segmentNumber];
+			if (!record->hasRecord())
+				throw SQLError(INTERNAL_ERROR, "invalid record, state = %d", record->state);
 			if (nullFlag)
@@ -541,6 +545,7 @@ int StorageTable::compareKey(const unsig
 	catch (SQLException& exception)
+		ASSERT(exception.getSqlcode() != INTERNAL_ERROR);
 		return translateError(&exception, StorageErrorDupKey);
@@ -593,6 +598,9 @@ int StorageTable::translateError(SQLExce
 				errorCode = StorageErrorIOErrorSerialLog;
+				errorCode = StorageErrorInternalError;
 				errorCode = defaultStorageError;

=== modified file 'storage/falcon/StorageTableShare.h'
--- a/storage/falcon/StorageTableShare.h	2009-01-21 16:48:25 +0000
+++ b/storage/falcon/StorageTableShare.h	2009-03-28 18:10:17 +0000
@@ -119,7 +119,8 @@ enum StorageError {
 	StorageErrorTableSpaceNotExist	= -109,
 	StorageErrorDeviceFull			= -110,
 	StorageErrorTableSpaceDataFileExist	= -111,
-	StorageErrorIOErrorSerialLog	= -112
+	StorageErrorIOErrorSerialLog	= -112,
+	StorageErrorInternalError		= -113
 static const int StoreErrorIndexShift	= 10;

bzr push into mysql-chris branch (christopher.powers:3084 to 3085)Bug#38375 Bug#42131Christopher Powers28 Mar