1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Fixed LP bug #663818.

After the patch for bug 663840 had been applied the test case for
bug 663818 triggered the assert introduced by this patch.
It happened because the the patch turned out to be incomplete:
the space needed for a key entry must be taken into account
for the record written into the buffer, and, for the next record
as well, when figuring out whether the record being written is
the last for the buffer or not.
This commit is contained in:
Igor Babaev
2010-10-22 15:30:47 -07:00
parent ca862231f7
commit de69dbae0c
4 changed files with 96 additions and 3 deletions

View File

@@ -1161,10 +1161,11 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full)
uchar *cp= pos;
uchar *init_pos= cp;
uchar *rec_len_ptr= 0;
uint key_extra= extra_key_length();
records++; /* Increment the counter of records in the cache */
len= pack_length + extra_key_length();
len= pack_length + key_extra;
/* Make an adjustment for the size of the auxiliary buffer if there is any */
uint incr= aux_buffer_incr(records);
@@ -1204,7 +1205,7 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full)
This function is called only in the case when there is enough space left in
the cache to store at least non-blob parts of the current record.
*/
last_record= (len+pack_length_with_blob_ptrs) > rem_space();
last_record= (len+pack_length_with_blob_ptrs+key_extra) > rem_space();
/*
Save the position for the length of the record in the cache if it's needed.