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
dba7e1e8
Commit
dba7e1e8
authored
Jul 02, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
838a1046
c43a6666
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
31 deletions
+43
-31
sql/mysql_install_db.cc
sql/mysql_install_db.cc
+15
-7
sql/sql_class.h
sql/sql_class.h
+5
-1
sql/sql_show.cc
sql/sql_show.cc
+4
-4
sql/winservice.c
sql/winservice.c
+19
-19
No files found.
sql/mysql_install_db.cc
View file @
dba7e1e8
...
...
@@ -406,8 +406,8 @@ static int register_service()
static
void
clean_directory
(
const
char
*
dir
)
{
char
dir2
[
MAX_PATH
+
2
]
;
*
(
strmake_buf
(
dir2
,
dir
)
+
1
)
=
0
;
char
dir2
[
MAX_PATH
+
4
]
=
{}
;
snprintf
(
dir2
,
MAX_PATH
+
2
,
"%s
\\
*"
,
dir
)
;
SHFILEOPSTRUCT
fileop
;
fileop
.
hwnd
=
NULL
;
/* no status display */
...
...
@@ -558,7 +558,7 @@ static int create_db_instance()
DWORD
cwd_len
=
MAX_PATH
;
char
cmdline
[
3
*
MAX_PATH
];
FILE
*
in
;
bool
c
leanup_datadir
=
tru
e
;
bool
c
reated_datadir
=
fals
e
;
DWORD
last_error
;
verbose
(
"Running bootstrap"
);
...
...
@@ -567,7 +567,11 @@ static int create_db_instance()
/* Create datadir and datadir/mysql, if they do not already exist. */
if
(
!
CreateDirectory
(
opt_datadir
,
NULL
)
&&
(
GetLastError
()
!=
ERROR_ALREADY_EXISTS
))
if
(
CreateDirectory
(
opt_datadir
,
NULL
))
{
created_datadir
=
true
;
}
else
if
(
GetLastError
()
!=
ERROR_ALREADY_EXISTS
)
{
last_error
=
GetLastError
();
switch
(
last_error
)
...
...
@@ -604,9 +608,11 @@ static int create_db_instance()
}
}
if
(
PathIsDirectoryEmpty
(
opt_datadir
))
if
(
!
PathIsDirectoryEmpty
(
opt_datadir
))
{
cleanup_datadir
=
false
;
fprintf
(
stderr
,
"ERROR : Data directory %s is not empty."
" Only new or empty existing directories are accepted for --datadir
\n
"
,
opt_datadir
);
exit
(
1
);
}
if
(
!
CreateDirectory
(
"mysql"
,
NULL
))
...
...
@@ -735,10 +741,12 @@ static int create_db_instance()
}
end:
if
(
ret
&&
cleanup_datadir
)
if
(
ret
)
{
SetCurrentDirectory
(
cwd
);
clean_directory
(
opt_datadir
);
if
(
created_datadir
)
RemoveDirectory
(
opt_datadir
);
}
return
ret
;
}
sql/sql_class.h
View file @
dba7e1e8
...
...
@@ -3610,7 +3610,11 @@ class THD :public Statement,
bool
is_bulk_op
()
const
{
return
MY_TEST
(
bulk_param
);
}
/// Returns Diagnostics-area for the current statement.
Diagnostics_area
*
get_stmt_da
()
const
Diagnostics_area
*
get_stmt_da
()
{
return
m_stmt_da
;
}
/// Returns Diagnostics-area for the current statement.
const
Diagnostics_area
*
get_stmt_da
()
const
{
return
m_stmt_da
;
}
/// Sets Diagnostics-area for the current statement.
...
...
sql/sql_show.cc
View file @
dba7e1e8
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2009, 20
17
, MariaDB
Copyright (c) 2009, 20
20
, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -5088,16 +5088,16 @@ bool store_schema_shemata(THD* thd, TABLE *table, LEX_STRING *db_name,
*/
static
bool
verify_database_directory_exists
(
const
LEX_STRING
&
dbname
)
{
DBUG_ENTER
(
"veri
ty_database
_exists"
);
DBUG_ENTER
(
"veri
fy_database_directory
_exists"
);
char
path
[
FN_REFLEN
+
16
];
uint
path_len
;
MY_STAT
stat_info
;
if
(
!
dbname
.
str
[
0
])
DBUG_RETURN
(
true
);
// Empty database name: does not exi
ts
.
DBUG_RETURN
(
true
);
// Empty database name: does not exi
st
.
path_len
=
build_table_filename
(
path
,
sizeof
(
path
)
-
1
,
dbname
.
str
,
""
,
""
,
0
);
path
[
path_len
-
1
]
=
0
;
if
(
!
mysql_file_stat
(
key_file_misc
,
path
,
&
stat_info
,
MYF
(
0
)))
DBUG_RETURN
(
true
);
// The database directory was not found: does not exist
s
.
DBUG_RETURN
(
true
);
// The database directory was not found: does not exist.
DBUG_RETURN
(
false
);
// The database directory was found.
}
...
...
sql/winservice.c
View file @
dba7e1e8
...
...
@@ -150,10 +150,7 @@ int get_mysql_service_properties(const wchar_t *bin_path,
There are rare cases where service config does not have
--defaults-filein the binary parth . There services were registered with
plain mysqld --install, the data directory is next to "bin" in this case.
Service name (second parameter) must be MySQL.
*/
if
(
wcscmp
(
args
[
1
],
L"MySQL"
)
!=
0
)
goto
end
;
have_inifile
=
FALSE
;
}
else
if
(
numargs
==
3
)
...
...
@@ -211,7 +208,7 @@ int get_mysql_service_properties(const wchar_t *bin_path,
}
}
if
(
!
have_inifile
)
if
(
!
have_inifile
||
props
->
datadir
[
0
]
==
0
)
{
/*
Hard, although a rare case, we're guessing datadir and defaults-file.
...
...
@@ -235,22 +232,25 @@ int get_mysql_service_properties(const wchar_t *bin_path,
*
p
=
0
;
}
/* Look for my.ini, my.cnf in the install root */
sprintf_s
(
props
->
inifile
,
MAX_PATH
,
"%s
\\
my.ini"
,
install_root
);
if
(
GetFileAttributes
(
props
->
inifile
)
==
INVALID_FILE_ATTRIBUTES
)
{
sprintf_s
(
props
->
inifile
,
MAX_PATH
,
"%s
\\
my.cnf"
,
install_root
);
}
if
(
GetFileAttributes
(
props
->
inifile
)
!=
INVALID_FILE_ATTRIBUTES
)
{
/* Ini file found, get datadir from there */
GetPrivateProfileString
(
"mysqld"
,
"datadir"
,
NULL
,
props
->
datadir
,
MAX_PATH
,
props
->
inifile
);
}
else
if
(
!
have_inifile
)
{
/* No ini file */
props
->
inifile
[
0
]
=
0
;
/* Look for my.ini, my.cnf in the install root */
sprintf_s
(
props
->
inifile
,
MAX_PATH
,
"%s
\\
my.ini"
,
install_root
);
if
(
GetFileAttributes
(
props
->
inifile
)
==
INVALID_FILE_ATTRIBUTES
)
{
sprintf_s
(
props
->
inifile
,
MAX_PATH
,
"%s
\\
my.cnf"
,
install_root
);
}
if
(
GetFileAttributes
(
props
->
inifile
)
!=
INVALID_FILE_ATTRIBUTES
)
{
/* Ini file found, get datadir from there */
GetPrivateProfileString
(
"mysqld"
,
"datadir"
,
NULL
,
props
->
datadir
,
MAX_PATH
,
props
->
inifile
);
}
else
{
/* No ini file */
props
->
inifile
[
0
]
=
0
;
}
}
/* Try datadir in install directory.*/
...
...
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