3881 Marko Mäkelä 2012-05-23
Fix errors after WL#5522 merge.
modified:
.bzr-mysql/default.conf
storage/innobase/btr/btr0btr.cc
storage/innobase/page/page0page.cc
3880 Guilhem Bichot 2012-05-23
A small refactoring:
eliminate NESTED_LOOP_NO_MORE_ROWS; this enum value was unneeded
in most cases, and having too many enum values poses the problem
of handling them properly in all tests. Lots of if()s get simpler.
@ mysql-test/t/distinct.test
Given that I modify how the "not exists" and "not used in distinct"
optimizations work (making them use return_tab instead of
NESTED_LOOP_NO_MORE_ROWS), I add tests which show that they still
work. I verified that:
- in a vanilla trunk tree, test results are the same
- in a patched tree, tests fail if I disable the optimizations in
code.
You may wonder why there existed "commented-out" "flush/show status"
commands in the distinct.test; they have been present in this form
since the file was created in 2000; an oversight of the creator probably.
@ mysql-test/t/join_outer.test
same comment as distinct.test
@ sql/sql_executor.cc
All places returning NESTED_LOOP_NO_MORE_ROWS are changed to return
NESTED_LOOP_OK; in detail:
- evalute_join_record() uses 'return_tab'
when it used to return NESTED_LOOP_NO_MORE_ROWS (credits to Roy for
the idea)
- reworked the loop in sub_select() to make it look more natural
hopefully
- evaluate_join_record(,,error) was called even with error!=0,
in which case it was expected to convert the error to a
nested_loop_ value; it was a bit odd, for example
evaluate_join_record() was called even if there was no record to evaluate (error<0);
now the caller (sub_select()) does the conversion itself,
so evaluate_join_record() is called only with error==0 and thus
this "error" argument goes away.
In JOIN::optimize_distinct(), we were assigning a pointer
to "one cell before the JOIN_TABs array"; for example in:
"select distinct rand() from t3 straight_join t1 where t1.a=t3.a";
this is undefined per the C++ standard. Though we haven't seen this
code break in real life, I fix it.
@ sql/sql_executor.h
deleted NO_MORE_ROWS; moved comments from sql_executor.cc to the
enum's declaration where they belong.
@ sql/sql_join_buffer.cc
* change to JOIN_CACHE_BNL::join_matching_records(bool skip_last):
if we find EOF on first read, return OK instead of NO_MORE_ROWS;
we already returned OK in the same function when we had exhausted
all records (finished all reads); no reason to distinguish
between the two cases, for the caller.
* Change to JOIN_CACHE_BKA::init_join_matching_records():
error<0 didn't happen in the full MTR testsuite; and there is
no documentation that multi_range_read_init()<0 means EOF;
looking at the implementations of multi_range_read_init()
and their comments, the rule is apparently "0: ok; <>0: error".
Thus, if multi_range_read_init() returns <>0
JOIN_CACHE_BKA::init_join_matching_records() should treat
it as an error; thus it can itself return only two
possibilities: ok or error; thus its return type
is changed to bool instead of enum_nested_loop_state
* Change to JOIN_CACHE_BKA[_UNIQUE]::join_matching_records():
update to new return type of init_join_matching_records(),
and, while we're at it, moved declarations of variables
down to where they're needed.
modified:
mysql-test/r/distinct.result
mysql-test/r/join_outer.result
mysql-test/r/join_outer_bka.result
mysql-test/r/join_outer_bka_nixbnl.result
mysql-test/t/distinct.test
mysql-test/t/join_outer.test
sql/sql_executor.cc
sql/sql_executor.h
sql/sql_join_buffer.cc
sql/sql_join_buffer.h
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf revid:guilhem.bichot@stripped120523091249-gkzcjon2nkx6wcde
+++ b/.bzr-mysql/default.conf revid:marko.makela@strippedasc98us
@@ -1,4 +1,4 @@
[MYSQL]
-post_commit_to = "mysql_commits_ww_grp@stripped"
-post_push_to = "mysql_commits_ww_grp@stripped"
+post_commit_to = "commits@strippedql.com"
+post_push_to = "commits@stripped"
tree_name = "mysql-trunk"
=== modified file 'storage/innobase/btr/btr0btr.cc'
--- a/storage/innobase/btr/btr0btr.cc revid:guilhem.bichot@strippedcde
+++ b/storage/innobase/btr/btr0btr.cc revid:marko.makela@stripped
@@ -4252,7 +4252,9 @@ btr_validate_level(
fseg_header_t* seg;
ulint* offsets = NULL;
ulint* offsets2= NULL;
+#ifdef UNIV_ZIP_DEBUG
page_zip_des_t* page_zip;
+#endif /* UNIV_ZIP_DEBUG */
mtr_start(&mtr);
@@ -4322,8 +4324,8 @@ loop:
offsets = offsets2 = NULL;
mtr_x_lock(dict_index_get_lock(index), &mtr);
- page_zip = buf_block_get_page_zip(block);
#ifdef UNIV_ZIP_DEBUG
+ page_zip = buf_block_get_page_zip(block);
ut_a(!page_zip || page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */
=== modified file 'storage/innobase/page/page0page.cc'
--- a/storage/innobase/page/page0page.cc revid:guilhem.bichot@stripped
+++ b/storage/innobase/page/page0page.cc revid:marko.makela@oracle.com-20120523100612-nf4n0xzjgasc98us
@@ -2642,12 +2642,6 @@ page_delete_rec(
}
if (no_compress_needed) {
- ulint max_ins = 0;
-
- if (page_zip == 0) {
- max_ins = page_get_max_insert_size_after_reorganize(
- page, 1);
- }
#ifdef UNIV_ZIP_DEBUG
ut_a(page_zip == 0 || page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */
No bundle (reason: useless for push emails).| Thread |
|---|
| • bzr push into mysql-trunk branch (marko.makela:3880 to 3881) WL#5522 | marko.makela | 23 May |