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
68325b6a
Commit
68325b6a
authored
Aug 28, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test case for MyISAM and OPTIMIZE TABLE
that requires MDL_SHARED_NO_READ_WRITE.
parent
214c43ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
mysql-test/r/myisam_optimize.result
mysql-test/r/myisam_optimize.result
+23
-0
mysql-test/t/myisam_optimize.test
mysql-test/t/myisam_optimize.test
+47
-0
No files found.
mysql-test/r/myisam_optimize.result
0 → 100644
View file @
68325b6a
call mtr.add_suppression(" marked as crashed and should be repaired");
create table t1 (a int auto_increment primary key, b text);
insert t1 (b) select repeat("A", 100);
insert t1 (b) select repeat("B", 200) from t1;
insert t1 (b) select repeat("C", 300) from t1;
delete from t1 where a < 3;
explain select a, left(b,10) from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using filesort
select left(b,10), a from t1 order by a;
left(b,10) a
CCCCCCCCCC 3
CCCCCCCCCC 4
set debug_sync='myisam_after_repair_by_sort wait_for go';
optimize table t1;
select a, left(b,10) from t1 order by a;
set debug_sync='now signal go';
Table Op Msg_type Msg_text
test.t1 optimize status OK
a left(b,10)
3 CCCCCCCCCC
4 CCCCCCCCCC
drop table t1;
mysql-test/t/myisam_optimize.test
0 → 100644
View file @
68325b6a
#
# test OPTIMIZE and a concurrent SELECT of a MyISAM table
#
source
include
/
have_debug_sync
.
inc
;
call
mtr
.
add_suppression
(
" marked as crashed and should be repaired"
);
create
table
t1
(
a
int
auto_increment
primary
key
,
b
text
);
insert
t1
(
b
)
select
repeat
(
"A"
,
100
);
insert
t1
(
b
)
select
repeat
(
"B"
,
200
)
from
t1
;
insert
t1
(
b
)
select
repeat
(
"C"
,
300
)
from
t1
;
delete
from
t1
where
a
<
3
;
explain
select
a
,
left
(
b
,
10
)
from
t1
order
by
a
;
select
left
(
b
,
10
),
a
from
t1
order
by
a
;
set
debug_sync
=
'myisam_after_repair_by_sort wait_for go'
;
send
optimize
table
t1
;
connect
(
con1
,
localhost
,
root
,,);
let
$wait_condition
=
select
count
(
*
)
=
1
from
information_schema
.
processlist
where
state
like
"%myisam_after_repair_by_sort%"
;
--
source
include
/
wait_condition
.
inc
send
select
a
,
left
(
b
,
10
)
from
t1
order
by
a
;
connect
(
con2
,
localhost
,
root
,,);
let
$wait_condition
=
select
count
(
*
)
=
1
from
information_schema
.
processlist
where
state
=
"Waiting for table metadata lock"
;
--
source
include
/
wait_condition
.
inc
set
debug_sync
=
'now signal go'
;
connection
default
;
reap
;
connection
con1
;
reap
;
disconnect
con1
;
disconnect
con2
;
connection
default
;
drop
table
t1
;
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