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
abd73446
Commit
abd73446
authored
Jun 02, 2006
by
gkodinov@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/4.1/B4981
into mysql.com:/home/kgeorge/mysql/5.0/B4981
parents
fdc2b921
b519877c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
mysql-test/r/select.result
mysql-test/r/select.result
+14
-0
mysql-test/t/select.test
mysql-test/t/select.test
+14
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-1
No files found.
mysql-test/r/select.result
View file @
abd73446
...
...
@@ -3446,3 +3446,17 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,b b 5 NULL 3 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 Using where
DROP TABLE t1, t2;
CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c));
insert into t1 values (1,0,0),(2,0,0);
CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a));
insert into t2 values (1,'',''), (2,'','');
CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b));
insert into t3 values (1,1),(1,2);
explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2
where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and
t2.b like '%%' order by t2.b limit 0,1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b,c b 5 const 1 Using where; Using temporary; Using filesort
1 SIMPLE t3 index PRIMARY,a,b PRIMARY 8 NULL 2 Using index
1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 2 Range checked for each record (index map: 0x1)
DROP TABLE t1,t2,t3;
mysql-test/t/select.test
View file @
abd73446
...
...
@@ -2264,6 +2264,20 @@ insert into t2 values(1,1);
select
*
from
t1
where
f1
in
(
select
f3
from
t2
where
(
f3
,
f4
)
=
(
select
f3
,
f4
from
t2
));
drop
table
t1
,
t2
;
#
# Bug #4981: 4.x and 5.x produce non-optimal execution path, 3.23 regression test failure
#
CREATE
TABLE
t1
(
a
int
,
b
int
,
c
int
,
KEY
b
(
b
),
KEY
c
(
c
));
insert
into
t1
values
(
1
,
0
,
0
),(
2
,
0
,
0
);
CREATE
TABLE
t2
(
a
int
,
b
varchar
(
2
),
c
varchar
(
2
),
PRIMARY
KEY
(
a
));
insert
into
t2
values
(
1
,
''
,
''
),
(
2
,
''
,
''
);
CREATE
TABLE
t3
(
a
int
,
b
int
,
PRIMARY
KEY
(
a
,
b
),
KEY
a
(
a
),
KEY
b
(
b
));
insert
into
t3
values
(
1
,
1
),(
1
,
2
);
# must have "range checked" for t2
explain
select
straight_join
DISTINCT
t2
.
a
,
t2
.
b
,
t1
.
c
from
t1
,
t3
,
t2
where
(
t1
.
c
=
t2
.
a
or
(
t1
.
c
=
t3
.
a
and
t2
.
a
=
t3
.
b
))
and
t1
.
b
=
556476786
and
t2
.
b
like
'%%'
order
by
t2
.
b
limit
0
,
1
;
DROP
TABLE
t1
,
t2
,
t3
;
# End of 4.1 tests
#
...
...
sql/opt_range.cc
View file @
abd73446
...
...
@@ -81,7 +81,7 @@ public:
uint8
min_flag
,
uint8
max_flag
,
uint8
maybe_flag
);
SEL_ARG
(
enum
Type
type_arg
)
:
elements
(
1
),
use_count
(
1
),
left
(
0
),
next_key_part
(
0
),
color
(
BLACK
),
type
(
type_arg
)
type
(
type_arg
)
,
min_flag
(
0
)
{}
inline
bool
is_same
(
SEL_ARG
*
arg
)
{
...
...
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