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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
74fdbec6
Commit
74fdbec6
authored
Dec 29, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed LP bug #848652.
The cause of this bug was the same as for bug 902356 fixed for 5.3.
parent
2be9a419
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
mysql-test/r/join_outer_innodb.result
mysql-test/r/join_outer_innodb.result
+8
-0
mysql-test/t/join_outer_innodb.test
mysql-test/t/join_outer_innodb.test
+15
-0
sql/sql_select.cc
sql/sql_select.cc
+4
-3
No files found.
mysql-test/r/join_outer_innodb.result
View file @
74fdbec6
...
...
@@ -17,3 +17,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
DROP TABLE t1,t2;
CREATE TABLE t1(a int, b int, KEY (a), PRIMARY KEY (b)) ENGINE=InnoDB;
CREATE TABLE t2 (b int, PRIMARY KEY (b));
INSERT INTO t2 VALUES (4),(9);
SELECT STRAIGHT_JOIN t1.a FROM t1 RIGHT JOIN t2 ON t1.b = t2.b
WHERE (t1.b NOT BETWEEN 1 AND 7 OR t1.a IS NULL AND t1.b = t2.b) AND t2.b = 4
GROUP BY 1;
a
DROP TABLE t1,t2;
mysql-test/t/join_outer_innodb.test
View file @
74fdbec6
...
...
@@ -24,3 +24,18 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE
t1
.
name
LIKE
'A%'
OR
FALSE
;
DROP
TABLE
t1
,
t2
;
#
# Bug #848652: crash with RIGHT JOIN and GROUP BY
#
CREATE
TABLE
t1
(
a
int
,
b
int
,
KEY
(
a
),
PRIMARY
KEY
(
b
))
ENGINE
=
InnoDB
;
CREATE
TABLE
t2
(
b
int
,
PRIMARY
KEY
(
b
));
INSERT
INTO
t2
VALUES
(
4
),(
9
);
SELECT
STRAIGHT_JOIN
t1
.
a
FROM
t1
RIGHT
JOIN
t2
ON
t1
.
b
=
t2
.
b
WHERE
(
t1
.
b
NOT
BETWEEN
1
AND
7
OR
t1
.
a
IS
NULL
AND
t1
.
b
=
t2
.
b
)
AND
t2
.
b
=
4
GROUP
BY
1
;
DROP
TABLE
t1
,
t2
;
sql/sql_select.cc
View file @
74fdbec6
...
...
@@ -13725,8 +13725,8 @@ find_field_in_item_list (Field *field, void *data)
while
((
item
=
li
++
))
{
if
(
item
->
type
()
==
Item
::
FIELD_ITEM
&&
((
Item_field
*
)
item
)
->
field
->
eq
(
field
))
if
(
item
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
&&
((
Item_field
*
)
(
item
->
real_item
())
)
->
field
->
eq
(
field
))
{
part_found
=
1
;
break
;
...
...
@@ -13994,7 +13994,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
uint
used_pk_parts
=
0
;
if
(
used_key_parts
>
used_index_parts
)
used_pk_parts
=
used_key_parts
-
used_index_parts
;
rec_per_key
=
keyinfo
->
rec_per_key
[
used_key_parts
-
1
];
rec_per_key
=
used_key_parts
?
keyinfo
->
rec_per_key
[
used_key_parts
-
1
]
:
1
;
/* Take into account the selectivity of the used pk prefix */
if
(
used_pk_parts
)
{
...
...
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