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
2620ca4c
Commit
2620ca4c
authored
Oct 17, 2000
by
monty@donna.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for automatic repair
parent
7ec310f1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
18 deletions
+32
-18
Docs/manual.texi
Docs/manual.texi
+5
-2
myisam/mi_check.c
myisam/mi_check.c
+2
-1
myisam/myisamdef.h
myisam/myisamdef.h
+4
-3
sql/ha_myisam.cc
sql/ha_myisam.cc
+17
-12
sql/sql_base.cc
sql/sql_base.cc
+4
-0
No files found.
Docs/manual.texi
View file @
2620ca4c
...
...
@@ -16319,7 +16319,8 @@ Version 3.22. @code{ADDDATE()} and @code{SUBDATE()} are synonyms for
@code{DATE_ADD()} and @code{DATE_SUB()}.
In @strong{MySQL} Version 3.23, you can use @code{+} and @code{-} instead of
@code{DATE_ADD()} and @code{DATE_SUB()}. (See example)
@code{DATE_ADD()} and @code{DATE_SUB()} if the expression on the right side is
a date or datetime column. (See example)
@code{date} is a @code{DATETIME} or @code{DATE} value specifying the starting
date. @code{expr} is an expression specifying the interval value to be added
...
...
@@ -20221,7 +20222,9 @@ this join type is good.
@item range
Only rows that are in a given range will be retrieved, using an index to
select the rows. The @code{ref} column indicates which index is used.
select the rows. The @code{key} column indicates which index is used.
The @code{key_len} contains the longest key part that was used.
The @code{ref} column will be NULL for this type.
@item index
This is the same as @code{ALL}, except that only the index tree is
myisam/mi_check.c
View file @
2620ca4c
...
...
@@ -504,7 +504,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if
(
used_length
>
keyinfo
->
block_length
)
{
mi_check_print_error
(
param
,
"Wrong pageinfo at page: %s"
,
llstr
(
page
,
llbuff
));
mi_check_print_error
(
param
,
"Wrong pageinfo at page: %s"
,
llstr
(
page
,
llbuff
));
goto
err
;
}
for
(
;;
)
...
...
myisam/myisamdef.h
View file @
2620ca4c
...
...
@@ -575,6 +575,10 @@ enum myisam_log_commands {
#define myisam_log_command(a,b,c,d,e) if (myisam_log_file >= 0) _myisam_log_command(a,b,c,d,e)
#define myisam_log_record(a,b,c,d,e) if (myisam_log_file >= 0) _myisam_log_record(a,b,c,d,e)
#ifdef __cplusplus
extern
"C"
{
#endif
extern
uint
_mi_get_block_info
(
MI_BLOCK_INFO
*
,
File
,
my_off_t
);
extern
uint
_mi_rec_pack
(
MI_INFO
*
info
,
byte
*
to
,
const
byte
*
from
);
extern
uint
_mi_pack_get_block_info
(
MI_INFO
*
mysql
,
MI_BLOCK_INFO
*
,
File
,
...
...
@@ -630,9 +634,6 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share);
int
mi_open_keyfile
(
MYISAM_SHARE
*
share
);
/* Functions needed by mi_check */
#ifdef __cplusplus
extern
"C"
{
#endif
void
mi_check_print_error
_VARARGS
((
MI_CHECK
*
param
,
const
char
*
fmt
,...));
void
mi_check_print_warning
_VARARGS
((
MI_CHECK
*
param
,
const
char
*
fmt
,...));
void
mi_check_print_info
_VARARGS
((
MI_CHECK
*
param
,
const
char
*
fmt
,...));
...
...
sql/ha_myisam.cc
View file @
2620ca4c
...
...
@@ -57,6 +57,8 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
my_vsnprintf
(
msgbuf
,
sizeof
(
msgbuf
),
fmt
,
args
);
msgbuf
[
sizeof
(
msgbuf
)
-
1
]
=
0
;
// healthy paranoia
DBUG_PRINT
(
msg_type
,(
"message: %s"
,
msgbuf
));
if
(
thd
->
net
.
vio
==
0
)
{
sql_print_error
(
msgbuf
);
...
...
@@ -413,8 +415,8 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
myisamchk_init
(
&
param
);
param
.
thd
=
thd
;
param
.
op_name
=
(
char
*
)
"repair"
;
param
.
testflag
=
(
check_opt
->
flags
|
T_SILENT
|
T_FORCE_CREATE
|
T_REP_BY_SORT
);
param
.
testflag
=
(
(
check_opt
->
flags
|
T_SILENT
|
T_FORCE_CREATE
)
|
(
check_opt
->
flags
&
T_EXTEND
?
T_REP
:
T_REP_BY_SORT
)
);
if
(
check_opt
->
quick
)
param
.
opt_rep_quick
++
;
param
.
sort_buffer_length
=
check_opt
->
sort_buffer_size
;
...
...
@@ -429,8 +431,8 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
}
if
((
param
.
testflag
&
T_REP_BY_SORT
))
{
param
.
testflag
=
(
param
.
testflag
&
~
T_REP_BY_SORT
)
|
T_REP
;
sql_print_error
(
"Warning: Retrying recover of: %s with
safe repair
"
,
param
.
testflag
=
(
param
.
testflag
&
~
T_REP_BY_SORT
)
|
T_REP
;
sql_print_error
(
"Warning: Retrying recover of: %s with
keycache
"
,
table
->
path
);
continue
;
}
...
...
@@ -463,13 +465,14 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
char
fixed_name
[
FN_REFLEN
];
const
char
*
old_proc_info
=
thd
->
proc_info
;
MYISAM_SHARE
*
share
=
file
->
s
;
DBUG_ENTER
(
"ha_myisam::repair"
);
param
.
table_name
=
table
->
table_name
;
param
.
tmpfile_createflag
=
O_RDWR
|
O_TRUNC
;
param
.
using_global_keycache
=
1
;
param
.
thd
=
thd
;
param
.
tmpdir
=
mysql_tmpdir
;
param
.
out_flag
=
0
;
VOID
(
fn_format
(
fixed_name
,
file
->
filename
,
""
,
MI_NAME_IEXT
,
4
+
(
param
.
opt_follow_links
?
16
:
0
)));
...
...
@@ -479,15 +482,16 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
!
(
share
->
state
.
changed
&
STATE_NOT_OPTIMIZED_KEYS
))))
{
optimize_done
=
1
;
if
(
mi_test_if_sort_rep
(
file
,
file
->
state
->
records
,
0
))
if
(
mi_test_if_sort_rep
(
file
,
file
->
state
->
records
,
0
)
&&
(
param
.
testflag
&
T_REP_BY_SORT
))
{
param
.
testflag
|=
T_STATISTICS
;
// We get this for free
thd
->
proc_info
=
"Repair
ing
by sorting"
;
thd
->
proc_info
=
"Repair by sorting"
;
error
=
mi_repair_by_sort
(
&
param
,
file
,
fixed_name
,
param
.
opt_rep_quick
);
}
else
{
thd
->
proc_info
=
"Repair
ing
"
;
thd
->
proc_info
=
"Repair
with keycache
"
;
error
=
mi_repair
(
&
param
,
file
,
fixed_name
,
param
.
opt_rep_quick
);
}
}
...
...
@@ -558,8 +562,9 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
}
if
(
param
.
out_flag
&
O_NEW_DATA
)
error
|=
change_to_newfile
(
fixed_name
,
MI_NAME_DEXT
,
DATA_TMP_EXT
,
0
,
MYF
(
0
));
DATA_TMP_EXT
,
0
,
(
param
.
testflag
&
T_BACKUP_DATA
?
MYF
(
MY_REDEL_MAKE_BACKUP
)
:
MYF
(
0
)));
if
(
param
.
out_flag
&
O_NEW_INDEX
)
error
|=
change_to_newfile
(
fixed_name
,
MI_NAME_IEXT
,
INDEX_TMP_EXT
,
0
,
MYF
(
0
));
...
...
@@ -574,8 +579,8 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize)
}
}
thd
->
proc_info
=
old_proc_info
;
return
(
error
?
HA_ADMIN_FAILED
:
!
optimize_done
?
HA_ADMIN_ALREADY_DONE
:
HA_ADMIN_OK
);
DBUG_RETURN
(
error
?
HA_ADMIN_FAILED
:
!
optimize_done
?
HA_ADMIN_ALREADY_DONE
:
HA_ADMIN_OK
);
}
...
...
sql/sql_base.cc
View file @
2620ca4c
...
...
@@ -1165,6 +1165,10 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
entry
)
||
(
entry
->
file
->
is_crashed
()
&&
entry
->
file
->
check_and_repair
(
thd
)))
{
/* Give right error message */
thd
->
net
.
last_error
[
0
]
=
0
;
thd
->
net
.
last_errno
=
0
;
entry
->
file
->
print_error
(
HA_ERR_CRASHED
,
MYF
(
0
));
sql_print_error
(
"Error: Couldn't repair table: %s.%s"
,
db
,
name
);
closefrm
(
entry
);
error
=
1
;
...
...
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