Commit graph

65379 commits

Author SHA1 Message Date
Sergey Petrunya
f2abf5f6b1 Make suite/optimizer_unfixed_bugs/t/bug43617.test work in any timezone. 2010-11-29 19:47:32 +03:00
Sergey Petrunya
d1afc20e13 Merge maria-5.3-mwl128 -> maria-5.2-mwl128-dsmrr-cpk 2010-11-29 19:00:32 +03:00
Sergey Petrunya
cee6e4565d Fix trivial error in previous push 2010-11-29 17:27:23 +03:00
Sergey Petrunya
a6d47ab1d3 Fix buildbot failure: keep rowid_buf_elem_size to its original value, otherwise
subsequent asserts have the wrong meaning.
2010-11-28 23:55:08 +03:00
Sergey Petrunya
8604dc78e2 Fix trivial error 2010-11-26 15:45:46 +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
fad2ec7499 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 3
2010-11-23 18:08:11 +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
Igor Babaev
4e05898f53 Got the declarations related to the class JOIN_CACHE, its derivatives and
companions out of sql_select.h into a separate file sql_join_cache.h.
2010-11-19 11:03:03 -08:00
Igor Babaev
ae4b5a32a6 Fixed LP bug #675922.
The bug happened when BKA join algorithm used an incremental buffer
and some of the fields over which access keys were constructed
- were allocated in the previous join buffers
- were non-nullable
- belonged to inner tables of outer joins.
For such fields an offset to the field value in the record is saved
in the postfix of the record, and a zero offset indicates that the value 
is null. Before the key using the field value is constructed the
value is read into the corresponding field of the record buffer and
the null bit is set for the field if the offset is 0. However if
the field is non-nullable the table->null_row must be set to 1
for null values and to 0 for non-null values  to ensure proper reading
of the value from the record buffer.
2010-11-19 07:38:02 -08:00
Igor Babaev
0a3922fca8 Fixed LP #bug 660963.
The condition that was supposed to check whether a join table
is an inner table of a nested outer join or semi-join was not
quite correct in the code of the function check_join_cache_usage.
That's why some queries with nested outer joins triggered 
an assertion failure.
Encapsulated this condition in the new method called
JOIN_TAB::is_nested_inner and provided a proper code for it.

Also corrected a bug in the code of check_join_cache_usage()
that caused a downgrade of not first join buffers of the
level 5 and 7 to level 4 and 6 correspondingly.
2010-11-19 06:20:28 -08:00
Igor Babaev
e25ac681c9 Fixed LP bug #675516.
When pushing the condition for a table in the function
JOIN_TAB::make_scan_filter the optimizer must not push
conditions from WHERE if the table is some inner table
of an outer join..
2010-11-15 21:07:32 -08:00
Igor Babaev
42cd36431b Fixed LP bug #675095.
The condition over outer tables extracted from the on expression
for a outer join must be ANDed to the condition pushed to the
first inner table of this outer join only.
Nested outer joins cannot use flat join buffers. So if join_cache_level
is set to 1 then any join algorithm employing join buffers cannot be used
for nested outer joins.
2010-11-14 23:38:25 -08:00
Sergey Petrunya
c635eb3319 Remove .moved files 2010-11-15 04:59:45 +03:00
Sergey Petrunya
9ab54acbf0 Merge MWL#121-125 DS-MRR improvements into MWL#128 Classic hash join tree 2010-11-15 04:45:49 +03:00
Igor Babaev
9441a9cc28 Fixed LP bug #674423.
The patch that introduced the new enumeration type Match_flag
for the values of match flags in the records put into join buffers
missed the necessary modifications in JOIN_CACHE::set_match_flag_if_none.
This could cause wrong results for outer joins with on expressions
only over outer tables.
2010-11-13 07:47:43 -08:00
Igor Babaev
9259ef4c7c Merge 2010-11-13 06:35:54 -08:00
Igor Babaev
4e5911733a Fixed LP bug #674431.
A non-incremental join buffer cannot be used for inner tables of nested
outer joins. That's why when join_cache_level is set to 7 it must
be downgraded to level 6 for the inner tables of nested outer joins.
For the same reason with join_cache_level set to 3 no join buffer is
used for the inner tables of outer joins (we could downgrade it to
level 2, but this level does not support ref access).
2010-11-13 06:13:34 -08:00
Igor Babaev
6cd2a66820 Corrected the fix for LP bug 672551. 2010-11-12 16:53:20 -08:00
Igor Babaev
46fe431818 Merge 2010-11-11 16:59:08 -08:00
Igor Babaev
d9bbc64016 Fixed LP bug #672551.
Made sure that the function that copy a long varchar field from the record
buffer into a key buffer does not copy bytes after the field value.
2010-11-11 16:41:52 -08:00
Igor Babaev
47b0f36911 Merge 2010-11-11 16:38:55 -08:00
Igor Babaev
92772d6d46 Fixed LP bug#672497.
Miscalculation of the minimum possible buffer size could trigger
an assert in JOIN_CACHE_HASHED::put_record when if join_buffer_size
was set to the values that is less than the length of one record to
stored in the join buffer.
It happened due to the following mistakes:
- underestimation of space needed for a key in the hash table
  (we have to take into account that hash table can have more
  buckets than the expected number of records).
