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
b2f86715
Commit
b2f86715
authored
Dec 17, 2007
by
tnurnberg@mysql.com/white.intern.koehntopp.de
Browse files
Options
Browse Files
Download
Plain Diff
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into mysql.com:/misc/mysql/31752_/41-31752_
parents
4e50bb0e
dddced96
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
21 deletions
+32
-21
mysys/mf_pack.c
mysys/mf_pack.c
+2
-2
sql/log.cc
sql/log.cc
+2
-2
sql/repl_failsafe.cc
sql/repl_failsafe.cc
+1
-1
sql/sql_show.cc
sql/sql_show.cc
+3
-2
sql/unireg.cc
sql/unireg.cc
+8
-0
strings/strmake.c
strings/strmake.c
+16
-14
No files found.
mysys/mf_pack.c
View file @
b2f86715
...
@@ -272,7 +272,7 @@ void symdirget(char *dir)
...
@@ -272,7 +272,7 @@ void symdirget(char *dir)
SYNOPSIS
SYNOPSIS
unpack_dirname()
unpack_dirname()
to
Store result here. May be
= from
to
result-buffer, FN_REFLEN characters. may be =
= from
from 'Packed' directory name (may contain ~)
from 'Packed' directory name (may contain ~)
IMPLEMENTATION
IMPLEMENTATION
...
@@ -398,7 +398,7 @@ uint unpack_filename(my_string to, const char *from)
...
@@ -398,7 +398,7 @@ uint unpack_filename(my_string to, const char *from)
/* Convert filename (unix standard) to system standard */
/* Convert filename (unix standard) to system standard */
/* Used before system command's like open(), create() .. */
/* Used before system command's like open(), create() .. */
/* Returns
length of to
*/
/* Returns
used length of to; total length should be FN_REFLEN
*/
uint
system_filename
(
my_string
to
,
const
char
*
from
)
uint
system_filename
(
my_string
to
,
const
char
*
from
)
{
{
...
...
sql/log.cc
View file @
b2f86715
...
@@ -963,10 +963,10 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time)
...
@@ -963,10 +963,10 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time)
void
MYSQL_LOG
::
make_log_name
(
char
*
buf
,
const
char
*
log_ident
)
void
MYSQL_LOG
::
make_log_name
(
char
*
buf
,
const
char
*
log_ident
)
{
{
uint
dir_len
=
dirname_length
(
log_file_name
);
uint
dir_len
=
dirname_length
(
log_file_name
);
if
(
dir_len
>
FN_REFLEN
)
if
(
dir_len
>
=
FN_REFLEN
)
dir_len
=
FN_REFLEN
-
1
;
dir_len
=
FN_REFLEN
-
1
;
strnmov
(
buf
,
log_file_name
,
dir_len
);
strnmov
(
buf
,
log_file_name
,
dir_len
);
strmake
(
buf
+
dir_len
,
log_ident
,
FN_REFLEN
-
dir_len
);
strmake
(
buf
+
dir_len
,
log_ident
,
FN_REFLEN
-
dir_len
-
1
);
}
}
...
...
sql/repl_failsafe.cc
View file @
b2f86715
...
@@ -926,7 +926,7 @@ int load_master_data(THD* thd)
...
@@ -926,7 +926,7 @@ int load_master_data(THD* thd)
0
,
(
SLAVE_IO
|
SLAVE_SQL
)))
0
,
(
SLAVE_IO
|
SLAVE_SQL
)))
send_error
(
thd
,
ER_MASTER_INFO
);
send_error
(
thd
,
ER_MASTER_INFO
);
strmake
(
active_mi
->
master_log_name
,
row
[
0
],
strmake
(
active_mi
->
master_log_name
,
row
[
0
],
sizeof
(
active_mi
->
master_log_name
));
sizeof
(
active_mi
->
master_log_name
)
-
1
);
active_mi
->
master_log_pos
=
my_strtoll10
(
row
[
1
],
(
char
**
)
0
,
&
error
);
active_mi
->
master_log_pos
=
my_strtoll10
(
row
[
1
],
(
char
**
)
0
,
&
error
);
/* at least in recent versions, the condition below should be false */
/* at least in recent versions, the condition below should be false */
if
(
active_mi
->
master_log_pos
<
BIN_LOG_HEADER_SIZE
)
if
(
active_mi
->
master_log_pos
<
BIN_LOG_HEADER_SIZE
)
...
...
sql/sql_show.cc
View file @
b2f86715
...
@@ -136,7 +136,8 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild)
...
@@ -136,7 +136,8 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild)
{
{
Item_string
*
field
=
new
Item_string
(
""
,
0
,
thd
->
charset
());
Item_string
*
field
=
new
Item_string
(
""
,
0
,
thd
->
charset
());
List
<
Item
>
field_list
;
List
<
Item
>
field_list
;
char
path
[
FN_LEN
],
*
end
;
char
path
[
FN_REFLEN
],
*
end
;
// for unpack_dirname()
List
<
char
>
files
;
List
<
char
>
files
;
char
*
file_name
;
char
*
file_name
;
Protocol
*
protocol
=
thd
->
protocol
;
Protocol
*
protocol
=
thd
->
protocol
;
...
@@ -457,7 +458,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
...
@@ -457,7 +458,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
Item
*
item
;
Item
*
item
;
List
<
char
>
files
;
List
<
char
>
files
;
List
<
Item
>
field_list
;
List
<
Item
>
field_list
;
char
path
[
FN_
LEN
];
char
path
[
FN_
REFLEN
];
// for unpack_dirname()
char
*
file_name
;
char
*
file_name
;
TABLE
*
table
;
TABLE
*
table
;
Protocol
*
protocol
=
thd
->
protocol
;
Protocol
*
protocol
=
thd
->
protocol
;
...
...
sql/unireg.cc
View file @
b2f86715
...
@@ -140,6 +140,14 @@ bool mysql_create_frm(THD *thd, my_string file_name,
...
@@ -140,6 +140,14 @@ bool mysql_create_frm(THD *thd, my_string file_name,
strmake
((
char
*
)
forminfo
+
47
,
create_info
->
comment
?
create_info
->
comment
:
""
,
strmake
((
char
*
)
forminfo
+
47
,
create_info
->
comment
?
create_info
->
comment
:
""
,
60
);
60
);
forminfo
[
46
]
=
(
uchar
)
strlen
((
char
*
)
forminfo
+
47
);
// Length of comment
forminfo
[
46
]
=
(
uchar
)
strlen
((
char
*
)
forminfo
+
47
);
// Length of comment
#ifdef EXTRA_DEBUG
/*
EXTRA_DEBUG causes strmake() to initialize its buffer behind the
payload with a magic value to detect wrong buffer-sizes. We
explicitly zero that segment again.
*/
memset
((
char
*
)
forminfo
+
47
+
forminfo
[
46
],
0
,
61
-
forminfo
[
46
]);
#endif
if
(
my_pwrite
(
file
,(
byte
*
)
fileinfo
,
64
,
0L
,
MYF_RW
)
||
if
(
my_pwrite
(
file
,(
byte
*
)
fileinfo
,
64
,
0L
,
MYF_RW
)
||
my_pwrite
(
file
,(
byte
*
)
keybuff
,
key_info_length
,
my_pwrite
(
file
,(
byte
*
)
keybuff
,
key_info_length
,
...
...
strings/strmake.c
View file @
b2f86715
...
@@ -28,23 +28,25 @@
...
@@ -28,23 +28,25 @@
#include <my_global.h>
#include <my_global.h>
#include "m_string.h"
#include "m_string.h"
#ifdef BAD_STRING_COMPILER
char
*
strmake
(
register
char
*
dst
,
register
const
char
*
src
,
uint
length
)
char
*
strmake
(
char
*
dst
,
const
char
*
src
,
uint
length
)
{
{
reg1
char
*
res
;
#ifdef EXTRA_DEBUG
/*
if
((
res
=
memccpy
(
dst
,
src
,
0
,
length
)))
'length' is the maximum length of the string; the buffer needs
return
res
-
1
;
to be one character larger to accomodate the terminating '\0'.
dst
[
length
]
=
0
;
This is easy to get wrong, so we make sure we write to the
return
dst
+
length
;
entire length of the buffer to identify incorrect buffer-sizes.
}
We only initialise the "unused" part of the buffer here, a) for
efficiency, and b) because dst==src is allowed, so initialising
#define strmake strmake_overlapp
/* Use orginal for overlapping str */
the entire buffer would overwrite the source-string. Also, we
write a character rather than '\0' as this makes spotting these
problems in the results easier.
*/
uint
n
=
strlen
(
src
)
+
1
;
if
(
n
<=
length
)
memset
(
dst
+
n
,
(
int
)
'Z'
,
length
-
n
+
1
);
#endif
#endif
char
*
strmake
(
register
char
*
dst
,
register
const
char
*
src
,
uint
length
)
{
while
(
length
--
)
while
(
length
--
)
if
(
!
(
*
dst
++
=
*
src
++
))
if
(
!
(
*
dst
++
=
*
src
++
))
return
dst
-
1
;
return
dst
-
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