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
81d99da1
Commit
81d99da1
authored
Jan 04, 2005
by
jani@ua141d10.elisa.omakaista.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checking for my.cnf file from environment variable MYSQL_HOME
instead of DATADIR.
parent
a99921fb
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
23 deletions
+51
-23
include/config-win.h
include/config-win.h
+3
-0
libmysql/Makefile.shared
libmysql/Makefile.shared
+1
-0
mysys/Makefile.am
mysys/Makefile.am
+1
-0
mysys/default.c
mysys/default.c
+25
-17
scripts/mysqld_multi.sh
scripts/mysqld_multi.sh
+11
-1
scripts/mysqld_safe.sh
scripts/mysqld_safe.sh
+10
-5
No files found.
include/config-win.h
View file @
81d99da1
...
@@ -332,6 +332,9 @@ inline double ulonglong2double(ulonglong value)
...
@@ -332,6 +332,9 @@ inline double ulonglong2double(ulonglong value)
#define SHAREDIR "share"
#define SHAREDIR "share"
#define DEFAULT_CHARSET_HOME "C:/mysql/"
#define DEFAULT_CHARSET_HOME "C:/mysql/"
#endif
#endif
#ifndef DEFAULT_HOME_ENV
#define DEFAULT_HOME_ENV MYSQL_HOME
#endif
/* File name handling */
/* File name handling */
...
...
libmysql/Makefile.shared
View file @
81d99da1
...
@@ -81,6 +81,7 @@ CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
...
@@ -81,6 +81,7 @@ CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
$(target)
$(target)
DEFS
=
-DDEFAULT_CHARSET_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
DEFS
=
-DDEFAULT_CHARSET_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DDEFAULT_HOME_ENV
=
MYSQL_HOME
\
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
$(target_defs)
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
$(target_defs)
# The automatic dependencies miss this
# The automatic dependencies miss this
...
...
mysys/Makefile.am
View file @
81d99da1
...
@@ -66,6 +66,7 @@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \
...
@@ -66,6 +66,7 @@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DDEFAULT_CHARSET_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
-DDEFAULT_CHARSET_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
\
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
\
-DDEFAULT_HOME_ENV
=
MYSQL_HOME
\
@DEFS@
@DEFS@
libmysys_a_DEPENDENCIES
=
@THREAD_LOBJECTS@
libmysys_a_DEPENDENCIES
=
@THREAD_LOBJECTS@
...
...
mysys/default.c
View file @
81d99da1
...
@@ -45,23 +45,8 @@ char *defaults_extra_file=0;
...
@@ -45,23 +45,8 @@ char *defaults_extra_file=0;
/* Which directories are searched for options (and in which order) */
/* Which directories are searched for options (and in which order) */
const
char
*
default_directories
[]
=
{
#define MAX_DEFAULT_DIRS 4
#ifdef __WIN__
const
char
*
default_directories
[
MAX_DEFAULT_DIRS
+
1
];
"C:/"
,
#elif defined(__NETWARE__)
"sys:/etc/"
,
#else
"/etc/"
,
#endif
#ifdef DATADIR
DATADIR
,
#endif
""
,
/* Place for defaults_extra_dir */
#if !defined(__WIN__) && !defined(__NETWARE__)
"~/"
,
#endif
NullS
,
};
#ifdef __WIN__
#ifdef __WIN__
static
const
char
*
f_extensions
[]
=
{
".ini"
,
".cnf"
,
0
};
static
const
char
*
f_extensions
[]
=
{
".ini"
,
".cnf"
,
0
};
...
@@ -89,6 +74,7 @@ static int search_default_file_with_ext(Process_option_func func,
...
@@ -89,6 +74,7 @@ static int search_default_file_with_ext(Process_option_func func,
void
*
func_ctx
,
void
*
func_ctx
,
const
char
*
dir
,
const
char
*
ext
,
const
char
*
dir
,
const
char
*
ext
,
const
char
*
config_file
);
const
char
*
config_file
);
static
void
init_default_directories
();
static
char
*
remove_end_comment
(
char
*
ptr
);
static
char
*
remove_end_comment
(
char
*
ptr
);
...
@@ -319,6 +305,7 @@ int load_defaults(const char *conf_file, const char **groups,
...
@@ -319,6 +305,7 @@ int load_defaults(const char *conf_file, const char **groups,
struct
handle_option_ctx
ctx
;
struct
handle_option_ctx
ctx
;
DBUG_ENTER
(
"load_defaults"
);
DBUG_ENTER
(
"load_defaults"
);
init_default_directories
();
init_alloc_root
(
&
alloc
,
512
,
0
);
init_alloc_root
(
&
alloc
,
512
,
0
);
if
(
*
argc
>=
2
&&
!
strcmp
(
argv
[
0
][
1
],
"--no-defaults"
))
if
(
*
argc
>=
2
&&
!
strcmp
(
argv
[
0
][
1
],
"--no-defaults"
))
{
{
...
@@ -652,6 +639,7 @@ void print_defaults(const char *conf_file, const char **groups)
...
@@ -652,6 +639,7 @@ void print_defaults(const char *conf_file, const char **groups)
char
name
[
FN_REFLEN
],
**
ext
;
char
name
[
FN_REFLEN
],
**
ext
;
const
char
**
dirs
;
const
char
**
dirs
;
init_default_directories
();
puts
(
"
\n
Default options are read from the following files in the given order:"
);
puts
(
"
\n
Default options are read from the following files in the given order:"
);
if
(
dirname_length
(
conf_file
))
if
(
dirname_length
(
conf_file
))
...
@@ -714,3 +702,23 @@ void print_defaults(const char *conf_file, const char **groups)
...
@@ -714,3 +702,23 @@ void print_defaults(const char *conf_file, const char **groups)
}
}
#include <help_end.h>
#include <help_end.h>
static
void
init_default_directories
()
{
const
char
*
env
,
**
ptr
=
default_directories
;
#ifdef __WIN__
*
ptr
++=
"C:/"
;
#elif defined(__NETWARE__)
*
ptr
++=
"sys:/etc/"
;
#else
*
ptr
++=
"/etc/"
;
#endif
if
((
env
=
getenv
(
STRINGIFY_ARG
(
DEFAULT_HOME_ENV
))))
*
ptr
++=
env
;
*
ptr
++=
""
;
/* Place for defaults_extra_file */
#if !defined(__WIN__) && !defined(__NETWARE__)
*
ptr
++=
"~/"
;;
#endif
*
ptr
=
0
;
/* end marker */
}
scripts/mysqld_multi.sh
View file @
81d99da1
...
@@ -4,7 +4,7 @@ use Getopt::Long;
...
@@ -4,7 +4,7 @@ use Getopt::Long;
use POSIX qw
(
strftime
)
;
use POSIX qw
(
strftime
)
;
$|
=
1
;
$|
=
1
;
$VER
=
"2.1
1
"
;
$VER
=
"2.1
2
"
;
$opt_config_file
=
undef
()
;
$opt_config_file
=
undef
()
;
$opt_example
=
0
;
$opt_example
=
0
;
...
@@ -430,6 +430,16 @@ sub find_groups
...
@@ -430,6 +430,16 @@ sub find_groups
{
{
$data
[
$i
]
=
$line
;
$data
[
$i
]
=
$line
;
}
}
if
(
defined
(
$ENV
{
MYSQL_HOME
})
&&
-f
"
$ENV
{MYSQL_HOME}/my.cnf"
&&
-r
"
$ENV
{MYSQL_HOME}/my.cnf"
)
{
open
(
MY_CNF,
"<
$ENV
{MYSQL_HOME}/my.cnf"
)
&&
(
@tmp
=
<MY_CNF>
)
&&
close
(
MY_CNF
)
;
}
for
(
;
(
$line
=
shift
@tmp
)
;
$i
++
)
{
$data
[
$i
]
=
$line
;
}
if
(
-f
"
$homedir
/.my.cnf"
&&
-r
"
$homedir
/.my.cnf"
)
if
(
-f
"
$homedir
/.my.cnf"
&&
-r
"
$homedir
/.my.cnf"
)
{
{
open
(
MY_CNF,
"<
$homedir
/.my.cnf"
)
&&
(
@tmp
=
<MY_CNF>
)
&&
close
(
MY_CNF
)
;
open
(
MY_CNF,
"<
$homedir
/.my.cnf"
)
&&
(
@tmp
=
<MY_CNF>
)
&&
close
(
MY_CNF
)
;
...
...
scripts/mysqld_safe.sh
View file @
81d99da1
...
@@ -52,11 +52,7 @@ parse_arguments() {
...
@@ -52,11 +52,7 @@ parse_arguments() {
# mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
# mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
--ledir
=
*
)
ledir
=
`
echo
"
$arg
"
|
sed
-e
"s;--ledir=;;"
`
;;
--ledir
=
*
)
ledir
=
`
echo
"
$arg
"
|
sed
-e
"s;--ledir=;;"
`
;;
# err-log should be removed in 5.0
--err-log
=
*
)
err_log
=
`
echo
"
$arg
"
|
sed
-e
"s;--err-log=;;"
`
;;
--log-error
=
*
)
err_log
=
`
echo
"
$arg
"
|
sed
-e
"s;--log-error=;;"
`
;;
--log-error
=
*
)
err_log
=
`
echo
"
$arg
"
|
sed
-e
"s;--log-error=;;"
`
;;
# QQ The --open-files should be removed in 5.0
--open-files
=
*
)
open_files
=
`
echo
"
$arg
"
|
sed
-e
"s;--open-files=;;"
`
;;
--open-files-limit
=
*
)
open_files
=
`
echo
"
$arg
"
|
sed
-e
"s;--open-files-limit=;;"
`
;;
--open-files-limit
=
*
)
open_files
=
`
echo
"
$arg
"
|
sed
-e
"s;--open-files-limit=;;"
`
;;
--core-file-size
=
*
)
core_file_size
=
`
echo
"
$arg
"
|
sed
-e
"s;--core-file-size=;;"
`
;;
--core-file-size
=
*
)
core_file_size
=
`
echo
"
$arg
"
|
sed
-e
"s;--core-file-size=;;"
`
;;
--timezone
=
*
)
TZ
=
`
echo
"
$arg
"
|
sed
-e
"s;--timezone=;;"
`
;
export
TZ
;
;;
--timezone
=
*
)
TZ
=
`
echo
"
$arg
"
|
sed
-e
"s;--timezone=;;"
`
;
export
TZ
;
;;
...
@@ -94,7 +90,7 @@ then
...
@@ -94,7 +90,7 @@ then
DATADIR
=
$MY_BASEDIR_VERSION
/data
DATADIR
=
$MY_BASEDIR_VERSION
/data
if
test
-z
"
$defaults
"
if
test
-z
"
$defaults
"
then
then
defaults
=
"--defaults-extra-file=
$
MY_BASEDIR_VERSION
/data
/my.cnf"
defaults
=
"--defaults-extra-file=
$
DATADIR
/my.cnf"
fi
fi
# Check if this is a 'moved install directory'
# Check if this is a 'moved install directory'
elif
test
-f
./var/mysql/db.frm
-a
-f
./share/mysql/english/errmsg.sys
-a
\
elif
test
-f
./var/mysql/db.frm
-a
-f
./share/mysql/english/errmsg.sys
-a
\
...
@@ -106,8 +102,17 @@ then
...
@@ -106,8 +102,17 @@ then
else
else
MY_BASEDIR_VERSION
=
@prefix@
MY_BASEDIR_VERSION
=
@prefix@
DATADIR
=
@localstatedir@
DATADIR
=
@localstatedir@
if
test
-z
"
$MYSQL_HOME
"
then
MYSQL_HOME
=
$DATADIR
# Installation in a not common path
fi
ledir
=
@libexecdir@
ledir
=
@libexecdir@
fi
fi
if
test
-z
"
$MYSQL_HOME
"
then
MYSQL_HOME
=
$MY_BASEDIR_VERSION
fi
export
MYSQL_HOME
user
=
@MYSQLD_USER@
user
=
@MYSQLD_USER@
niceness
=
0
niceness
=
0
...
...
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