- the value of maximum total length of all records stored in
  the join buffer was not saved in the field max_used_fieldlength
  by the function calc_used_field_length.
2010-11-11 15:35:11 -08:00
Igor Babaev
24f6a2ec4b Merge 2010-11-10 14:34:37 -08:00
Igor Babaev
6e5bcca793 Merge 2010-11-09 19:40:02 -08:00
Sergey Petrunya
3d698ac616 BUG#671361: virtual int Mrr_ordered_index_reader::refill_buffer(): Assertion `!know_key_tuple_params
- Make sure we have enough space for both rowids and keys.
2010-11-09 18:02:08 +02:00
Sergey Petrunya
594a8648ef Add optimizer_unfixed_bugs tests/results to the list of installed files 2010-11-09 15:41:10 +02:00
Sergey Petrunya
b14e9bcf7e Merge in: Include optimizer_unfixed_bugs testsuite in buildbot runs 2010-11-09 13:35:16 +02:00
Sergey Petrunya
a2da3692c4 Include optimizer_unfixed_bugs testsuite in buildbot runs 2010-11-09 13:30:35 +02:00
unknown
05f21b21e4 Fixed LP BUG#615378 Incorrect processing of NULL result in Item_cache fixed. 2010-11-09 13:13:56 +02:00
Sergey Petrunya
b67be0b23b Fix buildbot failure introduced by the previous push 2010-11-09 09:52:22 +02:00
Igor Babaev
6b67bafc74 Fixed LP bug #668644.
The pushdown condition for the sorted table in a query can be complemented
by the conditions from HAVING. This transformation is done in JOIN::exec
pretty late after the original pushdown condition have been saved in the
field pre_idx_push_select_cond for the sorted table. So this field must
be updated after the inclusion of the condition from HAVING.
2010-11-08 20:36:32 -08:00
Sergey Petrunya
ea13c77652 Fix buildbot failures caused by two previous pushes. 2010-11-08 23:25:12 +02:00
Sergey Petrunya
476e90fc97 Fix buildbot errors: rec_per_key_part can be 0 if re-opening 2010-11-08 20:51:31 +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
7b33534b47 [Patch from Monty] Fix stack-overrun crash in subselect_notembedded.test
- Make mi_open() use less stack space
2010-11-08 19:06:26 +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
Igor Babaev
74d18e93c6 Fixed LP bug #671901.
Currently BNLH join uses a simplified implementation of hash function
when hash function is calculated over the whole key buffer, not only
the significant bytes of it. It means that both building keys and
probing keys both must fill insignificant bytes with the same filler.
Usually 0 is used as such a filler.
Yet the code before patch filled insignificant bytes only for probing
keys.
2010-11-07 15:19:30 -08:00
Igor Babaev
bbbe3ac8fb Merge 2010-11-05 19:20:54 -07:00
Igor Babaev
71e48fbf3e Merge 2010-11-05 19:01:47 -07:00
Igor Babaev
dba8cfd541 BNL and BNLH algorithms scan the join table and for each its record they
try to find a match in the join buffer. It makes sense to check for a match
only those records satisfying WHERE/ON conditions that can be pushed to
the scanned table. It allows us to discard early some join candidates.

Such pushdown conditions were built when BNL join algorithm was employed,
but for they were not built when BNLH algorithm was used.
The patch removes this shortcoming.
2010-11-05 19:00:53 -07:00
Igor Babaev
4bc81968ab Post merge adjustment 2010-11-05 14:22:21 -07:00
Michael Widenius
c670b9021e Automerge with 5.2 2010-11-05 12:37:51 +02:00
Michael Widenius
fdd6963890 Fixed usage of wrong variable in case of errors 2010-11-05 11:54:42 +02:00
Igor Babaev
615d756721 Fixed LP bug #669382.
When probing into the hash table of a hashed join cache is performed
the key value should not constructed in the buffer used to build keys
in the hash tables. The constant parts of these keys copied only once,
so they should not be ever overwritten. Otherwise wrong results
can be produced by queries that employ hashed join buffers.
2010-11-04 21:00:33 -07:00
Michael Widenius
7647c2744c Automatic merge with MariaDB 5.1 2010-11-04 17:08:28 +02:00
Michael Widenius
a1bd953235 Automatic merge 2010-11-04 17:02:14 +02:00
Michael Widenius
e3c8798eb6 When scanning pages, stop when you are at 'data_file_length'.
This fixes a bug that gave ER_FILE_TOO_SHORT error when scanning Aria tables.

storage/maria/ma_blockrec.c:
  Changed code so that we update share->state.state.data_file_length after page cache write is done.
  When scanning pages, stop when you are at 'data_file_length'.
  (We can't trust the bitmap as there may be reserved pages in the bitmap that are not yet written).
  This fixes a bug that gave ER_FILE_TOO_SHORT error when scanning Aria tables.
storage/maria/maria_def.h:
  Updated struct for stopping scanning at end of file
2010-11-04 16:57:30 +02:00