Re: [Maria-developers] [Commits] Rev 3049: BUG#778406: Crash in hp_movelink with Aria engine and subqueries in file:///home/psergey/dev2/5.3-push3/
Sergey, Ok to push. I'd rather add a comment to the block of code starting with: " // 1. Store the length " At least to me it was not obvious why it is the way it is. Timour
At file:///home/psergey/dev2/5.3-push3/
------------------------------------------------------------ revno: 3049 revision-id: psergey@askmonty.org-20110615143701-cgzzcr5l4ot2cxjy parent: psergey@askmonty.org-20110615134018-5g5jbhqhce43onz4 committer: Sergey Petrunya<psergey@askmonty.org> branch nick: 5.3-push3 timestamp: Wed 2011-06-15 18:37:01 +0400 message: BUG#778406: Crash in hp_movelink with Aria engine and subqueries -In do_sj_dups_weedout(), set nulls_ptr to point to NULL bytes (and not to length bytes) of the DuplicateWeedout column. === modified file 'mysql-test/r/subselect_sj.result' --- a/mysql-test/r/subselect_sj.result 2011-06-15 09:43:04 +0000 +++ b/mysql-test/r/subselect_sj.result 2011-06-15 14:37:01 +0000 @@ -1305,4 +1305,25 @@ GROUP BY field2 ; field2 drop table t1, t2, t3; +# +# BUG#778406 Crash in hp_movelink with Aria engine and subqueries +# +CREATE TABLE t4 (f10 varchar(32) , KEY (f10)) ENGINE=Aria; +INSERT INTO t4 VALUES ('x'),('m'),('c'); +CREATE TABLE t1 (f11 int) ENGINE=Aria; +INSERT INTO t1 VALUES (0),(0),(0); +CREATE TABLE t2 ( f10 int) ENGINE=Aria; +INSERT INTO t2 VALUES (0),(0),(0); +CREATE TABLE t3 ( f10 int, f11 int) ENGINE=Aria; +SELECT * +FROM t4 +WHERE f10 IN +( SELECT t1.f11 +FROM t1 +LEFT JOIN t2 JOIN t3 ON t3.f10 = t2.f10 ON t3.f11 != 0 ); +f10 +x +m +c +drop table t1,t2,t3,t4; set @@optimizer_switch=@save_optimizer_switch;
=== modified file 'mysql-test/r/subselect_sj_jcl6.result' --- a/mysql-test/r/subselect_sj_jcl6.result 2011-06-15 09:43:04 +0000 +++ b/mysql-test/r/subselect_sj_jcl6.result 2011-06-15 14:37:01 +0000 @@ -1313,6 +1313,27 @@ GROUP BY field2 ; field2 drop table t1, t2, t3; +# +# BUG#778406 Crash in hp_movelink with Aria engine and subqueries +# +CREATE TABLE t4 (f10 varchar(32) , KEY (f10)) ENGINE=Aria; +INSERT INTO t4 VALUES ('x'),('m'),('c'); +CREATE TABLE t1 (f11 int) ENGINE=Aria; +INSERT INTO t1 VALUES (0),(0),(0); +CREATE TABLE t2 ( f10 int) ENGINE=Aria; +INSERT INTO t2 VALUES (0),(0),(0); +CREATE TABLE t3 ( f10 int, f11 int) ENGINE=Aria; +SELECT * +FROM t4 +WHERE f10 IN +( SELECT t1.f11 +FROM t1 +LEFT JOIN t2 JOIN t3 ON t3.f10 = t2.f10 ON t3.f11 != 0 ); +f10 +x +m +c +drop table t1,t2,t3,t4; set @@optimizer_switch=@save_optimizer_switch; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
=== modified file 'mysql-test/t/subselect_sj.test' --- a/mysql-test/t/subselect_sj.test 2011-06-15 09:43:04 +0000 +++ b/mysql-test/t/subselect_sj.test 2011-06-15 14:37:01 +0000 @@ -1189,5 +1189,28 @@
drop table t1, t2, t3;
+--echo # +--echo # BUG#778406 Crash in hp_movelink with Aria engine and subqueries +--echo # +CREATE TABLE t4 (f10 varchar(32) , KEY (f10)) ENGINE=Aria; +INSERT INTO t4 VALUES ('x'),('m'),('c'); + +CREATE TABLE t1 (f11 int) ENGINE=Aria; +INSERT INTO t1 VALUES (0),(0),(0); + +CREATE TABLE t2 ( f10 int) ENGINE=Aria; +INSERT INTO t2 VALUES (0),(0),(0); + +CREATE TABLE t3 ( f10 int, f11 int) ENGINE=Aria; + +SELECT * +FROM t4 +WHERE f10 IN +( SELECT t1.f11 +FROM t1 +LEFT JOIN t2 JOIN t3 ON t3.f10 = t2.f10 ON t3.f11 != 0 ); + +drop table t1,t2,t3,t4; + # The following command must be the last one the file set @@optimizer_switch=@save_optimizer_switch;
=== modified file 'sql/opt_subselect.cc' --- a/sql/opt_subselect.cc 2011-06-06 22:50:46 +0000 +++ b/sql/opt_subselect.cc 2011-06-15 14:37:01 +0000 @@ -3515,7 +3515,6 @@ }
ptr= sjtbl->tmp_table->record[0] + 1; - nulls_ptr= ptr;
/* Put the the rowids tuple into table->record[0]: */
@@ -3531,6 +3530,7 @@ ptr += 2; }
+ nulls_ptr= ptr; // 2. Zero the null bytes if (sjtbl->null_bytes) {
_______________________________________________ commits mailing list commits@mariadb.org https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits
participants (1)
-
Timour Katchaounov