Commit 0338a61c authored by unknown's avatar unknown

ndb - wl-1442 minor


ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  wl-1442 minor
ndb/test/ndbapi/testOIBasic.cpp:
  wl-1442 minor
sql/ha_ndbcluster.cc:
  wl-1442 minor
parent 6648761d
...@@ -2364,7 +2364,8 @@ Dbtc::handle_special_hash(Uint32 dstHash[4], Uint32* src, Uint32 srcLen, ...@@ -2364,7 +2364,8 @@ Dbtc::handle_special_hash(Uint32 dstHash[4], Uint32* src, Uint32 srcLen,
*/ */
Uint32 dstLen = xmul * (srcBytes - lb); Uint32 dstLen = xmul * (srcBytes - lb);
ndbrequire(dstLen <= ((dstSize - dstPos) << 2)); 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) { while ((n & 3) != 0) {
dstPtr[n++] = 0; dstPtr[n++] = 0;
} }
......
...@@ -1978,7 +1978,7 @@ Val::cmpchars(Par par, const unsigned char* buf1, unsigned len1, const unsigned ...@@ -1978,7 +1978,7 @@ Val::cmpchars(Par par, const unsigned char* buf1, unsigned len1, const unsigned
unsigned len = maxxmulsize * col.m_bytelength; unsigned len = maxxmulsize * col.m_bytelength;
int n1 = NdbSqlUtil::strnxfrm_bug7284(cs, x1, chs->m_xmul * len, buf1, len1); 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); 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); k = memcmp(x1, x2, n1);
} else { } else {
k = (*cs->coll->strnncollsp)(cs, buf1, len1, buf2, len2, false); k = (*cs->coll->strnncollsp)(cs, buf1, len1, buf2, len2, false);
......
...@@ -3420,6 +3420,9 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction) ...@@ -3420,6 +3420,9 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction)
Define NDB column based on Field. Define NDB column based on Field.
Returns 0 or mysql error code. Returns 0 or mysql error code.
Not member of ha_ndbcluster because NDBCOL cannot be declared. 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, static int create_ndb_column(NDBCOL &col,
...@@ -3509,7 +3512,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3509,7 +3512,7 @@ static int create_ndb_column(NDBCOL &col,
col.setType(NDBCOL::Bit); col.setType(NDBCOL::Bit);
col.setLength(1); col.setLength(1);
} }
else if (field->flags & BINARY_FLAG) else if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin)
{ {
col.setType(NDBCOL::Binary); col.setType(NDBCOL::Binary);
col.setLength(field->pack_length()); col.setLength(field->pack_length());
...@@ -3527,7 +3530,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3527,7 +3530,7 @@ static int create_ndb_column(NDBCOL &col,
Field_varstring* f= (Field_varstring*)field; Field_varstring* f= (Field_varstring*)field;
if (f->length_bytes == 1) if (f->length_bytes == 1)
{ {
if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin)
col.setType(NDBCOL::Varbinary); col.setType(NDBCOL::Varbinary);
else { else {
col.setType(NDBCOL::Varchar); col.setType(NDBCOL::Varchar);
...@@ -3536,7 +3539,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3536,7 +3539,7 @@ static int create_ndb_column(NDBCOL &col,
} }
else if (f->length_bytes == 2) else if (f->length_bytes == 2)
{ {
if (field->flags & BINARY_FLAG) if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin)
col.setType(NDBCOL::Longvarbinary); col.setType(NDBCOL::Longvarbinary);
else { else {
col.setType(NDBCOL::Longvarchar); col.setType(NDBCOL::Longvarchar);
...@@ -3553,7 +3556,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3553,7 +3556,7 @@ static int create_ndb_column(NDBCOL &col,
// Blob types (all come in as MYSQL_TYPE_BLOB) // Blob types (all come in as MYSQL_TYPE_BLOB)
mysql_type_tiny_blob: mysql_type_tiny_blob:
case 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); col.setType(NDBCOL::Blob);
else { else {
col.setType(NDBCOL::Text); col.setType(NDBCOL::Text);
...@@ -3566,7 +3569,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3566,7 +3569,7 @@ static int create_ndb_column(NDBCOL &col,
break; break;
//mysql_type_blob: //mysql_type_blob:
case 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); col.setType(NDBCOL::Blob);
else { else {
col.setType(NDBCOL::Text); col.setType(NDBCOL::Text);
...@@ -3588,7 +3591,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3588,7 +3591,7 @@ static int create_ndb_column(NDBCOL &col,
break; break;
mysql_type_medium_blob: mysql_type_medium_blob:
case 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); col.setType(NDBCOL::Blob);
else { else {
col.setType(NDBCOL::Text); col.setType(NDBCOL::Text);
...@@ -3600,7 +3603,7 @@ static int create_ndb_column(NDBCOL &col, ...@@ -3600,7 +3603,7 @@ static int create_ndb_column(NDBCOL &col,
break; break;
mysql_type_long_blob: mysql_type_long_blob:
case 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); col.setType(NDBCOL::Blob);
else { else {
col.setType(NDBCOL::Text); col.setType(NDBCOL::Text);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment