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
8d0b9a8d
Commit
8d0b9a8d
authored
Mar 26, 2010
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG51868 to mysql-5.1-bugteam.
parents
0d1c997d
356d0754
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
8 deletions
+55
-8
mysql-test/r/partition.result
mysql-test/r/partition.result
+11
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+13
-0
storage/myisam/mi_delete_all.c
storage/myisam/mi_delete_all.c
+1
-1
storage/myisam/mi_dynrec.c
storage/myisam/mi_dynrec.c
+29
-2
storage/myisam/mi_extra.c
storage/myisam/mi_extra.c
+0
-5
storage/myisam/myisamdef.h
storage/myisam/myisamdef.h
+1
-0
No files found.
mysql-test/r/partition.result
View file @
8d0b9a8d
...
...
@@ -2088,4 +2088,15 @@ SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
1
1
DROP TABLE t1;
#
# BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables
#
SET GLOBAL myisam_use_mmap=1;
CREATE TABLE t1(a INT) PARTITION BY HASH(a) PARTITIONS 1;
INSERT INTO t1 VALUES(0);
FLUSH TABLE t1;
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES(0);
DROP TABLE t1;
SET GLOBAL myisam_use_mmap=default;
End of 5.1 tests
mysql-test/t/partition.test
View file @
8d0b9a8d
...
...
@@ -2081,4 +2081,17 @@ INSERT INTO t1 VALUES (6,8,10);
SELECT
1
FROM
t1
JOIN
t1
AS
t2
USING
(
a
)
FOR
UPDATE
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables
--
echo
#
SET
GLOBAL
myisam_use_mmap
=
1
;
CREATE
TABLE
t1
(
a
INT
)
PARTITION
BY
HASH
(
a
)
PARTITIONS
1
;
INSERT
INTO
t1
VALUES
(
0
);
FLUSH
TABLE
t1
;
TRUNCATE
TABLE
t1
;
INSERT
INTO
t1
VALUES
(
0
);
DROP
TABLE
t1
;
SET
GLOBAL
myisam_use_mmap
=
default
;
--
echo
End
of
5.1
tests
storage/myisam/mi_delete_all.c
View file @
8d0b9a8d
...
...
@@ -55,7 +55,7 @@ int mi_delete_all_rows(MI_INFO *info)
flush_key_blocks
(
share
->
key_cache
,
share
->
kfile
,
FLUSH_IGNORE_CHANGED
);
#ifdef HAVE_MMAP
if
(
share
->
file_map
)
_mi_
unmap_file
(
info
);
mi_m
unmap_file
(
info
);
#endif
if
(
my_chsize
(
info
->
dfile
,
0
,
0
,
MYF
(
MY_WME
))
||
my_chsize
(
share
->
kfile
,
share
->
base
.
keystart
,
0
,
MYF
(
MY_WME
))
)
...
...
storage/myisam/mi_dynrec.c
View file @
8d0b9a8d
...
...
@@ -94,6 +94,34 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
madvise
((
char
*
)
info
->
s
->
file_map
,
size
,
MADV_RANDOM
);
#endif
info
->
s
->
mmaped_length
=
size
;
info
->
s
->
file_read
=
mi_mmap_pread
;
info
->
s
->
file_write
=
mi_mmap_pwrite
;
DBUG_RETURN
(
0
);
}
/*
Destroy mmaped area for MyISAM handler
SYNOPSIS
mi_munmap_file()
info MyISAM handler
RETURN
0 ok
!0 error.
*/
int
mi_munmap_file
(
MI_INFO
*
info
)
{
int
ret
;
DBUG_ENTER
(
"mi_unmap_file"
);
if
((
ret
=
my_munmap
(
info
->
s
->
file_map
,
info
->
s
->
mmaped_length
)))
DBUG_RETURN
(
ret
);
info
->
s
->
file_read
=
mi_nommap_pread
;
info
->
s
->
file_write
=
mi_nommap_pwrite
;
info
->
s
->
file_map
=
0
;
info
->
s
->
mmaped_length
=
0
;
DBUG_RETURN
(
0
);
}
...
...
@@ -112,8 +140,7 @@ void mi_remap_file(MI_INFO *info, my_off_t size)
{
if
(
info
->
s
->
file_map
)
{
VOID
(
my_munmap
((
char
*
)
info
->
s
->
file_map
,
(
size_t
)
info
->
s
->
mmaped_length
));
mi_munmap_file
(
info
);
mi_dynmap_file
(
info
,
size
);
}
}
...
...
storage/myisam/mi_extra.c
View file @
8d0b9a8d
...
...
@@ -364,11 +364,6 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
DBUG_PRINT
(
"warning"
,(
"mmap failed: errno: %d"
,
errno
));
error
=
my_errno
=
errno
;
}
else
{
share
->
file_read
=
mi_mmap_pread
;
share
->
file_write
=
mi_mmap_pwrite
;
}
}
pthread_mutex_unlock
(
&
share
->
intern_lock
);
#endif
...
...
storage/myisam/myisamdef.h
View file @
8d0b9a8d
...
...
@@ -762,6 +762,7 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name,
int
mi_open_keyfile
(
MYISAM_SHARE
*
share
);
void
mi_setup_functions
(
register
MYISAM_SHARE
*
share
);
my_bool
mi_dynmap_file
(
MI_INFO
*
info
,
my_off_t
size
);
int
mi_munmap_file
(
MI_INFO
*
info
);
void
mi_remap_file
(
MI_INFO
*
info
,
my_off_t
size
);
/* Functions needed by mi_check */
...
...
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