diff options
author | unknown <marko@hundin.mysql.fi> | 2004-12-30 19:13:31 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-12-30 19:13:31 +0200 |
commit | c6d329b4f71f69618357f121ce50d80f8170ad11 (patch) | |
tree | 3c55af0695b59ba302cf06e4eb5b0f02a2858e2a /innobase/include/rem0rec.ic | |
parent | ecf24c66cf316baaf632fc998fbccfc305b68931 (diff) | |
download | mariadb-git-c6d329b4f71f69618357f121ce50d80f8170ad11.tar.gz |
InnoDB: Remove crash in in-place update from NULL to non-NULL. (Bug #7591)
rem0rec.c:
rec_init_offsets(): Make the function comment more accurate.
rem0rec.ic:
rec_get_nth_field(): Return pointer to the field, even to NULL fields.
rec_set_nth_field(): Make more accurate debug assertions.
innobase/include/rem0rec.ic:
rec_get_nth_field(): Return pointer to the field, even to NULL fields.
rec_set_nth_field(): Make more accurate debug assertions.
innobase/rem/rem0rec.c:
rec_init_offsets(): Make the function comment more accurate.
Diffstat (limited to 'innobase/include/rem0rec.ic')
-rw-r--r-- | innobase/include/rem0rec.ic | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic index b9a79c259a4..7d35e8e4110 100644 --- a/innobase/include/rem0rec.ic +++ b/innobase/include/rem0rec.ic @@ -880,7 +880,6 @@ rec_get_nth_field( length = rec_offs_base(offsets)[1 + n]; if (length & REC_OFFS_SQL_NULL) { - field = NULL; length = UNIV_SQL_NULL; } else { length &= REC_OFFS_MASK; @@ -1185,6 +1184,7 @@ rec_set_nth_field( byte* data2; ulint len2; + ut_ad(rec); ut_ad(rec_offs_validate(rec, NULL, offsets)); if (len == UNIV_SQL_NULL) { @@ -1195,14 +1195,15 @@ rec_set_nth_field( } data2 = rec_get_nth_field(rec, offsets, n, &len2); - ut_ad(len2 == len); - - ut_memcpy(data2, data, len); - if (len2 == UNIV_SQL_NULL) { ut_ad(!rec_offs_comp(offsets)); rec_set_nth_field_null_bit(rec, n, FALSE); + ut_ad(len == rec_get_nth_field_size(rec, n)); + } else { + ut_ad(len2 == len); } + + ut_memcpy(data2, data, len); } /************************************************************** |