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
ff485672
Commit
ff485672
authored
Oct 09, 2009
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG47073.
parents
5e0f9604
858713ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
20 deletions
+66
-20
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+28
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+28
-0
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+0
-16
storage/myisam/mi_check.c
storage/myisam/mi_check.c
+6
-4
storage/myisam/sort.c
storage/myisam/sort.c
+4
-0
No files found.
mysql-test/r/myisam.result
View file @
ff485672
...
...
@@ -2271,4 +2271,32 @@ checksum table t3;
Table Checksum
test.t3 326284887
drop table t1,t2,t3;
CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b));
INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
(6,'0'),(7,'0');
INSERT INTO t1 SELECT a+10,b FROM t1;
INSERT INTO t1 SELECT a+20,b FROM t1;
INSERT INTO t1 SELECT a+40,b FROM t1;
INSERT INTO t1 SELECT a+80,b FROM t1;
INSERT INTO t1 SELECT a+160,b FROM t1;
INSERT INTO t1 SELECT a+320,b FROM t1;
INSERT INTO t1 SELECT a+640,b FROM t1;
INSERT INTO t1 SELECT a+1280,b FROM t1;
INSERT INTO t1 SELECT a+2560,b FROM t1;
INSERT INTO t1 SELECT a+5120,b FROM t1;
SET myisam_sort_buffer_size=4;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair error myisam_sort_buffer_size is too small
test.t1 repair warning Number of rows changed from 0 to 7168
test.t1 repair status OK
SET myisam_repair_threads=2;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair error myisam_sort_buffer_size is too small
test.t1 repair warning Number of rows changed from # to 7168
test.t1 repair status OK
SET myisam_repair_threads=@@global.myisam_repair_threads;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/myisam.test
View file @
ff485672
...
...
@@ -1518,5 +1518,33 @@ CREATE TABLE t3 select * from t1;
checksum
table
t3
;
drop
table
t1
,
t2
,
t3
;
#
# BUG#47073 - valgrind errs, corruption,failed repair of partition,
# low myisam_sort_buffer_size
#
CREATE
TABLE
t1
(
a
INT
,
b
CHAR
(
10
),
KEY
(
a
),
KEY
(
b
));
INSERT
INTO
t1
VALUES
(
1
,
'0'
),(
2
,
'0'
),(
3
,
'0'
),(
4
,
'0'
),(
5
,
'0'
),
(
6
,
'0'
),(
7
,
'0'
);
INSERT
INTO
t1
SELECT
a
+
10
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
20
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
40
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
80
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
160
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
320
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
640
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
1280
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
2560
,
b
FROM
t1
;
INSERT
INTO
t1
SELECT
a
+
5120
,
b
FROM
t1
;
SET
myisam_sort_buffer_size
=
4
;
REPAIR
TABLE
t1
;
SET
myisam_repair_threads
=
2
;
# May report different values depending on threads activity.
--
replace_regex
/
changed
from
[
0
-
9
]
+/
changed
from
#/
REPAIR
TABLE
t1
;
SET
myisam_repair_threads
=@@
global
.
myisam_repair_threads
;
SET
myisam_sort_buffer_size
=@@
global
.
myisam_sort_buffer_size
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
storage/myisam/ha_myisam.cc
View file @
ff485672
...
...
@@ -1087,22 +1087,6 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize)
ha_rows
rows
=
file
->
state
->
records
;
DBUG_ENTER
(
"ha_myisam::repair"
);
/*
Normally this method is entered with a properly opened table. If the
repair fails, it can be repeated with more elaborate options. Under
special circumstances it can happen that a repair fails so that it
closed the data file and cannot re-open it. In this case file->dfile
is set to -1. We must not try another repair without an open data
file. (Bug #25289)
*/
if
(
file
->
dfile
==
-
1
)
{
sql_print_information
(
"Retrying repair of: '%s' failed. "
"Please try REPAIR EXTENDED or myisamchk"
,
table
->
s
->
path
.
str
);
DBUG_RETURN
(
HA_ADMIN_FAILED
);
}
param
.
db_name
=
table
->
s
->
db
.
str
;
param
.
table_name
=
table
->
alias
;
param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
;
...
...
storage/myisam/mi_check.c
View file @
ff485672
...
...
@@ -2561,8 +2561,9 @@ err:
VOID
(
my_close
(
new_file
,
MYF
(
0
)));
VOID
(
my_raid_delete
(
param
->
temp_filename
,
share
->
base
.
raid_chunks
,
MYF
(
MY_WME
)));
if
(
info
->
dfile
==
new_file
)
info
->
dfile
=
-
1
;
if
(
info
->
dfile
==
new_file
)
/* Retry with key cache */
if
(
unlikely
(
mi_open_datafile
(
info
,
share
,
name
,
-
1
)))
param
->
retry_repair
=
0
;
/* Safety */
}
mi_mark_crashed_on_repair
(
info
);
}
...
...
@@ -3095,8 +3096,9 @@ err:
VOID
(
my_close
(
new_file
,
MYF
(
0
)));
VOID
(
my_raid_delete
(
param
->
temp_filename
,
share
->
base
.
raid_chunks
,
MYF
(
MY_WME
)));
if
(
info
->
dfile
==
new_file
)
info
->
dfile
=
-
1
;
if
(
info
->
dfile
==
new_file
)
/* Retry with key cache */
if
(
unlikely
(
mi_open_datafile
(
info
,
share
,
name
,
-
1
)))
param
->
retry_repair
=
0
;
/* Safety */
}
mi_mark_crashed_on_repair
(
info
);
}
...
...
storage/myisam/sort.c
View file @
ff485672
...
...
@@ -788,7 +788,11 @@ static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
cleanup:
close_cached_file
(
to_file
);
/* This holds old result */
if
(
to_file
==
t_file
)
{
*
t_file
=
t_file2
;
/* Copy result file */
t_file
->
current_pos
=
&
t_file
->
write_pos
;
t_file
->
current_end
=
&
t_file
->
write_end
;
}
DBUG_RETURN
(
*
maxbuffer
>=
MERGEBUFF2
);
/* Return 1 if interrupted */
}
/* merge_many_buff */
...
...
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