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
adf8aaca
Commit
adf8aaca
authored
Dec 23, 2008
by
Sergey Petrunia
Browse files
Options
Browse Files
Download
Plain Diff
Merge: mysql-5.0-bugteam -> mysql-5.1-bugteam
parents
6291fa6f
6147201a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
mysql-test/include/index_merge1.inc
mysql-test/include/index_merge1.inc
+26
-0
mysql-test/r/index_merge_myisam.result
mysql-test/r/index_merge_myisam.result
+28
-0
sql/opt_range.cc
sql/opt_range.cc
+3
-0
No files found.
mysql-test/include/index_merge1.inc
View file @
adf8aaca
...
@@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
...
@@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#40974: Incorrect query results when using clause evaluated using range check
--
echo
#
create
table
t0
(
a
int
);
insert
into
t0
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
2
);
create
table
t2
(
a
int
,
b
int
);
insert
into
t2
values
(
1
,
1
),
(
2
,
1000
);
create
table
t3
(
a
int
,
b
int
,
filler
char
(
100
),
key
(
a
),
key
(
b
));
insert
into
t3
select
1000
,
1000
,
'filler'
from
t0
A
,
t0
B
,
t0
C
;
insert
into
t3
values
(
1
,
1
,
'data'
);
insert
into
t3
values
(
1
,
1
,
'data'
);
--
echo
The
plan
should
be
ALL
/
ALL
/
ALL
(
Range
checked
for
each
record
(
index
map
:
0x3
)
explain
select
*
from
t1
where
exists
(
select
1
from
t2
,
t3
where
t2
.
a
=
t1
.
a
and
(
t3
.
a
=
t2
.
b
or
t3
.
b
=
t2
.
b
or
t3
.
b
=
t2
.
b
+
1
));
select
*
from
t1
where
exists
(
select
1
from
t2
,
t3
where
t2
.
a
=
t1
.
a
and
(
t3
.
a
=
t2
.
b
or
t3
.
b
=
t2
.
b
or
t3
.
b
=
t2
.
b
+
1
));
drop
table
t0
,
t1
,
t2
,
t3
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
mysql-test/r/index_merge_myisam.result
View file @
adf8aaca
...
@@ -529,6 +529,34 @@ b a
...
@@ -529,6 +529,34 @@ b a
y
y
z
z
DROP TABLE t1;
DROP TABLE t1;
#
# BUG#40974: Incorrect query results when using clause evaluated using range check
#
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int);
insert into t1 values (1),(2);
create table t2(a int, b int);
insert into t2 values (1,1), (2, 1000);
create table t3 (a int, b int, filler char(100), key(a), key(b));
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
insert into t3 values (1,1,'data');
insert into t3 values (1,1,'data');
The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
explain select * from t1
where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
select * from t1
where exists (select 1 from t2, t3
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
a
1
2
drop table t0, t1, t2, t3;
End of 5.0 tests
End of 5.0 tests
#---------------- ROR-index_merge tests -----------------------
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
SET SESSION STORAGE_ENGINE = MyISAM;
...
...
sql/opt_range.cc
View file @
adf8aaca
...
@@ -1245,6 +1245,9 @@ QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT()
...
@@ -1245,6 +1245,9 @@ QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT()
quick
->
file
=
NULL
;
quick
->
file
=
NULL
;
quick_selects
.
delete_elements
();
quick_selects
.
delete_elements
();
delete
pk_quick_select
;
delete
pk_quick_select
;
/* It's ok to call the next two even if they are already deinitialized */
end_read_record
(
&
read_record
);
free_io_cache
(
head
);
free_root
(
&
alloc
,
MYF
(
0
));
free_root
(
&
alloc
,
MYF
(
0
));
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
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