From 8b8617af79791c7acda26fbc82a96d645c3fece0 Mon Sep 17 00:00:00 2001 From: marko <> Date: Thu, 6 Jul 2006 11:40:28 +0000 Subject: [PATCH] branches/zip: page_zip_fields_encode(): Fuse fixed-length fields to a maximum of DICT_MAX_INDEX_COL_LEN (768 bytes). --- page/page0zip.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/page/page0zip.c b/page/page0zip.c index a050fa90df2..7096271f965 100644 --- a/page/page0zip.c +++ b/page/page0zip.c @@ -381,6 +381,20 @@ page_zip_fields_encode( col++; } else if (val) { /* fixed-length non-nullable field */ + + if (fixed_sum && UNIV_UNLIKELY( + fixed_sum + field->fixed_len + > DICT_MAX_INDEX_COL_LEN)) { + /* Write out the length of the + preceding non-nullable fields, + to avoid exceeding the maximum + length of a fixed-length column. */ + buf = page_zip_fixed_field_encode(buf, + fixed_sum << 1 | 1); + fixed_sum = 0; + col++; + } + if (i && UNIV_UNLIKELY(i == trx_id_pos)) { if (fixed_sum) { /* Write out the length of any