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
3c8ed475
Commit
3c8ed475
authored
Nov 23, 2006
by
petr/cps@outpost.site
Browse files
Options
Browse Files
Download
Plain Diff
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into outpost.site:/home/cps/mysql/trees/mysql-5.1-runtime
parents
db522c30
aad182fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
8 deletions
+57
-8
server-tools/instance-manager/instance_options.cc
server-tools/instance-manager/instance_options.cc
+57
-8
No files found.
server-tools/instance-manager/instance_options.cc
View file @
3c8ed475
...
@@ -60,6 +60,29 @@ static inline bool create_mysqld_command(Buffer *buf,
...
@@ -60,6 +60,29 @@ static inline bool create_mysqld_command(Buffer *buf,
return
TRUE
;
return
TRUE
;
}
}
static
inline
bool
is_path_separator
(
char
ch
)
{
#if defined(__WIN__) || defined(__NETWARE__)
/* On windows and netware more delimiters are possible */
return
ch
==
FN_LIBCHAR
||
ch
==
FN_DEVCHAR
||
ch
==
'/'
;
#else
return
ch
==
FN_LIBCHAR
;
/* Unixes */
#endif
}
static
char
*
find_last_path_separator
(
char
*
path
,
uint
length
)
{
while
(
length
)
{
if
(
is_path_separator
(
path
[
length
]))
return
path
+
length
;
length
--
;
}
return
NULL
;
/* No path separator found */
}
bool
Instance_options
::
is_option_im_specific
(
const
char
*
option_name
)
bool
Instance_options
::
is_option_im_specific
(
const
char
*
option_name
)
{
{
...
@@ -436,25 +459,51 @@ bool Instance_options::complete_initialization()
...
@@ -436,25 +459,51 @@ bool Instance_options::complete_initialization()
int
arg_idx
;
int
arg_idx
;
const
char
*
tmp
;
const
char
*
tmp
;
char
*
end
;
char
*
end
;
char
bin_name_firstchar
;
if
(
!
mysqld_path
.
str
)
if
(
!
mysqld_path
.
str
)
{
{
/* Need one extra byte, as convert_dirname() adds a slash at the end. */
/*
mysqld_path
.
str
=
alloc_root
(
&
alloc
,
Need to copy the path to allocated memory, as convert_dirname() might
strlen
(
Options
::
Main
::
default_mysqld_path
)
+
2
);
need to change it
*/
mysqld_path
.
str
=
alloc_root
(
&
alloc
,
strlen
(
Options
::
Main
::
default_mysqld_path
)
+
1
);
if
(
!
mysqld_path
.
str
)
if
(
!
mysqld_path
.
str
)
return
TRUE
;
return
TRUE
;
strcpy
(
mysqld_path
.
str
,
Options
::
Main
::
default_mysqld_path
);
strcpy
(
mysqld_path
.
str
,
Options
::
Main
::
default_mysqld_path
);
}
}
// it's safe to cast this to char* since this is a buffer we are allocating
end
=
convert_dirname
((
char
*
)
mysqld_path
.
str
,
mysqld_path
.
str
,
NullS
);
end
[
-
1
]
=
0
;
mysqld_path
.
length
=
strlen
(
mysqld_path
.
str
);
mysqld_path
.
length
=
strlen
(
mysqld_path
.
str
);
/*
If we found path with no slashes (end == NULL), we should not call
convert_dirname() at all. As we have got relative path to the binary.
That is, user supposes that mysqld resides in the same dir as
mysqlmanager.
*/
if
((
end
=
find_last_path_separator
(
mysqld_path
.
str
,
mysqld_path
.
length
)))
{
bin_name_firstchar
=
end
[
1
];
/*
Below we will conver the path to mysqld in the case, it was given
in a format of another OS (e.g. uses '/' instead of '\' etc).
Here we strip the path to get rid of the binary name ("mysqld"),
we do it by removing first letter of the binary name (e.g. 'm'
in "mysqld"). Later we put it back.
*/
end
[
1
]
=
0
;
/* convert dirname to the format of current OS */
convert_dirname
((
char
*
)
mysqld_path
.
str
,
mysqld_path
.
str
,
NullS
);
/* put back the first character of the binary name*/
end
[
1
]
=
bin_name_firstchar
;
}
if
(
mysqld_port
)
if
(
mysqld_port
)
mysqld_port_val
=
atoi
(
mysqld_port
);
mysqld_port_val
=
atoi
(
mysqld_port
);
...
...
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