diff options
author | Monty <monty@mariadb.org> | 2015-11-05 22:09:58 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-11-10 13:46:56 +0200 |
commit | 93d1e5ce0b841bedbc071da85995f15611ed3d34 (patch) | |
tree | 7f6f567cbf7b0ef3e17345f271cefed81f098f63 /sql/opt_range.cc | |
parent | cb4737cb4e7df6c43de9d47483f17f8e2e7fa24b (diff) | |
download | mariadb-git-93d1e5ce0b841bedbc071da85995f15611ed3d34.tar.gz |
table->write_set was changed if binary logging was used, which caused the
changes in query execution plans.
Fixed by introducing table->rpl_write_set which holds which columns should
be stored in the binary log.
Other things:
- Removed some not needed references to read_set and write_set to make
code really changing read_set and write_set easier to read
(in opt_range.cc)
- Added error handling of failed unpack_current_row()
- Added missing call to mark_columns_needed_for_insert() for DELAYED INSERT
- Removed not used functions in_read_set() and in_write_set()
- In rpl_record.cc, removed not used variable error
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 513f76a06f3..7e6753e9bf6 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1519,15 +1519,14 @@ end: DBUG_ASSERT(head->read_set == &column_bitmap); /* We are only going to read key fields and call position() on 'file' - The following sets head->tmp_set to only use this key and then updates - head->read_set and head->write_set to use this bitmap. - The now bitmap is stored in 'column_bitmap' which is used in ::get_next() + The following sets head->read_set (== column_bitmap) to only use this + key. The 'column_bitmap' is used in ::get_next() */ org_file= head->file; org_key_read= head->key_read; head->file= file; head->key_read= 0; - head->mark_columns_used_by_index_no_reset(index, head->read_set); + head->mark_columns_used_by_index_no_reset(index, &column_bitmap); if (!head->no_keyread) { @@ -1551,8 +1550,7 @@ end: file->ha_close(); goto failure; } - else - DBUG_RETURN(1); + DBUG_RETURN(1); } DBUG_RETURN(0); @@ -11141,26 +11139,21 @@ err: int QUICK_RANGE_SELECT::get_next() { range_id_t dummy; - MY_BITMAP * const save_read_set= head->read_set; - MY_BITMAP * const save_write_set= head->write_set; - + int result; DBUG_ENTER("QUICK_RANGE_SELECT::get_next"); - if (in_ror_merged_scan) - { - /* - We don't need to signal the bitmap change as the bitmap is always the - same for this head->file - */ - head->column_bitmaps_set_no_signal(&column_bitmap, &column_bitmap); - } - int result= file->multi_range_read_next(&dummy); + if (!in_ror_merged_scan) + DBUG_RETURN(file->multi_range_read_next(&dummy)); - if (in_ror_merged_scan) - { - /* Restore bitmaps set on entry */ - head->column_bitmaps_set_no_signal(save_read_set, save_write_set); - } + MY_BITMAP * const save_read_set= head->read_set; + MY_BITMAP * const save_write_set= head->write_set; + /* + We don't need to signal the bitmap change as the bitmap is always the + same for this head->file + */ + head->column_bitmaps_set_no_signal(&column_bitmap, &column_bitmap); + result= file->multi_range_read_next(&dummy); + head->column_bitmaps_set_no_signal(save_read_set, save_write_set); DBUG_RETURN(result); } |