diff options
author | unknown <pekka@mysql.com> | 2005-02-08 10:33:58 +0100 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2005-02-08 10:33:58 +0100 |
commit | 7e0ac12bd380e544e938fc5c3246d741fcf46bf3 (patch) | |
tree | 6fec84c3dc7872a7a0736b95b7a74c27db52e99b /ndb/test/ndbapi/testOIBasic.cpp | |
parent | 42116bf2e1216a614b78e0da19e674cb72744845 (diff) | |
download | mariadb-git-7e0ac12bd380e544e938fc5c3246d741fcf46bf3.tar.gz |
ndb - workaround to strnxfrm 5.0 problem
ndb/src/common/util/NdbSqlUtil.cpp:
strnxfrm bug, may not write the length it says
ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp:
fix index in debug print
ndb/test/ndbapi/testOIBasic.cpp:
do not generate too many mb chars, not checked in TUP
Diffstat (limited to 'ndb/test/ndbapi/testOIBasic.cpp')
-rw-r--r-- | ndb/test/ndbapi/testOIBasic.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 33482bd9b11..ce1851083b1 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -1812,14 +1812,16 @@ Val::calckeychars(Par par, unsigned i, unsigned& n, unsigned char* buf) const Chs* chs = col.m_chs; CHARSET_INFO* cs = chs->m_cs; n = 0; - // our random chars may not fill value exactly - while (n + cs->mbmaxlen <= col.m_bytelength) { + unsigned len = 0; + while (len < col.m_length) { if (i % (1 + n) == 0) { break; } const Chr& chr = chs->m_chr[i % maxcharcount]; + assert(n + chr.m_size <= col.m_bytelength); memcpy(buf + n, chr.m_bytes, chr.m_size); n += chr.m_size; + len++; } } @@ -1884,8 +1886,8 @@ Val::calcnokeychars(Par par, unsigned& n, unsigned char* buf) const Chs* chs = col.m_chs; CHARSET_INFO* cs = chs->m_cs; n = 0; - // our random chars may not fill value exactly - while (n + cs->mbmaxlen <= col.m_bytelength) { + unsigned len = 0; + while (len < col.m_length) { if (urandom(1 + col.m_bytelength) == 0) { break; } @@ -1898,8 +1900,10 @@ Val::calcnokeychars(Par par, unsigned& n, unsigned char* buf) unsigned i = half + r; assert(i < maxcharcount); const Chr& chr = chs->m_chr[i]; + assert(n + chr.m_size <= col.m_bytelength); memcpy(buf + n, chr.m_bytes, chr.m_size); n += chr.m_size; + len++; } } |