Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c6ba9598
Commit
c6ba9598
authored
Mar 01, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG#725275
parents
6cd1ec3b
10b8119a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
mysql-test/r/join.result
mysql-test/r/join.result
+34
-0
mysql-test/t/join.test
mysql-test/t/join.test
+23
-0
sql/sql_select.cc
sql/sql_select.cc
+3
-1
No files found.
mysql-test/r/join.result
View file @
c6ba9598
...
...
@@ -1251,3 +1251,37 @@ Handler_read_rnd 0
Handler_read_rnd_next 1
DROP TABLE t1, t2;
End of 5.1 tests
#
# BUG#724275: Crash in JOIN::optimize in maria-5.3
#
create table t1 (a int);
insert into t1 values (1),(2);
insert into t1 select * from t1;
create table t2 (a int, b int, key(a,b));
insert into t2 values (1,1),(1,2),(1,3),(1,4),(2,5),(2,6),(2,7),(2,8),(2,9);
insert into t2 select * from t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
create table t3 (a int, b int, key(a));
insert into t3 values (1,1),(2,2);
select * from
t3 straight_join t1 straight_join t2 force index(a)
where t2.a=1 and t2.b=t1.a and t1.a=t3.b and t3.a=1;
a b a a b
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
drop table t1,t2,t3;
mysql-test/t/join.test
View file @
c6ba9598
...
...
@@ -941,3 +941,26 @@ SHOW STATUS LIKE 'Handler_read_%';
DROP
TABLE
t1
,
t2
;
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# BUG#724275: Crash in JOIN::optimize in maria-5.3
--
echo
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
2
);
insert
into
t1
select
*
from
t1
;
create
table
t2
(
a
int
,
b
int
,
key
(
a
,
b
));
insert
into
t2
values
(
1
,
1
),(
1
,
2
),(
1
,
3
),(
1
,
4
),(
2
,
5
),(
2
,
6
),(
2
,
7
),(
2
,
8
),(
2
,
9
);
insert
into
t2
select
*
from
t2
;
insert
into
t2
select
*
from
t2
;
insert
into
t2
select
*
from
t2
;
create
table
t3
(
a
int
,
b
int
,
key
(
a
));
insert
into
t3
values
(
1
,
1
),(
2
,
2
);
select
*
from
t3
straight_join
t1
straight_join
t2
force
index
(
a
)
where
t2
.
a
=
1
and
t2
.
b
=
t1
.
a
and
t1
.
a
=
t3
.
b
and
t3
.
a
=
1
;
drop
table
t1
,
t2
,
t3
;
sql/sql_select.cc
View file @
c6ba9598
...
...
@@ -1056,6 +1056,7 @@ JOIN::optimize()
*/
for
(
JOIN_TAB
*
tab
=
join_tab
+
const_tables
;
tab
<
join_tab
+
tables
;
tab
++
)
{
uint
key_copy_index
=
0
;
for
(
uint
i
=
0
;
i
<
tab
->
ref
.
key_parts
;
i
++
)
{
...
...
@@ -1071,13 +1072,14 @@ JOIN::optimize()
{
*
ref_item_ptr
=
ref_item
;
Item
*
item
=
ref_item
->
real_item
();
store_key
*
key_copy
=
tab
->
ref
.
key_copy
[
i
];
store_key
*
key_copy
=
tab
->
ref
.
key_copy
[
key_copy_index
];
if
(
key_copy
->
type
()
==
store_key
::
FIELD_STORE_KEY
)
{
store_key_field
*
field_copy
=
((
store_key_field
*
)
key_copy
);
field_copy
->
change_source_field
((
Item_field
*
)
item
);
}
}
key_copy_index
++
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment