mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-push mysql-test/r/ndb_basic.result: Auto merged mysql-test/t/ndb_basic.test: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged ndb/src/kernel/vm/SimulatedBlock.cpp: merge
This commit is contained in:
@ -2812,8 +2812,26 @@ void ha_ndbcluster::position(const byte *record)
|
||||
}
|
||||
*buff++= 0;
|
||||
}
|
||||
memcpy(buff, record + key_part->offset, key_part->length);
|
||||
buff += key_part->length;
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user