List:Internals« Previous MessageNext Message »
From:Masood Mortazavi Date:September 16 2009 12:12am
Subject:Re: Contribution: Fix for BUG#42742
View as plain text  
Hi Sergey!

Thank you very much for your proposed contribution and interest in
MySQL here, which we always welcome. (It is good to see you continue
to be interested in MySQL after your recent move.)

Please note that, as with all Sun open source projects (such as
OpenSolaris and Java), Sun requires contributors to MySQL to sign the
Sun Contributor Agreement (SCA) except in the case of trivial bug
fixes that only require a small change.

Having an SCA in effect will enable and facilitate discussion
regarding your ideas and allows us to accept code contributions to
MySQL, through the internals and bugs db system.

The SCA is clear that when SCA signatories post to Sun sponsored
discussion lists such as MySQL internals and bugs db, such posts are
contributions under the SCA.  At the same time, you always have the
freedom of posting somewhere else if you do not want your material to
be treated as a contribution.

The SCA is a simple, one-page document
(http://www.sun.com/software/opensource/sca.pdf). A list of SCA
signatories, including dozens of contributors to MySQL can be found
here: https://sca.dev.java.net/CA_signatories.htm .

Under the SCA, contributors retain their copyrights to contributions
they make to the project while at the same time granting those same
rights to Sun as the MySQL project sponsor and owner. (As you may be
aware, SCA supersedes the previously used MySQL Contributor License
Agreement, CLA.) As a result, the SCA ensures the freedom of
contributors to use their contributions as they wish while allowing
Sun to maintain consistent contribution policies across its many open
source projects.

Please note that on the SCA document you sign, you can specify the Sun
project to which you'd like to contribute (in this case MySQL).
However, please do not modify the text of the SCA because such
modifications void the SCA.

Lastly, please post all your contributions through bugs db.

Bugs db allows for good, trackable, two-way communications with
contributors, and it is, effectively, our open issue tracking system.

I hope all this will help move things forward.

Best regards,
- m.

P.S.
And, for others who might run into this thread :-) ... you can read
more about the contribution process here:
http://forge.mysql.com/wiki/Contributing_Code
http://forge.mysql.com/wiki/Code_Contributing_FAQ

