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
f8b4732a
Commit
f8b4732a
authored
Feb 20, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Safety fixes (strnmov -> strmake)
parent
1877521f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
sql/mysqld.cc
sql/mysqld.cc
+5
-3
sql/set_var.cc
sql/set_var.cc
+6
-4
sql/sql_db.cc
sql/sql_db.cc
+7
-6
No files found.
sql/mysqld.cc
View file @
f8b4732a
...
@@ -5619,7 +5619,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -5619,7 +5619,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf
(
stderr
,
"Invalid ft-boolean-syntax string: %s
\n
"
,
argument
);
fprintf
(
stderr
,
"Invalid ft-boolean-syntax string: %s
\n
"
,
argument
);
exit
(
1
);
exit
(
1
);
}
}
str
nmov
(
opt_ft_boolean_syntax
,
argument
,
sizeof
(
ft_boolean_syntax
)
);
str
make
(
opt_ft_boolean_syntax
,
argument
,
sizeof
(
ft_boolean_syntax
)
-
1
);
break
;
break
;
case
OPT_SKIP_SAFEMALLOC
:
case
OPT_SKIP_SAFEMALLOC
:
#ifdef SAFEMALLOC
#ifdef SAFEMALLOC
...
@@ -5668,7 +5668,8 @@ static void get_options(int argc,char **argv)
...
@@ -5668,7 +5668,8 @@ static void get_options(int argc,char **argv)
int
ho_error
;
int
ho_error
;
my_getopt_register_get_addr
(
mysql_getopt_value
);
my_getopt_register_get_addr
(
mysql_getopt_value
);
strnmov
(
opt_ft_boolean_syntax
,
ft_boolean_syntax
,
sizeof
(
ft_boolean_syntax
));
strmake
(
opt_ft_boolean_syntax
,
ft_boolean_syntax
,
sizeof
(
ft_boolean_syntax
)
-
1
);
if
((
ho_error
=
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
)))
if
((
ho_error
=
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
)))
exit
(
ho_error
);
exit
(
ho_error
);
if
(
argc
>
0
)
if
(
argc
>
0
)
...
@@ -5724,7 +5725,8 @@ static void get_options(int argc,char **argv)
...
@@ -5724,7 +5725,8 @@ static void get_options(int argc,char **argv)
table_alias_charset
=
(
lower_case_table_names
?
table_alias_charset
=
(
lower_case_table_names
?
files_charset_info
:
files_charset_info
:
&
my_charset_bin
);
&
my_charset_bin
);
strnmov
(
ft_boolean_syntax
,
opt_ft_boolean_syntax
,
sizeof
(
ft_boolean_syntax
));
strmake
(
ft_boolean_syntax
,
opt_ft_boolean_syntax
,
sizeof
(
ft_boolean_syntax
)
-
1
);
if
(
opt_short_log_format
)
if
(
opt_short_log_format
)
opt_specialflag
|=
SPECIAL_SHORT_LOG_FORMAT
;
opt_specialflag
|=
SPECIAL_SHORT_LOG_FORMAT
;
...
...
sql/set_var.cc
View file @
f8b4732a
...
@@ -860,8 +860,8 @@ static void sys_default_init_slave(THD* thd, enum_var_type type)
...
@@ -860,8 +860,8 @@ static void sys_default_init_slave(THD* thd, enum_var_type type)
static
int
sys_check_ftb_syntax
(
THD
*
thd
,
set_var
*
var
)
static
int
sys_check_ftb_syntax
(
THD
*
thd
,
set_var
*
var
)
{
{
if
(
thd
->
master_access
&
SUPER_ACL
)
if
(
thd
->
master_access
&
SUPER_ACL
)
return
ft_boolean_check_syntax_string
(
var
->
value
->
str_value
.
ptr
())
?
return
ft_boolean_check_syntax_string
(
var
->
value
->
str_value
.
c_
ptr
())
?
-
1
:
0
;
-
1
:
0
;
else
else
{
{
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
"SUPER"
);
my_error
(
ER_SPECIFIC_ACCESS_DENIED_ERROR
,
MYF
(
0
),
"SUPER"
);
...
@@ -871,13 +871,15 @@ static int sys_check_ftb_syntax(THD *thd, set_var *var)
...
@@ -871,13 +871,15 @@ static int sys_check_ftb_syntax(THD *thd, set_var *var)
static
bool
sys_update_ftb_syntax
(
THD
*
thd
,
set_var
*
var
)
static
bool
sys_update_ftb_syntax
(
THD
*
thd
,
set_var
*
var
)
{
{
strnmov
(
ft_boolean_syntax
,
var
->
value
->
str_value
.
ptr
(),
sizeof
(
ft_boolean_syntax
));
strmake
(
ft_boolean_syntax
,
var
->
value
->
str_value
.
c_ptr
(),
sizeof
(
ft_boolean_syntax
)
-
1
);
return
0
;
return
0
;
}
}
static
void
sys_default_ftb_syntax
(
THD
*
thd
,
enum_var_type
type
)
static
void
sys_default_ftb_syntax
(
THD
*
thd
,
enum_var_type
type
)
{
{
strnmov
(
ft_boolean_syntax
,
opt_ft_boolean_syntax
,
sizeof
(
ft_boolean_syntax
));
strmake
(
ft_boolean_syntax
,
opt_ft_boolean_syntax
,
sizeof
(
ft_boolean_syntax
)
-
1
);
}
}
/*
/*
...
...
sql/sql_db.cc
View file @
f8b4732a
...
@@ -58,9 +58,9 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
...
@@ -58,9 +58,9 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
if
((
file
=
my_create
(
path
,
CREATE_MODE
,
O_RDWR
|
O_TRUNC
,
MYF
(
MY_WME
)))
>=
0
)
if
((
file
=
my_create
(
path
,
CREATE_MODE
,
O_RDWR
|
O_TRUNC
,
MYF
(
MY_WME
)))
>=
0
)
{
{
ulong
length
;
ulong
length
;
CHARSET_INFO
*
cs
=
(
create
&&
create
->
default_table_charset
)
?
CHARSET_INFO
*
cs
=
(
(
create
&&
create
->
default_table_charset
)
?
create
->
default_table_charset
:
create
->
default_table_charset
:
thd
->
variables
.
collation_server
;
thd
->
variables
.
collation_server
)
;
length
=
my_sprintf
(
buf
,(
buf
,
length
=
my_sprintf
(
buf
,(
buf
,
"default-character-set=%s
\n
default-collation=%s
\n
"
,
"default-character-set=%s
\n
default-collation=%s
\n
"
,
cs
->
csname
,
cs
->
name
));
cs
->
csname
,
cs
->
name
));
...
@@ -116,9 +116,10 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
...
@@ -116,9 +116,10 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
{
{
if
(
!
strncmp
(
buf
,
"default-character-set"
,
(
pos
-
buf
)))
if
(
!
strncmp
(
buf
,
"default-character-set"
,
(
pos
-
buf
)))
{
{
if
(
!
(
create
->
default_table_charset
=
get_charset_by_csname
(
pos
+
1
,
if
(
!
(
create
->
default_table_charset
=
MY_CS_PRIMARY
,
get_charset_by_csname
(
pos
+
1
,
MYF
(
0
))))
MY_CS_PRIMARY
,
MYF
(
0
))))
{
{
sql_print_error
(
ER
(
ER_UNKNOWN_CHARACTER_SET
),
pos
+
1
);
sql_print_error
(
ER
(
ER_UNKNOWN_CHARACTER_SET
),
pos
+
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