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
a3f11f75
Commit
a3f11f75
authored
Sep 29, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.5' into 10.0
parents
23af6f59
7497ebf8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
12 deletions
+73
-12
mysql-test/lib/My/Platform.pm
mysql-test/lib/My/Platform.pm
+48
-1
mysql-test/lib/mtr_io.pl
mysql-test/lib/mtr_io.pl
+5
-4
mysys/my_fopen.c
mysys/my_fopen.c
+3
-3
plugin/feedback/utils.cc
plugin/feedback/utils.cc
+11
-2
scripts/mysqld_safe.sh
scripts/mysqld_safe.sh
+5
-1
support-files/mysql.server.sh
support-files/mysql.server.sh
+1
-1
No files found.
mysql-test/lib/My/Platform.pm
View file @
a3f11f75
...
@@ -24,7 +24,7 @@ use File::Path;
...
@@ -24,7 +24,7 @@ use File::Path;
use
base
qw(Exporter)
;
use
base
qw(Exporter)
;
our
@EXPORT
=
qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
our
@EXPORT
=
qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
native_path posix_path mixed_path
native_path posix_path mixed_path
check_socket_path_length process_alive)
;
check_socket_path_length process_alive
open_for_append
)
;
BEGIN
{
BEGIN
{
if
(
$^O
eq
"
cygwin
")
{
if
(
$^O
eq
"
cygwin
")
{
...
@@ -161,4 +161,51 @@ sub process_alive {
...
@@ -161,4 +161,51 @@ sub process_alive {
}
}
use
Symbol
qw( gensym )
;
use
if
$^O
eq
'
MSWin32
',
'
Win32API::File
',
qw( CloseHandle CreateFile GetOsFHandle OsFHandleOpen OPEN_ALWAYS FILE_APPEND_DATA
FILE_SHARE_READ FILE_SHARE_WRITE FILE_SHARE_DELETE )
;
use
if
$^O
eq
'
MSWin32
',
'
Win32::API
';
use
constant
WIN32API_FILE_NULL
=>
[]
;
# Open a file for append
# On Windows we use CreateFile with FILE_APPEND_DATA
# to insure that writes are atomic, not interleaved
# with writes by another processes.
sub
open_for_append
{
my
(
$file
)
=
@_
;
my
$fh
=
gensym
();
if
(
IS_WIN32PERL
)
{
my
$handle
;
if
(
!
(
$handle
=
CreateFile
(
$file
,
FILE_APPEND_DATA
(),
FILE_SHARE_READ
()
|
FILE_SHARE_WRITE
()
|
FILE_SHARE_DELETE
(),
WIN32API_FILE_NULL
,
OPEN_ALWAYS
(),
# Create if doesn't exist.
0
,
WIN32API_FILE_NULL
,
)))
{
return
undef
;
}
if
(
!
OsFHandleOpen
(
$fh
,
$handle
,
'
wat
'))
{
CloseHandle
(
$handle
);
return
undef
;
}
return
$fh
;
}
open
(
$fh
,"
>>
",
$file
)
or
return
undef
;
return
$fh
;
}
1
;
1
;
mysql-test/lib/mtr_io.pl
View file @
a3f11f75
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
use
strict
;
use
strict
;
use
Carp
;
use
Carp
;
use
My::
Platform
;
sub
mtr_fromfile
($);
sub
mtr_fromfile
($);
sub
mtr_tofile
($@);
sub
mtr_tofile
($@);
...
@@ -45,10 +46,10 @@ sub mtr_fromfile ($) {
...
@@ -45,10 +46,10 @@ sub mtr_fromfile ($) {
sub
mtr_tofile
($@)
{
sub
mtr_tofile
($@)
{
my
$file
=
shift
;
my
$file
=
shift
;
my
$fh
=
open_for_append
$file
;
open
(
FILE
,"
>>
",
$file
)
or
mtr_error
("
can't open file
\"
$file
\"
: $!
"
);
mtr_error
("
can't open file
\"
$file
\"
: $!
")
unless
defined
(
$fh
);
print
FILE
join
("",
@_
);
print
$fh
join
("",
@_
);
close
FILE
;
close
$fh
;
}
}
...
...
mysys/my_fopen.c
View file @
a3f11f75
...
@@ -102,6 +102,7 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
...
@@ -102,6 +102,7 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
HANDLE
osfh
;
HANDLE
osfh
;
DBUG_ASSERT
(
path
&&
stream
);
DBUG_ASSERT
(
path
&&
stream
);
DBUG_ASSERT
(
strchr
(
mode
,
'a'
));
/* We use FILE_APPEND_DATA below */
/* Services don't have stdout/stderr on Windows, so _fileno returns -1. */
/* Services don't have stdout/stderr on Windows, so _fileno returns -1. */
if
(
fd
<
0
)
if
(
fd
<
0
)
...
@@ -112,15 +113,14 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
...
@@ -112,15 +113,14 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
fd
=
_fileno
(
stream
);
fd
=
_fileno
(
stream
);
}
}
if
((
osfh
=
CreateFile
(
path
,
GENERIC_READ
|
GENERIC_WRITE
,
if
((
osfh
=
CreateFile
(
path
,
GENERIC_READ
|
FILE_APPEND_DATA
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
FILE_SHARE_DELETE
,
NULL
,
OPEN_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
OPEN_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
))
==
INVALID_HANDLE_VALUE
)
NULL
))
==
INVALID_HANDLE_VALUE
)
return
NULL
;
return
NULL
;
if
((
handle_fd
=
_open_osfhandle
((
intptr_t
)
osfh
,
if
((
handle_fd
=
_open_osfhandle
((
intptr_t
)
osfh
,
_O_TEXT
))
==
-
1
)
_O_APPEND
|
_O_TEXT
))
==
-
1
)
{
{
CloseHandle
(
osfh
);
CloseHandle
(
osfh
);
return
NULL
;
return
NULL
;
...
...
plugin/feedback/utils.cc
View file @
a3f11f75
...
@@ -43,7 +43,11 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
...
@@ -43,7 +43,11 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
{
{
DWORD
major
=
ver
->
dwMajorVersion
;
DWORD
major
=
ver
->
dwMajorVersion
;
DWORD
minor
=
ver
->
dwMinorVersion
;
DWORD
minor
=
ver
->
dwMinorVersion
;
if
(
major
==
10
&&
minor
==
0
)
{
return
(
ver
->
wProductType
==
VER_NT_WORKSTATION
)
?
"Windows 10"
:
"Windows Server 2016"
;
}
if
(
major
==
6
&&
minor
==
3
)
if
(
major
==
6
&&
minor
==
3
)
{
{
return
(
ver
->
wProductType
==
VER_NT_WORKSTATION
)
?
return
(
ver
->
wProductType
==
VER_NT_WORKSTATION
)
?
...
@@ -102,7 +106,12 @@ static int uname(struct utsname *buf)
...
@@ -102,7 +106,12 @@ static int uname(struct utsname *buf)
if
(
version_str
&&
version_str
[
0
])
if
(
version_str
&&
version_str
[
0
])
sprintf
(
buf
->
version
,
"%s %s"
,
version_str
,
ver
.
szCSDVersion
);
sprintf
(
buf
->
version
,
"%s %s"
,
version_str
,
ver
.
szCSDVersion
);
else
else
sprintf
(
buf
->
version
,
"%s"
,
ver
.
szCSDVersion
);
{
/* Fallback for unknown versions, e.g "Windows <major_ver>.<minor_ver>" */
sprintf
(
buf
->
version
,
"Windows %d.%d%s"
,
ver
.
dwMajorVersion
,
ver
.
dwMinorVersion
,
(
ver
.
wProductType
==
VER_NT_WORKSTATION
?
""
:
" Server"
));
}
#ifdef _WIN64
#ifdef _WIN64
strcpy
(
buf
->
machine
,
"x64"
);
strcpy
(
buf
->
machine
,
"x64"
);
...
...
scripts/mysqld_safe.sh
View file @
a3f11f75
...
@@ -626,6 +626,10 @@ else
...
@@ -626,6 +626,10 @@ else
logging
=
syslog
logging
=
syslog
fi
fi
# close stdout and stderr, everything goes to $logging now
exec
1>&-
exec
2>&-
USER_OPTION
=
""
USER_OPTION
=
""
if
test
-w
/
-o
"
$USER
"
=
"root"
if
test
-w
/
-o
"
$USER
"
=
"root"
then
then
...
@@ -656,7 +660,7 @@ if [ ! -d $mysql_unix_port_dir ]
...
@@ -656,7 +660,7 @@ if [ ! -d $mysql_unix_port_dir ]
then
then
if
!
`
mkdir
-p
$mysql_unix_port_dir
`
if
!
`
mkdir
-p
$mysql_unix_port_dir
`
then
then
echo
"Fatal error Can't create database directory '
$mysql_unix_port
'"
log_error
"Fatal error Can't create database directory '
$mysql_unix_port
'"
exit
1
exit
1
fi
fi
chown
$user
$mysql_unix_port_dir
chown
$user
$mysql_unix_port_dir
...
...
support-files/mysql.server.sh
View file @
a3f11f75
...
@@ -303,7 +303,7 @@ case "$mode" in
...
@@ -303,7 +303,7 @@ case "$mode" in
then
then
# Give extra arguments to mysqld with the my.cnf file. This script
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
# may be overwritten at next upgrade.
$bindir
/mysqld_safe
--datadir
=
"
$datadir
"
--pid-file
=
"
$mysqld_pid_file_path
"
"
$@
"
>
/dev/null
&
$bindir
/mysqld_safe
--datadir
=
"
$datadir
"
--pid-file
=
"
$mysqld_pid_file_path
"
"
$@
"
&
wait_for_ready
;
return_value
=
$?
wait_for_ready
;
return_value
=
$?
# Make lock for RedHat / SuSE
# Make lock for RedHat / SuSE
...
...
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