Re: [Maria-developers] Fwd: [Commits] Rev 2859: Fixed LP #bug 660963. in file:///home/igor/maria/maria-5.3-mwl128-bug660963/
Hello Igor, On Thu, Nov 18, 2010 at 02:17:13PM -0800, Igor Babaev wrote: Sergey, Please review this patch ASAP as this bug blocks Philip with testing. If you have any questions contact me by skype. Ok to push after the comment below is addressed. Original Message Subject: [Commits] Rev 2859: Fixed LP #bug 660963. in file:///home/igor/maria/maria-5.3-mwl128-bug660963/ Date: Thu, 18 Nov 2010 14:13:58 -0800 (PST) From: Igor Babaev i...@askmonty.org Reply-To: maria-developers@lists.launchpad.net To: comm...@mariadb.org At file:///home/igor/maria/maria-5.3-mwl128-bug660963/ revno: 2859 revision-id: i...@askmonty.org-20101118221357-zg55d3erru07ugzy parent: i...@askmonty.org-20101116050732-hpbqelsf8nvae4xt committer: Igor Babaev i...@askmonty.org branch nick: maria-5.3-mwl128-bug660963 timestamp: Thu 2010-11-18 14:13:57 -0800 message: 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. ... === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2010-11-16 05:07:32 + +++ b/sql/sql_select.cc 2010-11-18 22:13:57 + @@ -7635,8 +7635,7 @@ if (cache_level == 0 || i == join-const_tables || !prev_tab) return 0; - if (force_unlinked_cache - (cache_level JOIN_CACHE_INCREMENTAL_BIT)) + if (force_unlinked_cache (cache_level%2 == 0)) cache_level--; if (options SELECT_NO_JOIN_CACHE) @@ -7658,13 +7657,14 @@ /* Non-linked join buffers can't guarantee one match */ - if ((force_unlinked_cache || cache_level == 1) - ((tab-is_inner_table_of_semi_join_with_first_match() -!tab-is_single_inner_of_semi_join_with_first_match()) || - (tab-is_inner_table_of_outer_join() -!tab-is_single_inner_of_outer_join( - goto no_join_cache; - + if (tab-is_nested_inner()) + { +if (force_unlinked_cache || cache_level == 1) + goto no_join_cache; +if (cache_level 1) + cache_level--; + } + /* Don't use join buffering if we're dictated not to by no_jbuf_after (this ...) @@ -7757,9 +7757,6 @@ (cache_level = 6 || no_hashed_cache)) goto no_join_cache; -if (prev_tab-cache cache_level==7) - cache_level= 6; - if ((rows != HA_POS_ERROR) !(flags HA_MRR_USE_DEFAULT_IMPL)) { if (cache_level = 6 || no_hashed_cache) === modified file 'sql/sql_select.h' --- a/sql/sql_select.h2010-11-13 14:13:34 + +++ b/sql/sql_select.h2010-11-18 22:13:57 + @@ -359,6 +359,14 @@ return (first_inner first_inner-last_inner == this) || last_sj_inner_tab == this; } + bool is_nested_inner() Please add a comment clarifying what this function checks. + { +if (first_inner (first_inner != last_inner || first_upper)) + return TRUE; +if (first_sj_inner_tab first_sj_inner_tab != last_sj_inner_tab) + return TRUE; +return FALSE; + } struct st_join_table *get_first_inner_table() { if (first_inner) BR Sergey -- Sergey Petrunia, Software Developer Monty Program AB, http://askmonty.org Blog: http://s.petrunia.net/blog ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Re: [Maria-developers] Fwd: [Commits] Rev 2860: Fixed LP bug #675922. in file:///home/igor/maria/maria-5.3-mwl128-bug675922/
Hello Igor, On Thu, Nov 18, 2010 at 10:04:24PM -0800, Igor Babaev wrote: Sergey, Please review this fix. Ok to push after the irc feedback (lack of comments about JOIN_CACHE format) is addressed. Original Message Subject: [Commits] Rev 2860: Fixed LP bug #675922. in file:///home/igor/maria/maria-5.3-mwl128-bug675922/ Date: Thu, 18 Nov 2010 22:02:41 -0800 (PST) From: Igor Babaev i...@askmonty.org Reply-To: maria-developers@lists.launchpad.net To: comm...@mariadb.org At file:///home/igor/maria/maria-5.3-mwl128-bug675922/ revno: 2860 revision-id: i...@askmonty.org-20101119060240-gzh1k5gxl3aazk45 parent: i...@askmonty.org-20101118221357-zg55d3erru07ugzy committer: Igor Babaev i...@askmonty.org branch nick: maria-5.3-mwl128-bug675922 timestamp: Thu 2010-11-18 22:02:40 -0800 message: 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. === modified file 'mysql-test/r/join_cache.result' --- a/mysql-test/r/join_cache.result 2010-11-18 22:13:57 + +++ b/mysql-test/r/join_cache.result 2010-11-19 06:02:40 + @@ -6004,4 +6004,56 @@ SET SESSION optimizer_switch = 'outer_join_with_cache=off'; SET SESSION join_cache_level = DEFAULT; DROP TABLE t1,t2,t3; +# +# Bug #675922: incremental buffer for BKA with access from previous +# buffers from non-nullable columns whose values may be null +# +CREATE TABLE t1 (a1 varchar(32)) ; +INSERT INTO t1 VALUES ('s'),('k'); +CREATE TABLE t2 (a2 int PRIMARY KEY, b2 varchar(32)) ; +INSERT INTO t2 VALUES (7,'s'); +CREATE TABLE t3 (a3 int PRIMARY KEY, b3 varchar(32)) ; +INSERT INTO t3 VALUES (7,'s'); +CREATE TABLE t4 (a4 int) ; +INSERT INTO t4 VALUES (9); +CREATE TABLE t5(a5 int PRIMARY KEY, b5 int) ; +INSERT INTO t5 VALUES (7,0); +SET SESSION optimizer_switch = 'outer_join_with_cache=on'; +SET SESSION join_cache_level = 0; +EXPLAIN +SELECT t4.a4, t5.b5 +FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.a2 = t3.a3) ON t2.b2 = t1.a1) +LEFT JOIN t4 ON t4.a4 0) LEFT JOIN t5 ON t5.a5 = t2.a2; +id select_type table typepossible_keys key key_len ref rowsExtra +1SIMPLE t1 ALL NULLNULLNULLNULL2 +1SIMPLE t2 ALL PRIMARY NULLNULLNULL1 Using where +1SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using index +1SIMPLE t4 ALL NULLNULLNULLNULL1 Using where +1SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using where +SELECT t4.a4, t5.b5 +FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.a2 = t3.a3) ON t2.b2 = t1.a1) +LEFT JOIN t4 ON t4.a4 0) LEFT JOIN t5 ON t5.a5 = t2.a2; +a4 b5 +90 +9NULL +SET SESSION join_cache_level = 6; +EXPLAIN +SELECT t4.a4, t5.b5 +FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.a2 = t3.a3) ON t2.b2 = t1.a1) +LEFT JOIN t4 ON t4.a4 0) LEFT JOIN t5 ON t5.a5 = t2.a2; +id select_type table typepossible_keys key key_len ref rowsExtra +1SIMPLE t1 ALL NULLNULLNULLNULL2 +1SIMPLE t2 ALL PRIMARY NULLNULLNULL1 Using where +1SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using index +1SIMPLE t4 ALL NULLNULLNULLNULL1 Using where; Using join buffer (flat, BNL join) +1SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using where; Using join buffer (incremental, BKA join) +SELECT t4.a4, t5.b5 +FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.a2 = t3.a3) ON t2.b2 = t1.a1) +LEFT JOIN t4 ON t4.a4 0) LEFT JOIN t5 ON t5.a5 = t2.a2; +a4 b5 +90 +9NULL +SET SESSION optimizer_switch = 'outer_join_with_cache=off'; +SET SESSION join_cache_level = DEFAULT; +DROP TABLE t1,t2,t3,t4,t5; set @@optimizer_swit...@save_optimizer_switch; === modified file 'mysql-test/t/join_cache.test' --- a/mysql-test/t/join_cache.test2010-11-18 22:13:57 + +++ b/mysql-test/t/join_cache.test2010-11-19 06:02:40 + @@ -2655,5 +2655,50 @@ DROP TABLE t1,t2,t3; +--echo #
[Maria-developers] MariaDB 5.1.51
All, I've created the download, release notes, and changelog pages for MariaDB 5.1.51: http://askmonty.org/wiki/MariaDB:Download:MariaDB_5.1.51 http://kb.askmonty.org/v/mariadb-5151-release-notes http://kb.askmonty.org/v/mariadb-5151-changelog Apart from the CentOS packages, the mirrors should now have all of the files for this release. There was an issue with the signing key used on the CentOS packages. The issue has been fixed and the updated packages are seeding now. If you can't wait, the osuosl.org mirror is the primary one and is always up-to-date. Please let me know if anything is missing from the release notes or changelog, or if there are any errors. If you have editing rights, feel free to make the corrections or additions directly; otherwise, please let me know of needed changes here or on IRC. Thanks. -- Daniel Bartholomew MariaDB - http://mariadb.org Monty Program - http://montyprogram.com AskMonty Knowledgebase - http://kb.askmonty.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Re: [Maria-developers] MariaDB 5.1.51
On 11/19/2010 08:17 AM, Daniel Bartholomew wrote: All, I've created the download, release notes, and changelog pages for MariaDB 5.1.51: http://askmonty.org/wiki/MariaDB:Download:MariaDB_5.1.51 http://kb.askmonty.org/v/mariadb-5151-release-notes http://kb.askmonty.org/v/mariadb-5151-changelog Apart from the CentOS packages, the mirrors should now have all of the files for this release. There was an issue with the signing key used on the CentOS packages. The issue has been fixed and the updated packages are seeding now. If you can't wait, the osuosl.org mirror is the primary one and is always up-to-date. Please let me know if anything is missing from the release notes or changelog, or if there are any errors. If you have editing rights, feel free to make the corrections or additions directly; otherwise, please let me know of needed changes here or on IRC. Thanks. * MySQL Bug #51242 http://bugs.mysql.com/bug.php?id=51242 /HAVING clause on table join produce incorrect results/ Daniel, this 'fix' was reverted in MariaDB 5.1.48. Then Monty mistakenly pulled in when merging. A month ago I removed it again in 5.1. How has it come that it's there? Is it there? The same is applied to * MySQL Bug #39653 http://bugs.mysql.com/bug.php?id=39653 /find_shortest_key in sql_select.cc does not consider clustered primary keys:/ We did not accept the patch in 5.1.48. Did we provide a different patch? How did you get the list of bugs in http://kb.askmonty.org/v/mariadb-5151-release-notes after all? ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Re: [Maria-developers] MariaDB 5.1.51
On Fri, 19 Nov 2010 09:04:17 -0800 Igor Babaev i...@askmonty.org wrote: Igor * MySQL Bug #51242 Igor http://bugs.mysql.com/bug.php?id=51242 /HAVING clause on table Igor join produce incorrect results/ Igor Igor Daniel, Igor Igor this 'fix' was reverted in MariaDB 5.1.48. Igor Then Monty mistakenly pulled in when merging. A month ago I Igor removed it again in 5.1. Igor How has it come that it's there? Is it there? Igor Igor The same is applied to Igor Igor * MySQL Bug #39653 http://bugs.mysql.com/bug.php?id=39653 Igor /find_shortest_key in sql_select.cc does not consider Igor clustered primary keys:/ Igor Igor We did not accept the patch in 5.1.48. Did we provide a different Igor patch? Igor Igor How did you get the list of bugs in Igor http://kb.askmonty.org/v/mariadb-5151-release-notes after all? The list of bugs was gatherered from the bugs mentioned in the Changelog: http://kb.askmonty.org/v/mariadb-5151-changelog The changelog is basically a list of the commit messages between 5.1.50 and 5.1.51. For mybug#51242 you are correct that the fix for this bug was reverted: http://bazaar.launchpad.net/~maria-captains/maria/5.1/revision/2952 I've removed 51242 from the list on the release notes. For mybug#39653, the commit message says that a fix was applied for it: http://bazaar.launchpad.net/~maria-captains/maria/5.1/revision/2958 ... but maybe I'm misreading the commit message. Should I remove it from the list of fixed bugs? Thanks! -- Daniel Bartholomew MariaDB - http://mariadb.org Monty Program - http://montyprogram.com AskMonty Knowledgebase - http://kb.askmonty.org ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Re: [Maria-developers] MariaDB 5.1.51
Daniel Bartholomew wrote: On Fri, 19 Nov 2010 09:04:17 -0800 Igor Babaev i...@askmonty.org wrote: Igor * MySQL Bug #51242 Igor http://bugs.mysql.com/bug.php?id=51242 /HAVING clause on table Igor join produce incorrect results/ Igor Igor Daniel, Igor Igor this 'fix' was reverted in MariaDB 5.1.48. Igor Then Monty mistakenly pulled in when merging. A month ago I Igor removed it again in 5.1. Igor How has it come that it's there? Is it there? Igor Igor The same is applied to Igor Igor * MySQL Bug #39653 http://bugs.mysql.com/bug.php?id=39653 Igor /find_shortest_key in sql_select.cc does not consider Igor clustered primary keys:/ Igor Igor We did not accept the patch in 5.1.48. Did we provide a different Igor patch? Igor Igor How did you get the list of bugs in Igor http://kb.askmonty.org/v/mariadb-5151-release-notes after all? The list of bugs was gatherered from the bugs mentioned in the Changelog: http://kb.askmonty.org/v/mariadb-5151-changelog The changelog is basically a list of the commit messages between 5.1.50 and 5.1.51. For mybug#51242 you are correct that the fix for this bug was reverted: http://bazaar.launchpad.net/~maria-captains/maria/5.1/revision/2952 I've removed 51242 from the list on the release notes. For mybug#39653, the commit message says that a fix was applied for it: http://bazaar.launchpad.net/~maria-captains/maria/5.1/revision/2958 ... but maybe I'm misreading the commit message. Should I remove it from the list of fixed bugs? It seems to me that SergeiG pushed his own fix for this bug which has nothing to do with mysql patch. And this is important since Facebook guys screamed exactly about the mysql fix of this bug. Meanwhile we do not provide a link to our patch. Rather we give a reference to their patch. I'm afraid people will be confused. This is true for others of our fixes that differ from those pushed into the mysql code base. Regards, Igor. Thanks! ___ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp