32f0b349abf3e364868b928c6bf2daefb01ec8cb storage/innobase/row/row0upd.cc | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 2499aff..8471e00 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -614,11 +614,17 @@ static MY_ATTRIBUTE((nonnull, warn_unused_result)) - if (rec_offs_comp(offsets) - && rec_offs_nth_sql_null(offsets, - upd_field->field_no)) { - /* Note that in the compact table format, for a - variable length field, an SQL NULL will use zero - bytes in the offset array at the start of the physical - record, but a zero-length value (empty string) will - use one byte! Thus, we cannot use update-in-place - if we update an SQL NULL varchar to an empty string! */ - - old_len = UNIV_SQL_NULL; + if (rec_offs_comp(offsets)) { + if (rec_offs_nth_sql_null(offsets, + upd_field->field_no)) { + /* Note that in the compact table format, for a + variable length field, an SQL NULL will use zero + bytes in the offset array at the start of the physical + record, but a zero-length value (empty string) will + use one byte! Thus, we cannot use update-in-place + if we update an SQL NULL varchar to an empty string! */ + + old_len = UNIV_SQL_NULL; + } + else if (rec_offs_nth_default(offsets, + upd_field->field_no)) { + /* If update the added columns, use non-inplace update */ + old_len = UNIV_SQL_DEFAULT; + }