summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-12-20 20:53:29 +0100
committerunknown <msvensson@neptunus.(none)>2005-12-20 20:53:29 +0100
commitcdfd9f7f6ff5eacd8670a824a18613d235ef1cd0 (patch)
tree84e81cf34be3e372c10b661c2adbe1fcf9d95b80 /sql
parentf78594c028dbb33b740c7bb3d9b310568b64508e (diff)
downloadmariadb-git-cdfd9f7f6ff5eacd8670a824a18613d235ef1cd0.tar.gz
BUG#15981 Current 5.1 fails for NDB tests
sql/ha_ndbcluster.cc: Add part that where lost when merging from 5.0 to 5.1
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index fa432914477..050a6ea8af8 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -3014,6 +3014,26 @@ void ha_ndbcluster::position(const byte *record)
}
*buff++= 0;
}
+
+ size_t len = key_part->length;
+ const byte * ptr = record + key_part->offset;
+ Field *field = key_part->field;
+ if ((field->type() == MYSQL_TYPE_VARCHAR) &&
+ ((Field_varstring*)field)->length_bytes == 1)
+ {
+ /**
+ * Keys always use 2 bytes length
+ */
+ buff[0] = ptr[0];
+ buff[1] = 0;
+ memcpy(buff+2, ptr + 1, len);
+ len += 2;
+ }
+ else
+ {
+ memcpy(buff, ptr, len);
+ }
+ buff += len;
}
}
else