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
ccd019dd
Commit
ccd019dd
authored
Oct 21, 2011
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
e0293711
3e0491c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
5 deletions
+58
-5
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+24
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+18
-0
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+16
-0
storage/myisam/mi_delete_all.c
storage/myisam/mi_delete_all.c
+0
-5
No files found.
mysql-test/r/myisam.result
View file @
ccd019dd
...
@@ -2412,4 +2412,28 @@ CARDINALITY
...
@@ -2412,4 +2412,28 @@ CARDINALITY
DROP TABLE t1;
DROP TABLE t1;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
SET myisam_repair_threads=@@global.myisam_repair_threads;
SET myisam_repair_threads=@@global.myisam_repair_threads;
#
# BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
#
USING MYISAM_USE_MMAP ON WINDOWS
#
SET GLOBAL myisam_use_mmap=1;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1),(2);
DELETE FROM t1 WHERE a=1;
FLUSH TABLE t1;
LOCK TABLE t1 WRITE;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
INSERT INTO t1 VALUES(3);
UNLOCK TABLES;
SELECT * FROM t1;
a
2
3
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET GLOBAL myisam_use_mmap=default;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/myisam.test
View file @
ccd019dd
...
@@ -1645,4 +1645,22 @@ DROP TABLE t1;
...
@@ -1645,4 +1645,22 @@ DROP TABLE t1;
SET
myisam_sort_buffer_size
=@@
global
.
myisam_sort_buffer_size
;
SET
myisam_sort_buffer_size
=@@
global
.
myisam_sort_buffer_size
;
SET
myisam_repair_threads
=@@
global
.
myisam_repair_threads
;
SET
myisam_repair_threads
=@@
global
.
myisam_repair_threads
;
--
echo
#
--
echo
# BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
--
echo
# USING MYISAM_USE_MMAP ON WINDOWS
--
echo
#
SET
GLOBAL
myisam_use_mmap
=
1
;
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
DELETE
FROM
t1
WHERE
a
=
1
;
FLUSH
TABLE
t1
;
LOCK
TABLE
t1
WRITE
;
OPTIMIZE
TABLE
t1
;
INSERT
INTO
t1
VALUES
(
3
);
UNLOCK
TABLES
;
SELECT
*
FROM
t1
;
CHECK
TABLE
t1
;
DROP
TABLE
t1
;
SET
GLOBAL
myisam_use_mmap
=
default
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
storage/myisam/ha_myisam.cc
View file @
ccd019dd
...
@@ -1135,6 +1135,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
...
@@ -1135,6 +1135,18 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
mi_get_mask_all_keys_active
(
share
->
base
.
keys
)
:
mi_get_mask_all_keys_active
(
share
->
base
.
keys
)
:
share
->
state
.
key_map
);
share
->
state
.
key_map
);
uint
testflag
=
param
.
testflag
;
uint
testflag
=
param
.
testflag
;
#ifdef HAVE_MMAP
bool
remap
=
test
(
share
->
file_map
);
/*
mi_repair*() functions family use file I/O even if memory
mapping is available.
Since mixing mmap I/O and file I/O may cause various artifacts,
memory mapping must be disabled.
*/
if
(
remap
)
mi_munmap_file
(
file
);
#endif
if
(
mi_test_if_sort_rep
(
file
,
file
->
state
->
records
,
key_map
,
0
)
&&
if
(
mi_test_if_sort_rep
(
file
,
file
->
state
->
records
,
key_map
,
0
)
&&
(
local_testflag
&
T_REP_BY_SORT
))
(
local_testflag
&
T_REP_BY_SORT
))
{
{
...
@@ -1166,6 +1178,10 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
...
@@ -1166,6 +1178,10 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
error
=
mi_repair
(
&
param
,
file
,
fixed_name
,
error
=
mi_repair
(
&
param
,
file
,
fixed_name
,
param
.
testflag
&
T_QUICK
);
param
.
testflag
&
T_QUICK
);
}
}
#ifdef HAVE_MMAP
if
(
remap
)
mi_dynmap_file
(
file
,
file
->
state
->
data_file_length
);
#endif
param
.
testflag
=
testflag
;
param
.
testflag
=
testflag
;
optimize_done
=
1
;
optimize_done
=
1
;
}
}
...
...
storage/myisam/mi_delete_all.c
View file @
ccd019dd
...
@@ -63,11 +63,6 @@ int mi_delete_all_rows(MI_INFO *info)
...
@@ -63,11 +63,6 @@ int mi_delete_all_rows(MI_INFO *info)
my_chsize
(
share
->
kfile
,
share
->
base
.
keystart
,
0
,
MYF
(
MY_WME
))
)
my_chsize
(
share
->
kfile
,
share
->
base
.
keystart
,
0
,
MYF
(
MY_WME
))
)
goto
err
;
goto
err
;
VOID
(
_mi_writeinfo
(
info
,
WRITEINFO_UPDATE_KEYFILE
));
VOID
(
_mi_writeinfo
(
info
,
WRITEINFO_UPDATE_KEYFILE
));
#ifdef HAVE_MMAP
/* Map again */
if
(
share
->
file_map
)
mi_dynmap_file
(
info
,
(
my_off_t
)
0
);
#endif
allow_break
();
/* Allow SIGHUP & SIGINT */
allow_break
();
/* Allow SIGHUP & SIGINT */
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
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