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
4d49175f
Commit
4d49175f
authored
Mar 21, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
1be42956
fb2501e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
179 additions
and
0 deletions
+179
-0
mysql-test/r/merge.result
mysql-test/r/merge.result
+130
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+35
-0
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/ha_myisammrg.cc
+14
-0
No files found.
mysql-test/r/merge.result
View file @
4d49175f
...
...
@@ -2369,3 +2369,133 @@ ERROR HY000: Can't reopen table: 'm1'
UNLOCK TABLES;
DROP TABLE t1, t2, t3, m1;
End of 5.1 tests
#
# MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
#
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 ( i int ) engine=myisam;
insert into t2 values (1),(2);
create table t3 (a int, b int, filler char(100), key(a), key(b)) engine=myisam;
create table t4 like t3;
insert into t3
select A.a+10*B.a+100*C.a,
A.a+10*B.a+100*C.a,
'filler-data-FILLER-DATA-qqq'
from t1 A, t1 B, t1 C where C.a < 5;
insert into t4
select A.a+10*B.a+100*C.a,
A.a+10*B.a+100*C.a,
'filler-data-FILLER-DATA-qqq'
from t1 A, t1 B, t1 C where C.a >= 5;
create table t5 like t3;
alter table t5 engine=merge;
alter table t5 union(t3, t4);
update t5 set b=999, a=999 where b>950;
explain
select * from t2, t5 where t5.a=999 and t5.b=999;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
1 SIMPLE t5 index_merge a,b a,b 5,5 NULL 6 Using intersect(a,b); Using where; Using join buffer (flat, BNL join)
select * from t2, t5 where t5.a=999 and t5.b=999;
i a b filler
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
1 999 999 filler-data-FILLER-DATA-qqq
2 999 999 filler-data-FILLER-DATA-qqq
drop table t5;
drop table t1,t2,t3,t4;
mysql-test/t/merge.test
View file @
4d49175f
...
...
@@ -1865,6 +1865,41 @@ DROP TABLE t1, t2, t3, m1;
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
--
echo
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t2
(
i
int
)
engine
=
myisam
;
insert
into
t2
values
(
1
),(
2
);
create
table
t3
(
a
int
,
b
int
,
filler
char
(
100
),
key
(
a
),
key
(
b
))
engine
=
myisam
;
create
table
t4
like
t3
;
insert
into
t3
select
A
.
a
+
10
*
B
.
a
+
100
*
C
.
a
,
A
.
a
+
10
*
B
.
a
+
100
*
C
.
a
,
'filler-data-FILLER-DATA-qqq'
from
t1
A
,
t1
B
,
t1
C
where
C
.
a
<
5
;
insert
into
t4
select
A
.
a
+
10
*
B
.
a
+
100
*
C
.
a
,
A
.
a
+
10
*
B
.
a
+
100
*
C
.
a
,
'filler-data-FILLER-DATA-qqq'
from
t1
A
,
t1
B
,
t1
C
where
C
.
a
>=
5
;
create
table
t5
like
t3
;
alter
table
t5
engine
=
merge
;
alter
table
t5
union
(
t3
,
t4
);
update
t5
set
b
=
999
,
a
=
999
where
b
>
950
;
explain
select
*
from
t2
,
t5
where
t5
.
a
=
999
and
t5
.
b
=
999
;
select
*
from
t2
,
t5
where
t5
.
a
=
999
and
t5
.
b
=
999
;
drop
table
t5
;
drop
table
t1
,
t2
,
t3
,
t4
;
--
disable_result_log
--
disable_query_log
eval
set
global
storage_engine
=
$default
;
...
...
storage/myisammrg/ha_myisammrg.cc
View file @
4d49175f
...
...
@@ -422,6 +422,19 @@ static MI_INFO *myisammrg_attach_children_callback(void *callback_param)
DBUG_RETURN
(
my_errno
?
NULL
:
myisam
);
}
/*
Set external_ref for the child MyISAM tables. They need this to be set in
order to check for killed status.
*/
static
void
myrg_set_external_ref
(
MYRG_INFO
*
m_info
,
void
*
ext_ref_arg
)
{
int
i
;
for
(
i
=
0
;
i
<
(
int
)
m_info
->
tables
;
i
++
)
{
m_info
->
open_tables
[
i
].
table
->
external_ref
=
ext_ref_arg
;
}
}
/**
@brief Open a MERGE parent table, not its children.
...
...
@@ -467,6 +480,7 @@ int ha_myisammrg::open(const char *name, int mode __attribute__((unused)),
}
file
->
children_attached
=
TRUE
;
myrg_set_external_ref
(
file
,
(
void
*
)
table
);
info
(
HA_STATUS_NO_LOCK
|
HA_STATUS_VARIABLE
|
HA_STATUS_CONST
);
}
...
...
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