summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authoringo@mysql.com <>2004-06-24 14:54:28 +0200
committeringo@mysql.com <>2004-06-24 14:54:28 +0200
commitfa86cada0c058773e1826d7dbbbf1e5d39f4f91f (patch)
treebeb44ebd0753758abb89605e77b2cc6a647f308e /sql/ha_berkeley.cc
parentc9b1946c054e3f04a5dc61bd6add323eec95293e (diff)
downloadmariadb-git-fa86cada0c058773e1826d7dbbbf1e5d39f4f91f.tar.gz
bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash.
Added put_length() to get_length() and unpack_key() to pack_key(). Keys were packed with the minimum size of the length field for the key part and unpacked with length size of the base column. For the purpose of optimal key packing we have the method pack_key(), while rows are packed with pack(). Now keys are unpacked with unpack_key() and no longer with unpack() which is used for rows.
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 3522aadf349..0d1504b3aa4 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -720,8 +720,8 @@ void ha_berkeley::unpack_key(char *record, DBT *key, uint index)
}
record[key_part->null_offset]&= ~key_part->null_bit;
}
- pos= (char*) key_part->field->unpack(record + key_part->field->offset(),
- pos);
+ pos= (char*) key_part->field->unpack_key(record + key_part->field->offset(),
+ pos, key_part->length);
}
}