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
a0c367a9
Commit
a0c367a9
authored
Jul 05, 2012
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for MDEV-376
parents
0ae76b78
a71fc7e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
mysql-test/r/index_merge_innodb.result
mysql-test/r/index_merge_innodb.result
+15
-0
mysql-test/t/index_merge_innodb.test
mysql-test/t/index_merge_innodb.test
+15
-0
sql/opt_range.cc
sql/opt_range.cc
+14
-3
No files found.
mysql-test/r/index_merge_innodb.result
View file @
a0c367a9
...
...
@@ -777,4 +777,19 @@ commit;
select * from t1 where t1.zone_id=830 AND modified=9;
pk zone_id modified
drop table t0, t1;
#
# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
#
CREATE TABLE t1 (
a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d');
SELECT ta.* FROM t1 AS ta, t1 AS tb
WHERE ( tb.b != ta.b OR tb.a = ta.a )
AND ( tb.b = ta.c OR tb.b = ta.b );
a b c
8 v v
8 m m
9 d d
DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;
mysql-test/t/index_merge_innodb.test
View file @
a0c367a9
...
...
@@ -156,6 +156,21 @@ select * from t1 where t1.zone_id=830 AND modified=9;
drop
table
t0
,
t1
;
--
echo
#
--
echo
# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
CHAR
(
1
),
c
CHAR
(
1
),
KEY
(
a
),
KEY
(
b
)
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
8
,
'v'
,
'v'
),(
8
,
'm'
,
'm'
),(
9
,
'd'
,
'd'
);
SELECT
ta
.*
FROM
t1
AS
ta
,
t1
AS
tb
WHERE
(
tb
.
b
!=
ta
.
b
OR
tb
.
a
=
ta
.
a
)
AND
(
tb
.
b
=
ta
.
c
OR
tb
.
b
=
ta
.
b
);
DROP
TABLE
t1
;
set
optimizer_switch
=
@
optimizer_switch_save
;
sql/opt_range.cc
View file @
a0c367a9
...
...
@@ -2008,7 +2008,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
if
(
reuse_handler
)
{
DBUG_PRINT
(
"info"
,
(
"Reusing handler 0x%lx"
,
(
long
)
file
));
if
(
init
()
||
reset
()
)
if
(
init
())
{
DBUG_RETURN
(
1
);
}
...
...
@@ -2043,7 +2043,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
if
(
file
->
ha_external_lock
(
thd
,
F_RDLCK
))
goto
failure
;
if
(
init
()
||
reset
()
)
if
(
init
())
{
file
->
ha_external_lock
(
thd
,
F_UNLCK
);
file
->
ha_close
();
...
...
@@ -2090,7 +2090,18 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
head
->
key_read
=
org_key_read
;
bitmap_copy
(
&
column_bitmap
,
head
->
read_set
);
head
->
column_bitmaps_set
(
&
column_bitmap
,
&
column_bitmap
);
if
(
reset
())
{
if
(
!
reuse_handler
)
{
file
->
ha_external_lock
(
thd
,
F_UNLCK
);
file
->
ha_close
();
goto
failure
;
}
else
DBUG_RETURN
(
1
);
}
DBUG_RETURN
(
0
);
failure:
...
...
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