Loading ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2364,7 +2364,8 @@ Dbtc::handle_special_hash(Uint32 dstHash[4], Uint32* src, Uint32 srcLen, */ Uint32 dstLen = xmul * (srcBytes - lb); ndbrequire(dstLen <= ((dstSize - dstPos) << 2)); uint n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); ndbrequire(n != -1); while ((n & 3) != 0) { dstPtr[n++] = 0; } Loading ndb/test/ndbapi/testOIBasic.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1978,7 +1978,7 @@ Val::cmpchars(Par par, const unsigned char* buf1, unsigned len1, const unsigned unsigned len = maxxmulsize * col.m_bytelength; int n1 = NdbSqlUtil::strnxfrm_bug7284(cs, x1, chs->m_xmul * len, buf1, len1); int n2 = NdbSqlUtil::strnxfrm_bug7284(cs, x2, chs->m_xmul * len, buf2, len2); assert(n1 == n2); assert(n1 != -1 && n1 == n2); k = memcmp(x1, x2, n1); } else { k = (*cs->coll->strnncollsp)(cs, buf1, len1, buf2, len2, false); Loading sql/ha_ndbcluster.cc +10 −7 Original line number Diff line number Diff line Loading @@ -3420,6 +3420,9 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction) Define NDB column based on Field. Returns 0 or mysql error code. Not member of ha_ndbcluster because NDBCOL cannot be declared. MySQL text types with character set "binary" are mapped to true NDB binary types without a character set. This may change. */ static int create_ndb_column(NDBCOL &col, Loading Loading @@ -3509,7 +3512,7 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Bit); col.setLength(1); } else if (field->flags & BINARY_FLAG) else if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) { col.setType(NDBCOL::Binary); col.setLength(field->pack_length()); Loading @@ -3527,7 +3530,7 @@ static int create_ndb_column(NDBCOL &col, Field_varstring* f= (Field_varstring*)field; if (f->length_bytes == 1) { if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Varbinary); else { col.setType(NDBCOL::Varchar); Loading @@ -3536,7 +3539,7 @@ static int create_ndb_column(NDBCOL &col, } else if (f->length_bytes == 2) { if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Longvarbinary); else { col.setType(NDBCOL::Longvarchar); Loading @@ -3553,7 +3556,7 @@ static int create_ndb_column(NDBCOL &col, // Blob types (all come in as MYSQL_TYPE_BLOB) mysql_type_tiny_blob: case MYSQL_TYPE_TINY_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading @@ -3566,7 +3569,7 @@ static int create_ndb_column(NDBCOL &col, break; //mysql_type_blob: case MYSQL_TYPE_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading @@ -3588,7 +3591,7 @@ static int create_ndb_column(NDBCOL &col, break; mysql_type_medium_blob: case MYSQL_TYPE_MEDIUM_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading @@ -3600,7 +3603,7 @@ static int create_ndb_column(NDBCOL &col, break; mysql_type_long_blob: case MYSQL_TYPE_LONG_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading Loading
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2364,7 +2364,8 @@ Dbtc::handle_special_hash(Uint32 dstHash[4], Uint32* src, Uint32 srcLen, */ Uint32 dstLen = xmul * (srcBytes - lb); ndbrequire(dstLen <= ((dstSize - dstPos) << 2)); uint n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); int n = NdbSqlUtil::strnxfrm_bug7284(cs, dstPtr, dstLen, srcPtr + lb, len); ndbrequire(n != -1); while ((n & 3) != 0) { dstPtr[n++] = 0; } Loading
ndb/test/ndbapi/testOIBasic.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1978,7 +1978,7 @@ Val::cmpchars(Par par, const unsigned char* buf1, unsigned len1, const unsigned unsigned len = maxxmulsize * col.m_bytelength; int n1 = NdbSqlUtil::strnxfrm_bug7284(cs, x1, chs->m_xmul * len, buf1, len1); int n2 = NdbSqlUtil::strnxfrm_bug7284(cs, x2, chs->m_xmul * len, buf2, len2); assert(n1 == n2); assert(n1 != -1 && n1 == n2); k = memcmp(x1, x2, n1); } else { k = (*cs->coll->strnncollsp)(cs, buf1, len1, buf2, len2, false); Loading
sql/ha_ndbcluster.cc +10 −7 Original line number Diff line number Diff line Loading @@ -3420,6 +3420,9 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction) Define NDB column based on Field. Returns 0 or mysql error code. Not member of ha_ndbcluster because NDBCOL cannot be declared. MySQL text types with character set "binary" are mapped to true NDB binary types without a character set. This may change. */ static int create_ndb_column(NDBCOL &col, Loading Loading @@ -3509,7 +3512,7 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Bit); col.setLength(1); } else if (field->flags & BINARY_FLAG) else if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) { col.setType(NDBCOL::Binary); col.setLength(field->pack_length()); Loading @@ -3527,7 +3530,7 @@ static int create_ndb_column(NDBCOL &col, Field_varstring* f= (Field_varstring*)field; if (f->length_bytes == 1) { if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Varbinary); else { col.setType(NDBCOL::Varchar); Loading @@ -3536,7 +3539,7 @@ static int create_ndb_column(NDBCOL &col, } else if (f->length_bytes == 2) { if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Longvarbinary); else { col.setType(NDBCOL::Longvarchar); Loading @@ -3553,7 +3556,7 @@ static int create_ndb_column(NDBCOL &col, // Blob types (all come in as MYSQL_TYPE_BLOB) mysql_type_tiny_blob: case MYSQL_TYPE_TINY_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading @@ -3566,7 +3569,7 @@ static int create_ndb_column(NDBCOL &col, break; //mysql_type_blob: case MYSQL_TYPE_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading @@ -3588,7 +3591,7 @@ static int create_ndb_column(NDBCOL &col, break; mysql_type_medium_blob: case MYSQL_TYPE_MEDIUM_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading @@ -3600,7 +3603,7 @@ static int create_ndb_column(NDBCOL &col, break; mysql_type_long_blob: case MYSQL_TYPE_LONG_BLOB: if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin) col.setType(NDBCOL::Blob); else { col.setType(NDBCOL::Text); Loading