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
8221708e
Commit
8221708e
authored
Sep 24, 2021
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Windows, mysqltest : cleanup, remove dead code USE_CYGWIN
parent
ca7046dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
54 deletions
+0
-54
client/mysqltest.cc
client/mysqltest.cc
+0
-54
No files found.
client/mysqltest.cc
View file @
8221708e
...
...
@@ -71,10 +71,6 @@ static my_bool non_blocking_api_enabled= 0;
#include "../tests/nonblock-wrappers.h"
#endif
/* Use cygwin for --exec and --system before 5.0 */
#if MYSQL_VERSION_ID < 50000
#define USE_CYGWIN
#endif
#define MAX_VAR_NAME_LENGTH 256
#define MAX_COLUMNS 256
...
...
@@ -618,11 +614,6 @@ void fix_win_paths(char *val, size_t len);
const
char
*
get_errname_from_code
(
uint
error_code
);
int
multi_reg_replace
(
struct
st_replace_regex
*
r
,
char
*
val
);
#ifdef _WIN32
void
free_tmp_sh_file
();
void
free_win_path_patterns
();
#endif
/* For replace_column */
static
char
*
replace_column
[
MAX_COLUMNS
];
...
...
@@ -1471,10 +1462,6 @@ void free_used_memory()
free_root
(
&
require_file_root
,
MYF
(
0
));
free_re
();
my_free
(
read_command_buf
);
#ifdef _WIN32
free_tmp_sh_file
();
free_win_path_patterns
();
#endif
DBUG_VOID_RETURN
;
}
...
...
@@ -3204,33 +3191,6 @@ void do_source(struct st_command *command)
}
#if defined _WIN32
#ifdef USE_CYGWIN
/* Variables used for temporary sh files used for emulating Unix on Windows */
char
tmp_sh_name
[
64
],
tmp_sh_cmd
[
70
];
#endif
void
init_tmp_sh_file
()
{
#ifdef USE_CYGWIN
/* Format a name for the tmp sh file that is unique for this process */
my_snprintf
(
tmp_sh_name
,
sizeof
(
tmp_sh_name
),
"tmp_%d.sh"
,
getpid
());
/* Format the command to execute in order to run the script */
my_snprintf
(
tmp_sh_cmd
,
sizeof
(
tmp_sh_cmd
),
"sh %s"
,
tmp_sh_name
);
#endif
}
void
free_tmp_sh_file
()
{
#ifdef USE_CYGWIN
my_delete
(
tmp_sh_name
,
MYF
(
0
));
#endif
}
#endif
static
void
init_builtin_echo
(
void
)
{
#ifdef _WIN32
...
...
@@ -3346,14 +3306,12 @@ void do_exec(struct st_command *command)
}
#ifdef _WIN32
#ifndef USE_CYGWIN
/* Replace /dev/null with NUL */
while
(
replace
(
&
ds_cmd
,
"/dev/null"
,
9
,
"NUL"
,
3
)
==
0
)
;
/* Replace "closed stdout" with non existing output fd */
while
(
replace
(
&
ds_cmd
,
">&-"
,
3
,
">&4"
,
3
)
==
0
)
;
#endif
#endif
if
(
disable_result_log
)
...
...
@@ -3512,13 +3470,7 @@ int do_modify_var(struct st_command *command,
int
my_system
(
DYNAMIC_STRING
*
ds_cmd
)
{
#if defined _WIN32 && defined USE_CYGWIN
/* Dump the command into a sh script file and execute with system */
str_to_file
(
tmp_sh_name
,
ds_cmd
->
str
,
ds_cmd
->
length
);
return
system
(
tmp_sh_cmd
);
#else
return
system
(
ds_cmd
->
str
);
#endif
}
...
...
@@ -3552,12 +3504,10 @@ void do_system(struct st_command *command)
do_eval
(
&
ds_cmd
,
command
->
first_argument
,
command
->
end
,
!
is_windows
);
#ifdef _WIN32
#ifndef USE_CYGWIN
/* Replace /dev/null with NUL */
while
(
replace
(
&
ds_cmd
,
"/dev/null"
,
9
,
"NUL"
,
3
)
==
0
)
;
#endif
#endif
DBUG_PRINT
(
"info"
,
(
"running system command '%s' as '%s'"
,
...
...
@@ -9221,12 +9171,8 @@ int main(int argc, char **argv)
init_builtin_echo
();
#ifdef _WIN32
#ifndef USE_CYGWIN
is_windows
=
1
;
#endif
init_tmp_sh_file
();
init_win_path_patterns
();
#endif
read_command_buf
=
(
char
*
)
my_malloc
(
read_command_buflen
=
65536
,
MYF
(
MY_FAE
));
...
...
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