Commit graph

68 commits

Author SHA1 Message Date
Sergei Petrunia
e637355156 MDEV-21610 Different query results from 10.4.11 to 10.4.12
Part#2: cleanup:

In the part 1 of the fix, DS-MRR implementation would peek into
the JOIN_TAB to get the rowid filter from

  table->reginfo.join_tab->rowid_filter

This doesn't look good from code isolation standpoint (why should a
storage engine assume it is used through a JOIN_TAB?).

Fixed this by storing the 'un-pushed' rowid_filter in the DsMrr_impl
structure. The filter survives across multi_range_read_init() calls.

It is discarded when somebody calls index_end() or rnd_end() and cleans
up the DsMrr_impl.
2020-02-20 13:35:19 +03:00
Igor Babaev
2fb881df1d MDEV-21610 Different query results from 10.4.11 to 10.4.12
This patch fixes the following defects/bugs.
1. If BKA[H] algorithm was used to join a table for which the optimizer
had decided to employ a rowid filter the filter actually was not built.
2. The patch for the bug MDEV-21356 that added the code canceling pushing
rowid filter into an engine for the table joined with employment of
BKA[H] and MRR was not quite correct for Innodb engine because this
cancellation was done after InnoDB code had already bound the the pushed
filter to internal InnoDB structures.
2020-02-18 22:51:07 -08:00
Sergei Petrunia
86167e908f MDEV-20611: MRR scan over partitioned InnoDB table produces "Out of memory" error
Fix partitioning and DS-MRR to work together

- In ha_partition::index_end(): take into account that ha_innobase (and
  other engines using DS-MRR) will have inited=RND when initialized for
  DS-MRR scan.
- In ha_partition::multi_range_read_next(): if the MRR scan is using
  HA_MRR_NO_ASSOCIATION mode, it is not guaranteed that the partition's
  handler will store anything into *range_info.
- In DsMrr_impl::choose_mrr_impl(): ha_partition will inquire partitions
  about how much memory their MRR implementation needs by passing
  *buffer_size=0. DS-MRR code didn't know about this (actually it used
  uint for buffer size calculation and would have an under-flow).
  Returning *buffer_size=0 made ha_partition assume that partitions do
  not need MRR memory and pass the same buffer to each of them.

  Now, this is fixed. If DS-MRR gets *buffer_size=0, it will return
  the amount of buffer space needed, but not more than about
  @@mrr_buffer_size.

* Fix ha_{innobase,maria,myisam}::clone. If ha_partition uses MRR on its
  partitions, and partition use DS-MRR, the code will call handler->clone
  with TABLE (*NOT partition*) name as an argument.
  DS-MRR has no way of knowing the partition name, so the solution was
  to have the ::clone() function for the affected storage engine to ignore
  the name argument and get it elsewhere.
2019-11-15 23:37:28 +03:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Vicențiu Ciorbaru
f177f125d4 Merge branch '5.5' into 10.1 2019-05-11 19:15:57 +03:00
Michal Schorm
17b4f99928 Update FSF address
This commit is based on the work of Michal Schorm, rebased on the
earliest MariaDB version.

Th command line used to generate this diff was:

find ./ -type f \
  -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
  -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
  -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \
  -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \
  -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \
  -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
2019-05-10 20:52:00 +03:00
Marko Mäkelä
2a3fe45dd2 Remove XtraDB
The XtraDB storage engine was already replaced by InnoDB
and disabled in MariaDB Server 10.2. Let us remove it altogether
to avoid dragging dead code around.

Replace some references to XtraDB with references to InnoDB.

rpl_get_position_info(): Remove.

