#At file:///home/cpowers/work/dev/dev-03/mysql/
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.
modified:
storage/falcon/StorageTable.cpp
storage/falcon/StorageTableShare.h
per-file messages:
storage/falcon/StorageTable.cpp
StorageTable::compareKey()
Verify that ::record is thawed before examining contents. If thaw
fails, raise an exception.
StorageTable::translateError
Added INTERNAL_ERROR
storage/falcon/StorageTableShare.h
Added StorageErrorInternalError
=== 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 , 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
case IO_ERROR_SERIALLOG:
errorCode = StorageErrorIOErrorSerialLog;
break;
+
+ case INTERNAL_ERROR:
+ errorCode = StorageErrorInternalError;
default:
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;
| Thread |
|---|
| • bzr commit into mysql-6.0-falcon-team branch (christopher.powers:3085)Bug#38375 Bug#42131 | Christopher Powers | 28 Mar |