Loading mysql-test/r/ndb_basic.result +16 −0 Original line number Diff line number Diff line Loading @@ -677,3 +677,19 @@ select * from atablewithareallylongandirritatingname; a 2 drop table atablewithareallylongandirritatingname; create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB; insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1); insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2); select * from t1 order by f1; f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 select * from t1 order by f2; f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 select * from t1 order by f3; f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 drop table t1; mysql-test/t/ndb_basic.test +11 −0 Original line number Diff line number Diff line Loading @@ -623,3 +623,14 @@ create table atablewithareallylongandirritatingname (a int); insert into atablewithareallylongandirritatingname values (2); select * from atablewithareallylongandirritatingname; drop table atablewithareallylongandirritatingname; # # Bug#15682 # create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB; insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1); insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2); select * from t1 order by f1; select * from t1 order by f2; select * from t1 order by f3; drop table t1; ndb/src/kernel/blocks/dbtc/Dbtc.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,8 @@ #define ZALREADYEXIST 630 #define ZINCONSISTENTHASHINDEX 892 #define ZNOTUNIQUE 893 #define ZINVALID_KEY 290 #endif class Dbtc: public SimulatedBlock { Loading ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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; } /* Loading Loading @@ -2941,8 +2948,16 @@ 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; ApiConnectRecord * const regApiPtr = apiConnectptr.p; Loading ndb/src/kernel/vm/SimulatedBlock.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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; Loading Loading
mysql-test/r/ndb_basic.result +16 −0 Original line number Diff line number Diff line Loading @@ -677,3 +677,19 @@ select * from atablewithareallylongandirritatingname; a 2 drop table atablewithareallylongandirritatingname; create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB; insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1); insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2); select * from t1 order by f1; f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 select * from t1 order by f2; f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 select * from t1 order by f3; f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 drop table t1;
mysql-test/t/ndb_basic.test +11 −0 Original line number Diff line number Diff line Loading @@ -623,3 +623,14 @@ create table atablewithareallylongandirritatingname (a int); insert into atablewithareallylongandirritatingname values (2); select * from atablewithareallylongandirritatingname; drop table atablewithareallylongandirritatingname; # # Bug#15682 # create table t1 (f1 varchar(50), f2 text,f3 int, primary key(f1)) engine=NDB; insert into t1 (f1,f2,f3)VALUES("111111","aaaaaa",1); insert into t1 (f1,f2,f3)VALUES("222222","bbbbbb",2); select * from t1 order by f1; select * from t1 order by f2; select * from t1 order by f3; drop table t1;
ndb/src/kernel/blocks/dbtc/Dbtc.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,8 @@ #define ZALREADYEXIST 630 #define ZINCONSISTENTHASHINDEX 892 #define ZNOTUNIQUE 893 #define ZINVALID_KEY 290 #endif class Dbtc: public SimulatedBlock { Loading
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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; } /* Loading Loading @@ -2941,8 +2948,16 @@ 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; ApiConnectRecord * const regApiPtr = apiConnectptr.p; Loading
ndb/src/kernel/vm/SimulatedBlock.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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; Loading