diff options
author | Luis Soares <luis.soares@sun.com> | 2010-05-20 00:50:42 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-05-20 00:50:42 +0100 |
commit | 779241bc948832415a8aa3bda1e3b85499c927af (patch) | |
tree | d7850f818c74b0e5f2852170fab1b4138d45e772 /sql/log_event.cc | |
parent | 3b8cae37ccbc81d204e5d4023a033f00986eb02d (diff) | |
parent | fbe81e3c97414d091b3861ae8d64f49e114869a8 (diff) | |
download | mariadb-git-779241bc948832415a8aa3bda1e3b85499c927af.tar.gz |
BUG 52868: automerged bzr bundle from bug report.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 8d41a89736e..2cc594d85b4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -8774,11 +8774,28 @@ static bool record_compare(TABLE *table) { for (int i = 0 ; i < 2 ; ++i) { - saved_x[i]= table->record[i][0]; - saved_filler[i]= table->record[i][table->s->null_bytes - 1]; - table->record[i][0]|= 1U; - table->record[i][table->s->null_bytes - 1]|= - 256U - (1U << table->s->last_null_bit_pos); + /* + If we have an X bit then we need to take care of it. + */ + if (!(table->s->db_options_in_use & HA_OPTION_PACK_RECORD)) + { + saved_x[i]= table->record[i][0]; + table->record[i][0]|= 1U; + } + + /* + If (last_null_bit_pos == 0 && null_bytes > 1), then: + + X bit (if any) + N nullable fields + M Field_bit fields = 8 bits + + Ie, the entire byte is used. + */ + if (table->s->last_null_bit_pos > 0) + { + saved_filler[i]= table->record[i][table->s->null_bytes - 1]; + table->record[i][table->s->null_bytes - 1]|= + 256U - (1U << table->s->last_null_bit_pos); + } } } @@ -8818,8 +8835,11 @@ record_compare_exit: { for (int i = 0 ; i < 2 ; ++i) { - table->record[i][0]= saved_x[i]; - table->record[i][table->s->null_bytes - 1]= saved_filler[i]; + if (!(table->s->db_options_in_use & HA_OPTION_PACK_RECORD)) + table->record[i][0]= saved_x[i]; + + if (table->s->last_null_bit_pos) + table->record[i][table->s->null_bytes - 1]= saved_filler[i]; } } |