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
7fdf7a41
Commit
7fdf7a41
authored
Mar 11, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
merge with 3.23 to get:
- Better detection of crashed .MYI file - Ignore writeable config files
parents
2c9a1687
c38125c5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
5 deletions
+34
-5
myisam/mi_open.c
myisam/mi_open.c
+16
-2
mysys/default.c
mysys/default.c
+17
-2
sql/mysqld.cc
sql/mysqld.cc
+1
-1
No files found.
myisam/mi_open.c
View file @
7fdf7a41
...
...
@@ -35,6 +35,14 @@ static void setup_key_functions(MI_KEYDEF *keyinfo);
pos+=size;}
#define disk_pos_assert(pos, end_pos) \
if (pos > end_pos) \
{ \
my_errno=HA_ERR_CRASHED; \
goto err; \
}
/******************************************************************************
** Return the shared struct if the table is already open.
** In MySQL the server will handle version issues.
...
...
@@ -70,7 +78,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
key_parts
,
unique_key_parts
,
tmp_length
,
uniques
;
char
name_buff
[
FN_REFLEN
],
org_name
[
FN_REFLEN
],
index_name
[
FN_REFLEN
],
data_name
[
FN_REFLEN
];
char
*
disk_cache
,
*
disk
_pos
;
char
*
disk_cache
,
*
disk_pos
,
*
end
_pos
;
MI_INFO
info
,
*
m_info
,
*
old_info
;
MYISAM_SHARE
share_buff
,
*
share
;
ulong
rec_per_key_part
[
MI_MAX_POSSIBLE_KEY
*
MI_MAX_KEY_SEG
];
...
...
@@ -138,11 +146,12 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
info_length
=
mi_uint2korr
(
share
->
state
.
header
.
header_length
);
base_pos
=
mi_uint2korr
(
share
->
state
.
header
.
base_pos
);
if
(
!
(
disk_cache
=
(
char
*
)
my_alloca
(
info_length
)))
if
(
!
(
disk_cache
=
(
char
*
)
my_alloca
(
info_length
+
128
)))
{
my_errno
=
ENOMEM
;
goto
err
;
}
end_pos
=
disk_cache
+
info_length
;
errpos
=
2
;
VOID
(
my_seek
(
kfile
,
0L
,
MY_SEEK_SET
,
MYF
(
0
)));
...
...
@@ -288,6 +297,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for
(
i
=
0
;
i
<
keys
;
i
++
)
{
disk_pos
=
mi_keydef_read
(
disk_pos
,
&
share
->
keyinfo
[
i
]);
disk_pos_assert
(
disk_pos
+
share
->
keyinfo
[
i
].
keysegs
*
MI_KEYSEG_SIZE
,
end_pos
);
set_if_smaller
(
share
->
blocksize
,
share
->
keyinfo
[
i
].
block_length
);
share
->
keyinfo
[
i
].
seg
=
pos
;
for
(
j
=
0
;
j
<
share
->
keyinfo
[
i
].
keysegs
;
j
++
,
pos
++
)
...
...
@@ -319,6 +330,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for
(
i
=
0
;
i
<
uniques
;
i
++
)
{
disk_pos
=
mi_uniquedef_read
(
disk_pos
,
&
share
->
uniqueinfo
[
i
]);
disk_pos_assert
(
disk_pos
+
share
->
uniqueinfo
[
i
].
keysegs
*
MI_KEYSEG_SIZE
,
end_pos
);
share
->
uniqueinfo
[
i
].
seg
=
pos
;
for
(
j
=
0
;
j
<
share
->
uniqueinfo
[
i
].
keysegs
;
j
++
,
pos
++
)
{
...
...
@@ -344,6 +357,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
for
(
i
=
0
;
i
<
keys
;
i
++
)
setup_key_functions
(
share
->
keyinfo
+
i
);
disk_pos_assert
(
disk_pos
+
share
->
base
.
fields
*
MI_COLUMNDEF_SIZE
,
end_pos
);
for
(
i
=
j
=
offset
=
0
;
i
<
share
->
base
.
fields
;
i
++
)
{
disk_pos
=
mi_recinfo_read
(
disk_pos
,
&
share
->
rec
[
i
]);
...
...
mysys/default.c
View file @
7fdf7a41
...
...
@@ -38,6 +38,7 @@
#include "mysys_priv.h"
#include "m_string.h"
#include "m_ctype.h"
#include <my_dir.h>
char
*
defaults_extra_file
=
0
;
...
...
@@ -67,7 +68,7 @@ NullS,
#define windows_ext ".ini"
#endif
static
my_bool
search_default_file
(
DYNAMIC_ARRAY
*
args
,
MEM_ROOT
*
alloc
,
static
my_bool
search_default_file
(
DYNAMIC_ARRAY
*
args
,
MEM_ROOT
*
alloc
,
const
char
*
dir
,
const
char
*
config_file
,
const
char
*
ext
,
TYPELIB
*
group
);
...
...
@@ -242,6 +243,20 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
{
strmov
(
name
,
config_file
);
}
fn_format
(
name
,
name
,
""
,
""
,
4
);
#if !defined(__WIN__) && !defined(OS2)
{
MY_STAT
stat_info
;
if
(
!
my_stat
(
name
,
&
stat_info
,
MYF
(
0
)))
return
0
;
if
(
stat_info
.
st_mode
&
S_IWOTH
)
/* ignore world-writeable files */
{
fprintf
(
stderr
,
"warning: World-writeable config file %s is ignored
\n
"
,
name
);
return
0
;
}
}
#endif
if
(
!
(
fp
=
my_fopen
(
fn_format
(
name
,
name
,
""
,
""
,
4
),
O_RDONLY
,
MYF
(
0
))))
return
0
;
/* Ignore wrong files */
...
...
sql/mysqld.cc
View file @
7fdf7a41
...
...
@@ -4225,7 +4225,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if
(
!
mysqld_user
)
mysqld_user
=
argument
;
else
fprintf
(
stderr
,
"Warning: Ignoring user change to '%s' beca
sue the user i
s set to '%s' earlier on the command line
\n
"
,
argument
,
mysqld_user
);
fprintf
(
stderr
,
"Warning: Ignoring user change to '%s' beca
use the user wa
s set to '%s' earlier on the command line
\n
"
,
argument
,
mysqld_user
);
break
;
case
'L'
:
strmake
(
language
,
argument
,
sizeof
(
language
)
-
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