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
ef535ac8
Commit
ef535ac8
authored
Aug 27, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.1
into moonbone.local:/work/tmp_merge-5.1-opt-mysql
parents
43dbfa66
959363b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
7 deletions
+67
-7
mysql-test/r/index_merge_innodb.result
mysql-test/r/index_merge_innodb.result
+40
-0
mysql-test/t/index_merge_innodb.test
mysql-test/t/index_merge_innodb.test
+27
-0
sql/opt_range.cc
sql/opt_range.cc
+0
-7
No files found.
mysql-test/r/index_merge_innodb.result
View file @
ef535ac8
...
...
@@ -282,3 +282,43 @@ kp1='279' AND kp2='ELM0678' AND kp3='6' AND kp4='10' AND kp5 = 'R ';
COUNT(*)
1
drop table t1;
create table t1
(
key1 int not null,
key2 int not null default 0,
key3 int not null default 0
);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
set @d=8;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 11 Using sort_union(i3,i2); Using where
select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
key1 key2 key3
31 31 31
32 32 32
33 33 33
34 34 34
35 35 35
36 36 36
37 37 37
38 38 38
39 39 39
drop table t1;
mysql-test/t/index_merge_innodb.test
View file @
ef535ac8
...
...
@@ -299,4 +299,31 @@ SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND
drop
table
t1
;
# BUG#21277: Index Merge/sort_union: wrong query results
create
table
t1
(
key1
int
not
null
,
key2
int
not
null
default
0
,
key3
int
not
null
default
0
);
insert
into
t1
(
key1
)
values
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
);
let
$
1
=
7
;
set
@
d
=
8
;
while
(
$
1
)
{
eval
insert
into
t1
(
key1
)
select
key1
+@
d
from
t1
;
eval
set
@
d
=@
d
*
2
;
dec
$
1
;
}
alter
table
t1
add
index
i2
(
key2
);
alter
table
t1
add
index
i3
(
key3
);
update
t1
set
key2
=
key1
,
key3
=
key1
;
# to test the bug, the following must use "sort_union":
explain
select
*
from
t1
where
(
key3
>
30
and
key3
<
35
)
or
(
key2
>
32
and
key2
<
40
);
select
*
from
t1
where
(
key3
>
30
and
key3
<
35
)
or
(
key2
>
32
and
key2
<
40
);
drop
table
t1
;
sql/opt_range.cc
View file @
ef535ac8
...
...
@@ -7584,16 +7584,10 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
QUICK_RANGE_SELECT
*
cur_quick
;
int
result
;
Unique
*
unique
;
MY_BITMAP
*
save_read_set
,
*
save_write_set
;
handler
*
file
=
head
->
file
;
DBUG_ENTER
(
"QUICK_INDEX_MERGE_SELECT::read_keys_and_merge"
);
/* We're going to just read rowids. */
save_read_set
=
head
->
read_set
;
save_write_set
=
head
->
write_set
;
file
->
extra
(
HA_EXTRA_KEYREAD
);
bitmap_clear_all
(
&
head
->
tmp_set
);
head
->
column_bitmaps_set
(
&
head
->
tmp_set
,
&
head
->
tmp_set
);
head
->
prepare_for_position
();
cur_quick_it
.
rewind
();
...
...
@@ -7658,7 +7652,6 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
doing_pk_scan
=
FALSE
;
/* index_merge currently doesn't support "using index" at all */
file
->
extra
(
HA_EXTRA_NO_KEYREAD
);
head
->
column_bitmaps_set
(
save_read_set
,
save_write_set
);
/* start table scan */
init_read_record
(
&
read_record
,
thd
,
head
,
(
SQL_SELECT
*
)
0
,
1
,
1
);
DBUG_RETURN
(
result
);
...
...
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