summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorjonas@perch.ndb.mysql.com <>2005-12-14 11:34:08 +0100
committerjonas@perch.ndb.mysql.com <>2005-12-14 11:34:08 +0100
commit6a0289527645290f8ba8ff3228c209ed24ee7d4d (patch)
tree1b77cc958af0e450485e739522a12fce15740152 /ndb
parent834940e9be231a03da947e5f7ae564a86aa01a86 (diff)
parent1864165ff381e0aa211f6205ee588456fecec111 (diff)
downloadmariadb-git-6a0289527645290f8ba8ff3228c209ed24ee7d4d.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-push
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/blocks/dbtc/Dbtc.hpp2
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp17
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp8
-rw-r--r--ndb/src/ndbapi/ndberror.c2
4 files changed, 25 insertions, 4 deletions
diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
index 8218acc0ea7..cb4f1c6244b 100644
--- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
+++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
@@ -141,6 +141,8 @@
#define ZALREADYEXIST 630
#define ZINCONSISTENTHASHINDEX 892
#define ZNOTUNIQUE 893
+
+#define ZINVALID_KEY 290
#endif
class Dbtc: public SimulatedBlock {
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index d88ffae1d85..d7232030c41 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -2313,7 +2313,10 @@ Dbtc::handle_special_hash(Uint32 dstHash[4], Uint32* src, Uint32 srcLen,
{
keyPartLenPtr = keyPartLen;
dstPos = xfrm_key(tabPtrI, src, dst, sizeof(Tmp) >> 2, keyPartLenPtr);
- ndbrequire(dstPos);
+ if (unlikely(dstPos == 0))
+ {
+ goto error;
+ }
}
else
{
@@ -2334,6 +2337,10 @@ Dbtc::handle_special_hash(Uint32 dstHash[4], Uint32* src, Uint32 srcLen,
dstHash[1] = tmp[1];
}
return true; // success
+
+error:
+ terrorCode = ZINVALID_KEY;
+ return false;
}
/*
@@ -2941,7 +2948,15 @@ void Dbtc::tckeyreq050Lab(Signal* signal)
UintR tnoOfStandby;
UintR tnodeinfo;
+ terrorCode = 0;
+
hash(signal); /* NOW IT IS TIME TO CALCULATE THE HASH VALUE*/
+
+ if (unlikely(terrorCode))
+ {
+ releaseAtErrorLab(signal);
+ return;
+ }
CacheRecord * const regCachePtr = cachePtr.p;
TcConnectRecord * const regTcPtr = tcConnectptr.p;
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index 4625cd43640..3fe76e45322 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -1872,6 +1872,8 @@ SimulatedBlock::xfrm_key(Uint32 tab, const Uint32* src,
xfrm_attr(keyAttr.attributeDescriptor, keyAttr.charsetInfo,
src, srcPos, dst, dstPos, dstSize);
keyPartLen[i++] = dstWords;
+ if (unlikely(dstWords == 0))
+ return 0;
}
return dstPos;
@@ -1900,7 +1902,8 @@ SimulatedBlock::xfrm_attr(Uint32 attrDesc, CHARSET_INFO* cs,
Uint32 typeId = AttributeDescriptor::getType(attrDesc);
Uint32 lb, len;
bool ok = NdbSqlUtil::get_var_length(typeId, srcPtr, srcBytes, lb, len);
- ndbrequire(ok);
+ if (unlikely(!ok))
+ return 0;
Uint32 xmul = cs->strxfrm_multiply;
if (xmul == 0)
xmul = 1;
@@ -1911,7 +1914,8 @@ SimulatedBlock::xfrm_attr(Uint32 attrDesc, CHARSET_INFO* cs,
Uint32 dstLen = xmul * (srcBytes - lb);
ndbrequire(dstLen <= ((dstSize - dstPos) << 2));
int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len);
- ndbrequire(n != -1);
+ if (unlikely(n == -1))
+ return 0;
while ((n & 3) != 0)
{
dstPtr[n++] = 0;
diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c
index 4a9ac9affb7..5ca8ad7be60 100644
--- a/ndb/src/ndbapi/ndberror.c
+++ b/ndb/src/ndbapi/ndberror.c
@@ -227,6 +227,7 @@ ErrorBundle ErrorCodes[] = {
{ 277, IE, "277" },
{ 278, IE, "278" },
{ 287, IE, "Index corrupted" },
+ { 290, IE, "Corrupt key in TC, unable to xfrm" },
{ 631, IE, "631" },
{ 632, IE, "632" },
{ 702, IE, "Request to non-master" },
@@ -295,7 +296,6 @@ ErrorBundle ErrorCodes[] = {
{ 4608, AE, "You can not takeOverScan unless you have used openScanExclusive"},
{ 4609, AE, "You must call nextScanResult before trying to takeOverScan"},
{ 4232, AE, "Parallelism can only be between 1 and 240" },
- { 290, AE, "Scan not started or has been closed by kernel due to timeout" },
/**
* Event schema errors