On Wed, Sep 9, 2009 at 12:40 PM, Sergey Petrunya <psergey@stripped> wrote:
> Hi,
>
> I'd like to offer the following bugfix under BSD licence:
>
> == Licence ==
> Copyright (c) 2009, Monty Program Ab
> All rights reserved.
>
> Redistribution and use in source and binary forms, with or without
> modification, are permitted provided that the following conditions are met:
>
>  * Redistributions of source code must retain the above copyright notice,
>   this list of conditions and the following disclaimer.
>  * Redistributions in binary form must reproduce the above copyright notice,
>   this list of conditions and the following disclaimer in the documentation
>   and/or other materials provided with the distribution.
>  * Neither the name of the Monty Program Ab nor the names of its contributors
>   may be used to endorse or promote products derived from this software
>   without specific prior written permission.
>
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> POSSIBILITY OF SUCH DAMAGE.
>
> == The patch  ==
>
> At file:///home/psergey/dev/mysql-next-fix-subq/
> ------------------------------------------------------------
> revno: 2817
> revision-id: psergey@stripped
> parent: psergey@stripped
> committer: Sergey Petrunya <psergey@stripped>
> branch nick: mysql-next-fix-subq
> timestamp: Mon 2009-07-06 18:33:29 +0400
> message:
>  BUG#42742: crash in setup_sj_materialization, Copy_field::set
>  - If a semi-join strategy covers certain [first_table; last_table]
>    range in join order, do reset the sj_strategy member for all tables
>    within the range, except the first one.
>    Failure to do so caused EXPLAIN/execution code to try applying two
>    strategies at once which would cause all kinds of undesired effects.
> === modified file 'mysql-test/r/subselect_sj2.result'
> --- a/mysql-test/r/subselect_sj2.result 2009-03-21 15:31:38 +0000
> +++ b/mysql-test/r/subselect_sj2.result 2009-07-06 14:33:29 +0000
> @@ -689,3 +689,19 @@
>  id     select_type     table   type  
>  possible_keys   key     key_len ref     rows  
>  Extra
>  1      PRIMARY NULL    NULL    NULL  
>  NULL    NULL    NULL    NULL    Impossible
> WHERE noticed after reading const tables
>  drop table t1, t2;
> +#
> +# BUG#42742: crash in setup_sj_materialization, Copy_field::set
> +#
> +create table t3 ( c1 year) engine=innodb;
> +insert into t3 values (2135),(2142);
> +create table t2 (c1 tinytext,c2 text,c6 timestamp) engine=innodb;
> +# The following must not crash, EXPLAIN should show one SJ strategy, not a mix:
> +explain select 1 from t2 where
> +c2 in (select 1 from t3, t2) and
> +c1 in (select convert(c6,char(1)) from t2);
> +id     select_type     table   type  
>  possible_keys   key     key_len ref     rows  
>  Extra
> +1      PRIMARY t2      ALL     NULL  
>  NULL    NULL    NULL    1       Using
> where
> +1      PRIMARY t2      ALL     NULL  
>  NULL    NULL    NULL    1
> +1      PRIMARY t2      ALL     NULL  
>  NULL    NULL    NULL    1       Using
> where; Using join buffer
> +1      PRIMARY t3      ALL     NULL  
>  NULL    NULL    NULL    2      
> FirstMatch(t2); Using join buffer
> +drop table t2, t3;
>
> === modified file 'mysql-test/r/subselect_sj2_jcl6.result'
> --- a/mysql-test/r/subselect_sj2_jcl6.result    2009-06-19 09:12:06 +0000
> +++ b/mysql-test/r/subselect_sj2_jcl6.result    2009-07-06 14:33:29 +0000
> @@ -693,6 +693,22 @@
>  id     select_type     table   type  
>  possible_keys   key     key_len ref     rows  
>  Extra
>  1      PRIMARY NULL    NULL    NULL  
>  NULL    NULL    NULL    NULL    Impossible
> WHERE noticed after reading const tables
>  drop table t1, t2;
> +#
> +# BUG#42742: crash in setup_sj_materialization, Copy_field::set
> +#
> +create table t3 ( c1 year) engine=innodb;
> +insert into t3 values (2135),(2142);
> +create table t2 (c1 tinytext,c2 text,c6 timestamp) engine=innodb;
> +# The following must not crash, EXPLAIN should show one SJ strategy, not a mix:
> +explain select 1 from t2 where
> +c2 in (select 1 from t3, t2) and
> +c1 in (select convert(c6,char(1)) from t2);
> +id     select_type     table   type  
>  possible_keys   key     key_len ref     rows  
>  Extra
> +1      PRIMARY t2      ALL     NULL  
>  NULL    NULL    NULL    1       Using
> where
> +1      PRIMARY t2      ALL     NULL  
>  NULL    NULL    NULL    1       Using
> join buffer
> +1      PRIMARY t2      ALL     NULL  
>  NULL    NULL    NULL    1       Using
> where; Using join buffer
> +1      PRIMARY t3      ALL     NULL  
>  NULL    NULL    NULL    2      
> FirstMatch(t2); Using join buffer
> +drop table t2, t3;
>  set join_cache_level=default;
>  show variables like 'join_cache_level';
>  Variable_name  Value
>
> === modified file 'mysql-test/t/subselect_sj2.test'
> --- a/mysql-test/t/subselect_sj2.test   2009-03-21 15:31:38 +0000
> +++ b/mysql-test/t/subselect_sj2.test   2009-07-06 14:33:29 +0000
> @@ -872,3 +872,15 @@
>  explain select 1 from t2 where c2 = any (select log10(null) from t1 where c6
> <null)  ;
>  drop table t1, t2;
>
> +--echo #
> +--echo # BUG#42742: crash in setup_sj_materialization, Copy_field::set
> +--echo #
> +create table t3 ( c1 year) engine=innodb;
> +insert into t3 values (2135),(2142);
> +create table t2 (c1 tinytext,c2 text,c6 timestamp) engine=innodb;
> +-- echo # The following must not crash, EXPLAIN should show one SJ strategy, not a
> mix:
> +explain select 1 from t2 where
> +  c2 in (select 1 from t3, t2) and
> +  c1 in (select convert(c6,char(1)) from t2);
> +drop table t2, t3;
> +
>
> === modified file 'sql/sql_select.cc'
> --- a/sql/sql_select.cc 2009-07-06 07:57:39 +0000
> +++ b/sql/sql_select.cc 2009-07-06 14:33:29 +0000
> @@ -7916,7 +7916,11 @@
>
>     uint i_end= first + join->best_positions[first].n_sj_tables;
>     for (uint i= first; i < i_end; i++)
> +    {
> +      if (i != first)
> +        join->best_positions[i].sj_strategy= SJ_OPT_NONE;
>       handled_tabs |=
> join->best_positions[i].table->table->map;
> +    }
>
>     if (tablenr != first)
>       pos->sj_strategy= SJ_OPT_NONE;
>
> BR
>  Sergey
> --
> Sergey Petrunia, Software Developer
> Monty Program AB, http://askmonty.org
> Blog: http://s.petrunia.net/blog
>
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals?unsub=1
>
>
Thread
Contribution: Fix for BUG#42742Sergey Petrunya9 Sep
  • Re: Contribution: Fix for BUG#42742Jay Pipes9 Sep
  • Re: Contribution: Fix for BUG#42742Masood Mortazavi16 Sep
    • Re: Contribution: Fix for BUG#42742Vladimir Shebordaev16 Sep
      • Re: Contribution: Fix for BUG#42742Giuseppe Maxia16 Sep
    • Re: Contribution: Fix for BUG#42742Kristian Nielsen16 Sep
      • Re: Contribution: Fix for BUG#42742Giuseppe Maxia16 Sep
        • Re: Contribution: Fix for BUG#42742Masood Mortazavi17 Sep