Remove the mysql-test-run --suite=percona, because it only contains
tests specific to XtraDB, many of which were disabled already in
earlier MariaDB versions.
2017-06-21 13:44:16 +03:00
iangilfillan
f0ec34002a Correct FSF address 2017-03-10 18:21:29 +01:00
Sergey Petrunya
e4521f8cae Merge 2014-10-29 15:20:46 +03:00
Sergey Petrunya
30b28babdc Merge 5.3->5.5 2014-10-29 13:22:48 +03:00
Sergey Petrunya
9cb002b359 MDEV-6878: Use of uninitialized saved_primary_key in Mrr_ordered_index_reader::resume_read()
(Backport to 5.3)
(variant #2, with fixed coding style)
- Make Mrr_ordered_index_reader::resume_read() restore index position 
  only if it was saved before with Mrr_ordered_index_reader::interrupt_read().
2014-10-29 01:37:58 +03:00
Sergey Petrunya
8925b4a935 MDEV-6878: Use of uninitialized saved_primary_key in Mrr_ordered_index_reader::resume_read()
- Make Mrr_ordered_index_reader::resume_read() restore index position 
  only if it was saved before with Mrr_ordered_index_reader::interrupt_read().
2014-10-16 17:57:13 +04:00
unknown
e5746665c9 merge 10.0-base -> 10.0 2013-09-26 21:20:15 +03:00
Sergey Petrunya
422c55a240 MDEV-5037: Server crash on a JOIN on a derived table with join_cache_level > 2
- The crash was caused because the optimizer called handler->multi_range_read_info()
  on a derived temporary table.  That table has been created, but not opened yet.
  Because of that, handler::table was NULL, which caused crash.
  Fixed by changing DS-MRR methods to use handler::table_share instead. 
  handler::table_share is set in handler ctor, so this should be safe.
2013-09-20 14:47:38 +04:00
Michael Widenius
1d0f70c2f8 Temporary commit of merge of MariaDB 10.0-base and MySQL 5.6 2012-08-01 17:27:34 +03:00
Sergei Golubchik
5bf311e1e8 fix the include guards and add missing gplv2 headers 2012-02-17 12:19:38 +01:00
Sergey Petrunya
997445bc8e Make EXPLAIN better at displaying MRR/BKA:
- "Using MRR" is no longer shown with range access.
- Instead, both range and BKA accesses will show one of the following:
  = "Rowid-ordered scan"
  = "Key-ordered scan"
  = "Key-ordered Rowid-ordered scan"
depending on whether DS-MRR implementation will do scan keys in order, rowids in order,
or both.
- The patch also introduces a way for other storage engines/MRR implementations to
  pass information to EXPLAIN output about the properties of employed MRR scans.
2011-04-02 14:04:45 +04:00
Sergey Petrunya
e6bd643c75 MRR interface: change range_info's type from char* to range_id_t typedef. The goals are:
- cleaner code
- ability to change from using pointers to offsets at some point
2011-03-04 12:06:03 +03:00
Sergey Petrunya
8ef094fe4f BUG#707925: Wrong result with join_cache_level=6 optimizer_use_mrr = force (incremental, BKA join)
- The problem was that Mrr_ordered_index_reader's interrupt_read() and resume_read() would 
  save and restore 1) index tuple  2) the rowid (as bytes returned by handler->position()).  Clustered 
  primary key columns were not saved/restored. 
  They are not explicitly present in the index tuple (i.e. table->key_info[secondary_key].key_parts 
  doesn't list them), but they are actually there, in particular 
  table->field[clustered_primary_key_member].part_of_key(secondary_key) == 1. Index condition pushdown
  code [correctly] uses the latter as inidication that pushed index condition can refer to clustered PK
  members. 

  The fix was to make interrupt_read()/resume_read() to save/restore clustered primary key members as well,
  so that we get correct values for them when evaluating pushed index condition.
[3rd attempt: remove the debugging aids, fix comments in testcase]
2011-03-04 00:54:10 +03:00
Sergey Petrunya
9d480f6af3 BUG#670417: Diverging results in maria-5.3-mwl128-dsmrr-cpk with join buffer
- Fixes for the second fix: take into account case where we don't need to save/restore the scan.
2010-12-20 14:40:12 +03:00
Sergey Petrunya
09a84dc470 BUG#670417: Diverging results in maria-5.3-mwl128-dsmrr-cpk with join buffer
Switch from "Disable identical key handling optimization when
  IndexConditionPushdown is used" approach
To 
 an approach where we save/restore index tuple and so can use index condition pushdown.
2010-12-19 13:56:12 +03:00
Sergey Petrunya
80cbf3a1c2 Small code cleanups 2010-12-17 13:06:21 +03:00
Sergey Petrunya
c696fb6ef3 Better comments 2010-12-16 23:43:52 +03:00
Sergey Petrunya
3e633eea66 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, portion 2
2010-12-16 21:18:35 +03:00
Sergey Petrunya
802db7a64b - Fix compiler warning
- Better warnings
2010-12-15 10:45:08 +03:00
Sergey Petrunya
a86599e1e4 BUG#671340: Diverging results in with mrr_sort_keys=ON|OFF and join_cache_level=5
- Make Mrr_ordered_index_reader() save the rowid across scan interruptions

Also
- Fix compiler warning for setup_buffer_sizes()
- Add commented key_copy/key_restore for better handling of a similar issue
  with index record being destroyed by scan interruption (which causes 
  incorrect evaluation of pushed index condition later on).
2010-12-09 00:47:33 +03:00
Sergey Petrunya
1c7c67d584 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 6: rename "handler *h" variable in all
  DS-MRR classes to something else.
2010-12-02 16:21:52 +03:00
Sergey Petrunya
44be131cd3 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 5
2010-12-02 14:10:52 +03:00
Sergey Petrunya
40822c8149 Fix buildbot failure 2010-11-26 00:30:39 +03:00
Sergey Petrunya
92442fc598 Merge MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 4
2010-11-25 14:35:21 +03:00
Sergey Petrunya
a6c1d56e08 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 1
- Fix buildbot failure
2010-11-22 19:34:03 +03:00
Sergey Petrunya
2ec43747f5 Merge MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 1
2010-11-22 17:08:22 +03:00
Sergey Petrunya
0fb342ba56 BUG#670417: Diverging results in maria-5.3-mwl128-dsmrr-cpk with join buffer, attempt 4
- Disable identical key handling optimization when
  IndexConditionPushdown is used
2010-11-08 20:37:01 +03:00
Sergey Petrunya
197c99427d DS-MRR improvements
- Code cleanup
- Always propagate the error code we got from storage engine all the way up
2010-11-08 15:15:50 +03:00
Sergey Petrunya
c46450de72 Code cleanup 2010-11-03 00:09:28 +03:00
Sergey Petrunya
1654780f2d Code cleanup 2010-11-02 23:25:35 +03:00
Sergey Petrunya
b76a8595c6 Re-initialization reworked 2010-11-01 13:52:10 +03:00
Sergey Petrunya
d9a8dd22b2 DS-MRR/CPK improvements: correct buffer exhaustion handling 2010-10-31 22:00:15 +03:00
Sergey Petrunya
1e82320d27 DS-MRR improvements
- buildbot test failure fixes: don't try to get more records from SimpleIndexReader
  if we've already got EOF for it.
2010-10-29 13:42:48 +04:00
Sergey Petrunya
a88bd5cf56 DS-MRR improvements:
- address the review feedback (class/var renames)
- fix wrong test result (bug in buffer refill logic)
2010-10-28 20:48:16 +04:00
Sergey Petrunya
d8efc3b155 DS-MRR improvements: address review feedback for R3 version of the patch 2010-10-26 15:35:13 +04:00
Sergey Petrunya
ac8a79b944 Code cleanup 2010-10-04 10:31:40 +04:00
Sergey Petrunya
5156457506 Address review feedback
- One iterator class
- Switch back from state automaton into two-nested-iterators approach..
2010-10-03 14:48:42 +04:00
Sergey Petrunya
22d5323fac DS-MRR/CPK improvements: more of addressing review feedback 2010-10-01 15:54:35 +04:00
Sergey Petrunya
61f26f0c62 DS-MRR improvements: address review feedback
- change dsmrr_next_from_index() to a switch-based state automaton-like structure.
2010-09-28 20:20:09 +04:00
Sergey Petrunya
4f56acb676 Better comments, move Lifo_buffer to separate file. 2010-09-28 12:19:50 +04:00
Sergey Petrunya
3066c37718 DS-MRR improvements: review feedback
- Switch from one bi-directional buffer class to two 
  virtual inheritance-based forward and backward buffer classes.
2010-09-21 20:19:54 +04:00
Sergey Petrunya
51f9097608 More comments 2010-09-20 23:13:28 +04:00
Sergey Petrunya
2121ab1eb4 DS-MRR improvements: remove write_size/read_size, have the same size
for writing and reading
2010-09-20 13:23:51 +04:00
Sergey Petrunya
189555f39a DS-MRR improvements: more code cleanup
- better comments
- rename variables to better reflect their meaning
2010-09-20 13:02:17 +04:00