summaryrefslogtreecommitdiff
path: root/storage/archive
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-05-29 17:34:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-05-29 17:34:49 +0300
commita3539bbb2ac51dfa2b363d3b4c11784c25d1f256 (patch)
tree6b49da1f15e5740adaf5da1c4179760a15b77dc4 /storage/archive
parentc98e6d4b3d4d17ee429c696ac07e0bc4bbe1a81e (diff)
parent6f96ff7268dd20d6d3b61931c972e7a43c1efdff (diff)
downloadmariadb-git-a3539bbb2ac51dfa2b363d3b4c11784c25d1f256.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'storage/archive')
-rw-r--r--storage/archive/ha_archive.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 08d5220cfca..42d2c219ebf 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -898,18 +898,19 @@ int ha_archive::real_write_row(uchar *buf, azio_stream *writer)
the bytes required for the length in the header.
*/
-uint32 ha_archive::max_row_length(const uchar *buf)
+uint32 ha_archive::max_row_length(const uchar *record)
{
uint32 length= (uint32)(table->s->reclength + table->s->fields*2);
length+= ARCHIVE_ROW_HEADER_SIZE;
+ my_ptrdiff_t const rec_offset= record - table->record[0];
uint *ptr, *end;
for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ;
ptr != end ;
ptr++)
{
- if (!table->field[*ptr]->is_null())
- length += 2 + ((Field_blob*)table->field[*ptr])->get_length();
+ if (!table->field[*ptr]->is_null(rec_offset))
+ length += 2 + ((Field_blob*)table->field[*ptr])->get_length(rec_offset);
}
return length;
@@ -919,10 +920,9 @@ uint32 ha_archive::max_row_length(const uchar *buf)
unsigned int ha_archive::pack_row(uchar *record, azio_stream *writer)
{
uchar *ptr;
-
+ my_ptrdiff_t const rec_offset= record - table->record[0];
DBUG_ENTER("ha_archive::pack_row");
-
if (fix_rec_buff(max_row_length(record)))
DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* purecov: inspected */
@@ -936,7 +936,7 @@ unsigned int ha_archive::pack_row(uchar *record, azio_stream *writer)
for (Field **field=table->field ; *field ; field++)
{
- if (!((*field)->is_null()))
+ if (!((*field)->is_null(rec_offset)))
ptr= (*field)->pack(ptr, record + (*field)->offset(record));
}