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
155eb465
Commit
155eb465
authored
Jul 18, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5.0-opt -> 5.1-opt merge
parent
c9b88730
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
2 deletions
+63
-2
mysql-test/r/index_merge_myisam.result
mysql-test/r/index_merge_myisam.result
+61
-0
storage/heap/ha_heap.cc
storage/heap/ha_heap.cc
+2
-2
No files found.
mysql-test/r/index_merge_myisam.result
View file @
155eb465
...
...
@@ -457,6 +457,67 @@ a
1
UNLOCK TABLES;
DROP TABLE t1, t2;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`filler` char(200) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
KEY `a` (`a`),
KEY `b` (`b`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
insert into t1 values
(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3),
(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7),
(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1),
(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5),
(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9),
(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13),
(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17),
(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0),
(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4);
create table t2(
`a` int(11) DEFAULT NULL,
`filler` char(200) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
KEY USING BTREE (`a`),
KEY USING BTREE (`b`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
insert into t2 select * from t1;
must use sort-union rather than union:
explain select * from t1 where a=4 or b=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL # Using sort_union(a,b); Using where
select * from t1 where a=4 or b=4;
a filler b
4 4 0
4 5 0
4 filler 4
4 filler 4
4 qq 5
4 zz 4
5 qq 4
select * from t1 ignore index(a,b) where a=4 or b=4;
a filler b
4 4 0
4 5 0
4 filler 4
4 filler 4
4 qq 5
4 zz 4
5 qq 4
must use union, not sort-union:
explain select * from t2 where a=4 or b=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index_merge a,b a,b 5,5 NULL # Using union(a,b); Using where
select * from t2 where a=4 or b=4;
a filler b
4 4 0
4 5 0
4 filler 4
4 filler 4
4 qq 5
4 zz 4
5 qq 4
drop table t1, t2;
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t0,t1,t2;
...
...
storage/heap/ha_heap.cc
View file @
155eb465
...
...
@@ -136,8 +136,8 @@ int ha_heap::close(void)
handler
*
ha_heap
::
clone
(
MEM_ROOT
*
mem_root
)
{
handler
*
new_handler
=
get_new_handler
(
table
,
mem_root
,
table
->
s
->
db_type
);
if
(
new_handler
&&
!
new_handler
->
ha_open
(
file
->
s
->
name
,
table
->
db_stat
,
handler
*
new_handler
=
get_new_handler
(
table
->
s
,
mem_root
,
table
->
s
->
db_type
()
);
if
(
new_handler
&&
!
new_handler
->
ha_open
(
table
,
file
->
s
->
name
,
table
->
db_stat
,
HA_OPEN_IGNORE_IF_LOCKED
))
return
new_handler
;
return
NULL
;
/* purecov: inspected */
...
...
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