summaryrefslogtreecommitdiff
path: root/ndb/src/kernel/vm
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2005-12-14 10:57:09 +0100
committerunknown <jonas@perch.ndb.mysql.com>2005-12-14 10:57:09 +0100
commit2c808bed240141a6d35fe4cf49bbf899210d6a77 (patch)
tree4e0d38eb2ad2f5d39885b554678ac2bb5ad24f3b /ndb/src/kernel/vm
parent01c7bd20b9fc28530387eeb5e3165f9ad8535301 (diff)
downloadmariadb-git-2c808bed240141a6d35fe4cf49bbf899210d6a77.tar.gz
bug#15682 - ndb - invalid handling of varchar in position/rnd_pos
mysql-test/r/ndb_basic.result: bug#15682 - invalid handling of varchar in position/rnd_pos mysql-test/t/ndb_basic.test: bug#15682 - invalid handling of varchar in position/rnd_pos ndb/src/kernel/blocks/dbtc/Dbtc.hpp: New error code for invalid key ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Handle invalid key gracefully ndb/src/kernel/vm/SimulatedBlock.cpp: Handle invalid key gracefully ndb/src/ndbapi/ndberror.c: New error code sql/ha_ndbcluster.cc: Fix varchar keys in position/rnd_pos
Diffstat (limited to 'ndb/src/kernel/vm')
-rw-r--r--ndb/src/kernel/vm/SimulatedBlock.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp
index d708052ca4e..6ae6ee98fac 100644
--- a/ndb/src/kernel/vm/SimulatedBlock.cpp
+++ b/ndb/src/kernel/vm/SimulatedBlock.cpp
@@ -1890,7 +1890,10 @@ SimulatedBlock::xfrm_key(Uint32 tab, const Uint32* src,
AttributeDescriptor::getType(keyAttr.attributeDescriptor);
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;
@@ -1902,7 +1905,10 @@ SimulatedBlock::xfrm_key(Uint32 tab, const Uint32* src,
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;